1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
Commit Graph

213086 Commits

Author SHA1 Message Date
Matt Arsenault
c1e5a01132 GlobalISel: Lower funnel shifts 2021-03-23 09:11:17 -04:00
Stefan Gränitz
53f4011707 [Orc] Allow OrcGenericABI variant of LazyCallThroughManager
Apply the way createLocalIndirectStubsManagerBuilder() deals with unsupported achritectures to createLocalLazyCallThroughManager(). The returned call-through manager is dysfunctional: It runs into an unreachable as soon as a lazy JIT attempts to use it. However, this results in broader platform support for lli in default (greedy) ORC mode where no lazy materialization is required.
2021-03-23 14:08:53 +01:00
LLVM GN Syncbot
86ad8655d2 [gn build] Port 274907c0a4d6 2021-03-23 13:01:57 +00:00
Sanjay Patel
679424b104 [SLP] allow matching integer min/max intrinsics as reduction ops
As noted in D98152, we need to patch SLP to avoid regressions when
we start canonicalizing to integer min/max intrinsics.
Most of the real work to make this possible was in:
7202f47508

Differential Revision: https://reviews.llvm.org/D98981
2021-03-23 08:56:44 -04:00
Luke Drummond
04cb9cdbd2 [NFC] clang-format llvm/lib/Transforms/Utils/CloneFunction.cpp
Differential Revision: https://reviews.llvm.org/D98957
2021-03-23 12:53:28 +00:00
Luke Drummond
1973029966 [NFC] Minor refactor
- Give unwieldy repeated expression a name
- Use a ranged `for` basic block iterator

Reviewed by: nikic, dexonsmith
Differential Revisision: https://reviews.llvm.org/D98957
2021-03-23 12:53:28 +00:00
Luke Drummond
2ad7366b78 [NFCI] cleanup CloneFunctionInto
Hoist early return for decl-only clones to before DIFinder
calculation.
Also fix an out of date assert message after invariants changed in
22a52dfddce.

Reviewed by: nikic, dexonsmith
Differential Revisision: https://reviews.llvm.org/D98957
2021-03-23 12:53:27 +00:00
Benjamin Kramer
0120c96a1f [AArch64] Fix unused variable warning 2021-03-23 13:42:14 +01:00
Fraser Cormack
7850d98674 [LangRef] Fix typos in the vector-type memory layout section
Reviewed By: bjope

Differential Revision: https://reviews.llvm.org/D99163
2021-03-23 12:28:50 +00:00
Nashe Mncube
2ae3297372 [llvm-opt] Bug fix within combining FP vectors
A bug was found within InstCombineCasts where a function call
is only implemented to work with FixedVectors. This caused a
crash when a ScalableVector was passed to this function.
This commit introduces a regression test which recreates the
failure and a bug fix.

Differential Revision: https://reviews.llvm.org/D98351
2021-03-23 12:13:41 +00:00
Florian Hahn
4f50cb5cf7 [AnnotationRemarks] Use subprogram location for summary remarks.
The summary remarks are generated on a per-function basis. Using the
first instruction's location is sub-optimal for 2 reasons:
  1. Sometimes the first instruction is missing !dbg
  2. The location of the first instruction may be mis-leading.

Instead, just use the location of the function directly.
2021-03-23 12:05:41 +00:00
David Green
e805b52fb9 [ARM] Additional Upper bound unrolling test. NFC 2021-03-23 12:00:40 +00:00
Florian Hahn
5808ddaf5b [AnnotationRemarks] Add test for annotation remarks with dbg locations.
The test illustrates that we not pick the debug location from the
function directly. This will be fixed in a follow-up patch.
2021-03-23 11:52:27 +00:00
Victor Campos
42c53cda4a [ARM] Handle debug instrs in ARM Low Overhead Loop pass
In function ConvertVPTBlocks(), it is assumed that every instruction
within a vector-predicated block is predicated. This is false for debug
instructions, used by LLVM.

Because of this, an assertion failure is reached when an input contains
debug instructions inside VPT blocks. In non-assert builds, an out of
bounds memory access took place.

The present patch properly covers the case of debug instructions.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D99075
2021-03-23 11:49:06 +00:00
David Sherwood
4f34d21d40 [LoopVectorize][NFC] Refactor code to use IRBuilder::CreateStepVector
In places where we create a ConstantVector whose elements are a
linear sequence of the form <start, start + 1, start + 2, ...>
I've changed the code to make use of CreateStepVector, which creates
a vector with the sequence <0, 1, 2, ...>, and a vector addition
operation. This patch is a non-functional change, since the output
from the vectoriser remains unchanged for fixed length vectors and
there are existing asserts that still fire when attempting to use
scalable vectors for vectorising induction variables.

In a later patch we will enable support for scalable vectors
in InnerLoopVectorizer::getStepVector(), which relies upon the new
stepvector intrinsic in IRBuilder::CreateStepVector.

Differential Revision: https://reviews.llvm.org/D97861
2021-03-23 11:29:05 +00:00
Jay Foad
3ba90099a4 [AMDGPU] Use non-compressed exports in a test. NFC.
I don't think there's any need for this test to use compressed exports.
Using normal exports seems a bit more straightforwards and avoids a tiny
bit of bitcasting.

Differential Revision: https://reviews.llvm.org/D99167
2021-03-23 11:18:12 +00:00
Abhina Sreeskantharajan
16157b30c5 [NFC] Formatting changes
This patch addresses some formatting changes from the comments in https://reviews.llvm.org/D97785.

Reviewed By: anirudhp

Differential Revision: https://reviews.llvm.org/D99072
2021-03-23 07:17:54 -04:00
Stefan Gränitz
7dcb34e448 Temporarily revert "[lli] Make -jit-kind=orc the default JIT engine"
This reverts commit eaee4f269645094f03f3aaff6b365176d63ab3e8.
2021-03-23 12:01:30 +01:00
David Sherwood
42a72164a2 [IR][SVE] Add new llvm.experimental.stepvector intrinsic
This patch adds a new llvm.experimental.stepvector intrinsic,
which takes no arguments and returns a linear integer sequence of
values of the form <0, 1, ...>. It is primarily intended for
scalable vectors, although it will work for fixed width vectors
too. It is intended that later patches will make use of this
new intrinsic when vectorising induction variables, currently only
supported for fixed width. I've added a new CreateStepVector
method to the IRBuilder, which will generate a call to this
intrinsic for scalable vectors and fall back on creating a
ConstantVector for fixed width.

For scalable vectors this intrinsic is lowered to a new ISD node
called STEP_VECTOR, which takes a single constant integer argument
as the step. During lowering this argument is set to a value of 1.
The reason for this additional argument at the codegen level is
because in future patches we will introduce various generic DAG
combines such as

  mul step_vector(1), 2 -> step_vector(2)
  add step_vector(1), step_vector(1) -> step_vector(2)
  shl step_vector(1), 1 -> step_vector(2)
  etc.

that encourage a canonical format for all targets. This hopefully
means all other targets supporting scalable vectors can benefit
from this too.

I've added cost model tests for both fixed width and scalable
vectors:

  llvm/test/Analysis/CostModel/AArch64/neon-stepvector.ll
  llvm/test/Analysis/CostModel/AArch64/sve-stepvector.ll

as well as codegen lowering tests for fixed width and scalable
vectors:

  llvm/test/CodeGen/AArch64/neon-stepvector.ll
  llvm/test/CodeGen/AArch64/sve-stepvector.ll

See this thread for discussion of the intrinsic:
https://lists.llvm.org/pipermail/llvm-dev/2021-January/147943.html
2021-03-23 10:43:35 +00:00
Vladislav Vinogradov
c7fbf3b5e8 [CMAKE] Fix cross-compilation build
Call `get_errc_messages` only if `LLVM_INCLUDE_TESTS` was set.

Reviewed By: zero9178, abhina.sreeskantharajan, jhenderson

Differential Revision: https://reviews.llvm.org/D98861
2021-03-23 13:24:08 +03:00
Fraser Cormack
e4bd7891be [RISCV] Optimize all-constant mask BUILD_VECTORs
This patch adds an optimization for mask-vector BUILD_VECTOR nodes whose
elements are all constants or undef. It lowers such operations by
building up the vector via a series of integer operations, in which
multiple mask elements are inserted into a vector at a time via
i8/i16/i32/i64 element types. The final result is then bitcast from that
integer vector.

We restrict this optimization in certain circumstances when optimizing
for size. If we are required to use more than one integer insert
operation, then it will likely increase code size compared with using a
load from a constant pool.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D98860
2021-03-23 10:11:19 +00:00
Florian Hahn
124f490c59 [VPlan] Include name when printing after 93a9d2de8f4f.
The name is included when printing in DOT mode. Also print it in non-DOT
mode after 93a9d2de8f4f.

This will become more important to distinguish different plans once
VPlans are gradually refined.
2021-03-23 09:50:14 +00:00
Stefan Gränitz
49fe160ae6 [lli] Fix ppc64le-clang-lnt-test bot: Keep test-call.ll a MCJIT-only test
No callback manager available for powerpc64le-unknown-linux-gnu
2021-03-23 10:47:57 +01:00
Simon Pilgrim
b4e2dcc01b [X86][AVX] Narrow VPBROADCASTQ->VPBROADCASTD if we don't need the upper bits.
Helps fix cases where we've splatted smaller types to a wider vector element type without needing the upper bits.

Avoid this on AVX512 targets as that can affect broadcast folding.
2021-03-23 09:41:02 +00:00
Stefan Gränitz
4b5fb80723 [lli] Make -jit-kind=orc the default JIT engine
MCJIT served well as the default JIT engine in lli for a long time, but the code is getting old and maintenance efforts don't seem to be in sight. In the meantime Orc became mature enough to fill that gap. The newly added greddy mode is very similar to the execution model of MCJIT. It should work as a drop-in replacement for common JIT tasks.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D98931
2021-03-23 10:22:34 +01:00
Roman Lebedev
3f2ee9f1ab [lit] Reliable progress indicator and ETA
Quality of progress bar and ETA in lit has always bothered me.

For example, given `./bin/llvm-lit /repositories/llvm-project/clang/test/CodeGen* -sv`
at 1%, it says it will take 10 more minutes,
at 25%, it says it will take 1.25 more minutes,
at 50%, it says it will take 30 more seconds,
and in the end finishes with `Testing Time: 39.49s`. That's rather wildly unprecise.

Currently, it assumes that every single test will take the same amount of time to run on average.
This is is a somewhat reasonable approximation overall, but it is quite clearly imprecise,
especially in the beginning.

But, we can do better now, after D98179! We now know how long the tests took to run last time.
So we can build a better ETA predictor, by accumulating the time spent already,
the time that will be spent on the tests for which we know the previous time,
and for the test for which we don't have previous time, again use the average time
over the tests for which we know current or previous run time.
It would be better to use median, but i'm wary of the cost that may incur.

Now, on **first** run of `./bin/llvm-lit /repositories/llvm-project/clang/test/CodeGen* -sv`
at 10%, it says it will take 30 seconds,
at 25%, it says it will take 50 more seconds,
at 50%, it says it will take 27 more seconds,
and in the end finishes with `Testing Time: 41.64s`. That's pretty reasonable.

And on second run of `./bin/llvm-lit /repositories/llvm-project/clang/test/CodeGen* -sv`
at 1%, it says it will take 1 minutes,
at 25%, it says it will take 30 more seconds,
at 50%, it says it will take 19 more seconds,
and in the end finishes with `Testing Time: 39.49s`. That's amazing i think!

I think people will love this :)

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D99073
2021-03-23 12:16:19 +03:00
Juneyoung Lee
ba5c93c7e6 Reland "[InstCombine] Add simplification of two logical and/ors"
This relands 07c3b97e184d5bd828b8a680cdce46e73f3db9fc (D96945) which was reverted by
commit f49354838e526671e616d16199ebdee653b9f6fa.
The two-stage compilation successfully tests passes on my machine.
2021-03-23 16:24:50 +09:00
Fangrui Song
4312c5686d [SanitizerCoverage] Use External on Windows
This should fix https://reviews.llvm.org/D98903#2643589 though
it is not clear to me why ExternalWeak does not work.
2021-03-22 23:05:36 -07:00
Serguei Katkov
16d6334a66 [RS4GC] Fix hang on infinite loop
meetBDVState utility may sets the base pointer for the conflict state.
At this moment the base for conflict state does not have any meaning but
is used in comparison of BDV states. This comparison is used as an indicator
of progress done on iteration and RS4GC pass uses infinite loop to reach
fixed point.
As a result for added test on each iteration state for some phi nodes is updated
with other base value for conflict state and it indicates as a progress while
for conflict state there is no any progress more possible.
In reality the base value is transferred from one state to another and pass
detects the progress on these states.

The test is very fragile. The traversal order of states and operands of phi nodes
plays important role.

Reviewers: reames, dantrushin
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D99058
2021-03-23 12:54:51 +07:00
Serge Pavlov
dcceebd05b [TableGen] Tiny enhancement
Differential Revision: https://reviews.llvm.org/D99057
2021-03-23 12:49:05 +07:00
Pushpinder Singh
d50fb5ee95 [GlobalISel][AMDGPU] Lower G_UMULO/G_SMULO
Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D93963
2021-03-23 05:45:43 +00:00
Max Kazantsev
c48947a953 [NFC] Fix typo longre -> longer 2021-03-23 12:13:52 +07:00
Serge Pavlov
7a00ea0bf0 [TableGen] Allow BitsInit to init integer in pseudo expansion
Differential Revision: https://reviews.llvm.org/D99057
2021-03-23 11:50:55 +07:00
Rahman Lavaee
325b500b46 [llvm-readelf, propeller] Add fallthrough bit to basic block metadata in BB-Address-Map section.
This patch adds a fallthrough bit to basic block metadata, indicating whether the basic block can fallthrough without taking any branches. The bit will help us avoid an intel LBR bug which results in occasional duplicate entries at the beginning of the LBR stack.

This patch uses `MachineBasicBlock::canFallThrough()` to set the bit. This is not a const method because it eventually calls `TargetInstrInfo::analyzeBranch`, but it calls this function with the default `AllowModify=false`. So we can either make the argument to the `getBBAddrMapMetadata` non-const, or we can use `const_cast` when calling `canFallThrough`. I decide to go with the latter since this is purely due to legacy code, and in general we should not allow the BasicBlock to be mutable during `getBBAddrMapMetadata`.

Reviewed By: tmsriram

Differential Revision: https://reviews.llvm.org/D96918
2021-03-22 21:38:05 -07:00
Tony
7be40b4abf [AMDGPU] Reserve ELF code
Reserve AMD GPU ELF machine code 0x040.

Minor AMDGPUUsage format consistency change.

Reviewed By: kzhuravl

Differential Revision: https://reviews.llvm.org/D99122
2021-03-23 04:30:38 +00:00
Craig Topper
a23248d3c9 [RISCV] Add scheduler classes to Zfh instructions.
Reviewed By: HsiangKai

Differential Revision: https://reviews.llvm.org/D99053
2021-03-22 20:30:09 -07:00
Craig Topper
d8e6baf366 [RISCV] Remove unused SchedWrites WriteFConv32/WriteFConv64/WriteFMov32/WriteFMov64.
It doesn't look like any instructions have ever been assigned to these classes.

Reviewed By: HsiangKai

Differential Revision: https://reviews.llvm.org/D99050
2021-03-22 20:29:18 -07:00
Carl Ritson
235428ba54 [AMDGPU] Only unbundle memory accesses in SIMemoryLegalizer
This restores previous behaviour and is a step toward removing
unbundling entirely.

Reviewed By: foad, rampitec

Differential Revision: https://reviews.llvm.org/D99061
2021-03-23 11:30:36 +09:00
Craig Topper
0612d33cf4 [RISCV] Rename Zb* extension tests to use lower case 'Z' in file names.
As discussed in D99009
2021-03-22 19:17:04 -07:00
Philip Reames
ba66e19f46 [test] precommit another test for point-in-time deref semantics 2021-03-22 19:11:19 -07:00
Philip Reames
053fdd1b0a [tests] Expand tests for point-in-time dereferenceability 2021-03-22 18:56:57 -07:00
Philip Reames
08288bc355 Minor format tweak to deref analysis printer 2021-03-22 18:44:18 -07:00
Jonas Devlieghere
e33ed822d1 [dsymutil] Fix spurious warnings for missing symbols with thinLTO
Fix spurious warnings for missing symbols with thinLTO. The latter
appends a unique suffix to avoid collisions for exported private
symbols, resulting in dsymutil complaining it couldn't find the symbol
in the object file.

rdar://75434058

Differential revision: https://reviews.llvm.org/D99125
2021-03-22 18:36:39 -07:00
Philip Reames
a2cee22477 [deref] Split a test to show both global and pointwise semantics
While doing so, also split one monster test into individually named test functions.
2021-03-22 18:34:40 -07:00
Gulfem Savrun Yeniceri
61bfb34ac2 Revert "[Passes] Add relative lookup table converter pass"
This reverts commit 78a65cd945d006ff02f9d24d9cc20a302ed93b08 which
caused buildbot failures.
2021-03-23 00:43:16 +00:00
Juneyoung Lee
1110a879fe Reland "[SimplifyCFG] Update FoldBranchToCommonDest to be poison-safe"
This relands commit 99108c791de0285ee726a10e8274772b18cee73c (D95026) which was
reverted by 8d5a981a135a0f0ae0a10c59b7c8093aae1c28de because the underlying
problem (https://llvm.org/pr49495) is fixed.
2021-03-23 09:19:53 +09:00
Gulfem Savrun Yeniceri
947cc1dce8 [doc] Fix typo in rel lookup table converter pass
Add additonal hypens to match the title size that was introduced in 78a65cd.
2021-03-22 23:25:06 +00:00
Nico Weber
6970f680e4 [gn build] fix typo in 78a65cd945d 2021-03-22 18:38:17 -04:00
Gulfem Savrun Yeniceri
59cc51764b [Passes] Add relative lookup table converter pass
Lookup tables generate non PIC-friendly code, which requires dynamic relocation as described in:
https://bugs.llvm.org/show_bug.cgi?id=45244

This patch adds a new pass that converts lookup tables to relative lookup tables to make them PIC-friendly.

Differential Revision: https://reviews.llvm.org/D94355
2021-03-22 22:09:02 +00:00
Roman Lebedev
e26b9efa2d [NFC][SROA] Add some more tests for speculation around PHI's 2021-03-23 00:51:18 +03:00