1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
Commit Graph

209235 Commits

Author SHA1 Message Date
Simon Pilgrim
b9e2a9c89d [DWARF] DWARFDebugLoc::dumpRawEntry - remove dead stores. NFCI.
Don't bother zeroing local (unused) variables just before returning.

Fixes clang static analyzer warning.
2021-01-07 12:53:28 +00:00
Alexey Bataev
5cd8182360 [SLP]Need shrink the load vector after reordering.
After merging the shuffles, we cannot rely on the previous shuffle
anymore and need to shrink the final shuffle, if it is required.

Reported in D92668

Differential Revision: https://reviews.llvm.org/D93967
2021-01-07 04:50:48 -08:00
Simon Pilgrim
ed64f8bab5 [DAG] Simplify OR(X,SHL(Y,BW/2)) eq/ne 0/-1 'all/any-of' style patterns
Attempt to simplify all/any-of style patterns that concatenate 2 smaller integers together into an and(x,y)/or(x,y) + icmp 0/-1 instead.

This is mainly to help some bool predicate reduction patterns where we end up concatenating bool vectors that have been bitcasted to integers.

Differential Revision: https://reviews.llvm.org/D93599
2021-01-07 12:03:19 +00:00
Jan Svoboda
88551a2c36 Reapply "[clang][cli] Allow users to specify a conditional to prevent parsing options with MarshallingInfo"
This reverts commit d0fa7a05 and fixes failing OptionMarshallingTest by adding the SHOULD_PARSE macro argument
2021-01-07 11:11:47 +01:00
Fraser Cormack
617f268f92 [RISCV] Add vector mask arithmetic ISel patterns
The patterns that want to use 'vnot' use a custom PatFrag. This is
because 'vnot' uses immAllOnesV which implicitly uses BUILD_VECTOR
rather than SPLAT_VECTOR.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D94078
2021-01-07 09:43:25 +00:00
Oliver Stannard
88767efa6e Revert "[llvm] Use BasicBlock::phis() (NFC)"
Reverting because this causes crashes on the 2-stage buildbots, for
example http://lab.llvm.org:8011/#/builders/7/builds/1140.

This reverts commit 9b228f107d43341ef73af92865f73a9a076c5a76.
2021-01-07 09:43:33 +00:00
Jan Svoboda
cd124bb53f Revert "[clang][cli] Allow users to specify a conditional to prevent parsing options with MarshallingInfo"
This reverts commit 77db83ae
2021-01-07 10:12:53 +01:00
Jan Svoboda
7640620549 [clang][cli] Allow users to specify a conditional to prevent parsing options with MarshallingInfo
Depends on D84189 & D93540.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D84674
2021-01-07 10:01:49 +01:00
LLVM GN Syncbot
c49ed45f02 [gn build] Port d2ddc694ff9 2021-01-07 08:29:23 +00:00
Gil Rapaport
b74280dc55 [LV] Merge tests into a single file (NFC)
In response to https://reviews.llvm.org/D94088#inline-879268
2021-01-07 09:04:07 +02:00
Ganesh Gopalasubramanian
1ebd32fffe [X86] Update tests for znver3
Differential Revision: https://reviews.llvm.org/D92812
2021-01-07 11:51:50 +05:30
Kazushi (Jam) Marukawa
06abe592f6 [VE][NFC] Update comments to match the generated instructions 2021-01-07 15:13:24 +09:00
Fangrui Song
9d72576890 [PowerPC] Delete dead Lower* 2021-01-06 21:58:40 -08:00
Fangrui Song
74fe4086d5 [PowerPC] Delete remnant Darwin ISelLowering code 2021-01-06 21:40:40 -08:00
Fangrui Song
fba3075f39 [PowerPC] Delete remnant isOSDarwin references 2021-01-06 21:18:35 -08:00
Sanjoy Das
ade1afb29b [NFC] Don't copy MachineFrameInfo on each invocation of HasAlias
Also fix a typo in a comment.  This fixes a compile time issue in XLA
(https://www.tensorflow.org/xla).

Differential Revision: https://reviews.llvm.org/D94182
2021-01-06 18:59:20 -08:00
Kazu Hirata
8fd273682c [llvm] Use llvm::all_of (NFC) 2021-01-06 18:27:36 -08:00
Kazu Hirata
745ad84858 [llvm] Use BasicBlock::phis() (NFC) 2021-01-06 18:27:35 -08:00
Kazu Hirata
3109d596ee [llvm] Use llvm::append_range (NFC) 2021-01-06 18:27:33 -08:00
Juneyoung Lee
871d4c4165 [InstSimplify] Fold insertelement vec, poison, idx into vec
This is a simple patch that adds folding from `insertelement vec, poison, idx` into `vec`.

Alive2 proof: https://alive2.llvm.org/ce/z/2y2vbC

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D93994
2021-01-07 10:10:14 +09:00
Juneyoung Lee
d269d5e555 [Constant] Add tests for ConstantVector::get (NFC) 2021-01-07 10:08:01 +09:00
Craig Topper
812d036280 [RISCV] Fix a few section number comments in RISCVInstrInfoVPseudos.td to match the V extension 1.0 draft spec. NFC
The majority of the comments use the 1.0 draft spec section numbers.
2021-01-06 16:38:30 -08:00
Juneyoung Lee
0b995628a9 [Constant] Update ConstantVector::get to return poison if all input elems are poison
The diff was reviewed at D93994
2021-01-07 09:26:07 +09:00
Kit Barton
52191ae5f0 [PPC] Remove old PPCSubTarget variable.
The PPCSubTarget variable has been replaced with the Subtarget variable. This
removes the remaining instances of PPCSubTarget as they are no longer necessary.
2021-01-06 17:44:07 -06:00
Jonas Devlieghere
2a4255c860 [Support] Untie the llvm::Signpost interface from llvm::Timer
Make llvm::Signpost more generic by untying from llvm::Timer. This
allows signposts to be used in a different context.

My motivation for doing this is being able to use signposts in LLDB.

Differential revision: https://reviews.llvm.org/D93655
2021-01-06 15:16:09 -08:00
Amara Emerson
f941e46d3b Fix failing triple test for macOS 11 with non-zero minor versions.
Differential Revision: https://reviews.llvm.org/D94197
2021-01-06 14:57:37 -08:00
Alina Sbirlea
d825615032 [DominatorTree] Add support for mixed pre/post CFG views.
Add support for mixed pre/post CFG views.

Update usages of the MemorySSAUpdater to use the new DT API by
requesting the DT updates to be done by the MSSAUpdater.

Differential Revision: https://reviews.llvm.org/D93371
2021-01-06 14:53:09 -08:00
Nikita Popov
c2d5b85909 [BasicAA] Fix BatchAA results for phi-phi assumptions
Change the way NoAlias assumptions in BasicAA are handled. Instead of
handling this inside the phi-phi code, always initially insert a
NoAlias result into the map and keep track whether it is used.
If it is used, then we require that we also get back NoAlias from
the recursive queries. Otherwise, the entry is changed to MayAlias.

Additionally, keep track of all location pairs we inserted that may
still be based on assumptions higher up. If it turns out one of those
assumptions is incorrect, we flush them from the cache.

The compile-time impact for the new implementation is significantly
higher than the previous iteration of this patch:
https://llvm-compile-time-tracker.com/compare.php?from=c0bb9859de6991cc233e2dedb978dd118da8c382&to=c07112373279143e37568b5bcd293daf81a35973&stat=instructions
However, it should avoid the exponential runtime cases we run into
if we don't cache assumption-based results entirely.

This also produces better results in some cases, because NoAlias
assumptions can now start at any root, rather than just phi-phi pairs.
This is not just relevant for analysis quality, but also for BatchAA
consistency: Otherwise, results would once again depend on query order,
though at least they wouldn't be wrong.

This ended up both more complicated and more expensive than I hoped,
but I wasn't able to come up with another solution that satisfies all
the constraints.

Differential Revision: https://reviews.llvm.org/D91936
2021-01-06 22:15:30 +01:00
Nikita Popov
273a7b5b40 [InstSimplify] Canonicalize non-demanded shuffle op to poison (NFCI)
I don't believe this has an observable effect, because the only
thing we care about here is replacing the operand with a constant
so following folds can apply. This change is just to make the
representation follow canonical unary shuffle form.
2021-01-06 21:22:27 +01:00
Nikita Popov
39fe1739db [InstSimplify] Fold call null/undef to poison
Calling null or undef results in immediate undefined behavior.
Return poison instead of undef in this case, similar to what
we do for immediate UB due to division by zero.
2021-01-06 21:09:30 +01:00
Nikita Popov
b3877826ec [PowerPC] Avoid call to undef in test (NFC)
Replace call to undef with a dummy function, to avoid affecting
this change by changes to call undef folding.
2021-01-06 21:09:02 +01:00
Arthur Eubanks
d2a6654c1b [test] Pin partial-unswitch.ll to legacy PM
The new PM does not have loop-unswitch, it only has simple-loop-unswitch.
2021-01-06 11:53:07 -08:00
Craig Topper
240b48a4b6 [RISCV] Return a vXi1 vector type from getSetCCResultType if V extension is enabled.
nvxXi1 types are legal with V extension and that's the result
vmseq/vmsne/vmslt/etc instructions return.

No test cases yet because the setcc isel patterns aren't in
and we'll need more than basic tests to observe this. I locally
tested that this plus D947078, D94168, D94142, and D94149
was enough to be able to handle the overflow result from
llvm.sadd.overflow.
2021-01-06 11:50:15 -08:00
Arthur Eubanks
c886828274 [test] Pin AMDGPU/opt-pipeline.ll to legacy PM
The pipeline being tested is specifically the legacy PM pipeline.
2021-01-06 11:44:16 -08:00
Arthur Eubanks
b6bbc7080f Fix non-assert builds after D93828 2021-01-06 11:42:03 -08:00
Nikita Popov
f1a3e21dd2 [InstSimplify] Fold out-of-bounds shift to poison
Make InstSimplify return poison rather than undef for out-of-bounds
shifts, as specified by LandRef:

> If op2 is (statically or dynamically) equal to or larger than the
> number of bits in op1, this instruction returns a poison value.

Differential Revision: https://reviews.llvm.org/D93998
2021-01-06 20:41:37 +01:00
Nikita Popov
0fd1d55185 [GVN] Regenerate test checks (NFC) 2021-01-06 20:41:36 +01:00
Sanjay Patel
55df2038d7 [SLP] use reduction kind's opcode to create new instructions; NFC
Similar to 5a1d31a28 -
This should be no-functional-change because the reduction kind
opcodes are 1-for-1 mappings to the instructions we are matching
as reductions. But we want to remove the need for the
`OperationData` opcode field because that does not work when
we start matching intrinsics (eg, maxnum) as reduction candidates.
2021-01-06 14:37:44 -05:00
Sanjay Patel
11d66ae09c [SLP] reduce code for propagating flags on reductions; NFC
If we add/change to match intrinsics, this might get more
wordy, but there's no need to list each kind currently.
2021-01-06 14:37:44 -05:00
Arthur Eubanks
44021712d5 [CGSCC][Coroutine][NewPM] Properly support function splitting/outlining
Previously when trying to support CoroSplit's function splitting, we
added in a hack that simply added the new function's node into the
original function's SCC (https://reviews.llvm.org/D87798). This is
incorrect since it might be in its own SCC.

Now, more similar to the previous design, we have callers explicitly
notify the LazyCallGraph that a function has been split out from another
one.

In order to properly support CoroSplit, there are two ways functions can
be split out.

One is the normal expected "outlining" of one function into a new one.
The new function may only contain references to other functions that the
original did. The original function must reference the new function. The
new function may reference the original function, which can result in
the new function being in the same SCC as the original function. The
weird case is when the original function indirectly references the new
function, but the new function directly calls the original function,
resulting in the new SCC being a parent of the original function's SCC.
This form of function splitting works with CoroSplit's Switch ABI.

The second way of splitting is more specific to CoroSplit. CoroSplit's
Retcon and Async ABIs split the original function into multiple
functions that all reference each other and are referenced by the
original function. In order to keep the LazyCallGraph in a valid state,
all new functions must be processed together, else some nodes won't be
populated. To keep things simple, this only supports the case where all
new edges are ref edges, and every new function references every other
new function. There can be a reference back from any new function to the
original function, putting all functions in the same RefSCC.

This also adds asserts that all nodes in a (Ref)SCC can reach all other
nodes to prevent future incorrect hacks.

The original hacks in https://reviews.llvm.org/D87798 are no longer
necessary since all new functions should have been registered before
calling updateCGAndAnalysisManagerForPass.

This fixes all coroutine tests when opt's -enable-new-pm is true by
default. This also fixes PR48190, which was likely due to the previous
hack breaking SCC invariants.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D93828
2021-01-06 11:19:15 -08:00
Fangrui Song
171489a04d [sanitizer] Define SANITIZER_GLIBC to refine SANITIZER_LINUX feature detection and support musl
Several `#if SANITIZER_LINUX && !SANITIZER_ANDROID` guards are replaced
with the more appropriate `#if SANITIZER_GLIBC` (the headers are glibc
extensions, not specific to Linux (i.e. if we ever support GNU/kFreeBSD
or Hurd, the guards may automatically work)).

Several `#if SANITIZER_LINUX && !SANITIZER_ANDROID` guards are refined
with `#if SANITIZER_GLIBC` (the definitions are available on Linux glibc,
but may not be available on other libc (e.g. musl) implementations).

This patch makes `ninja asan cfi lsan msan stats tsan ubsan xray` build on a musl based Linux distribution (apk install musl-libintl)
Notes about disabled interceptors for musl:

* `SANITIZER_INTERCEPT_GLOB`: musl does not implement `GLOB_ALTDIRFUNC` (GNU extension)
* Some ioctl structs and functions operating on them.
* `SANITIZER_INTERCEPT___PRINTF_CHK`: `_FORTIFY_SOURCE` functions are GNU extension
* `SANITIZER_INTERCEPT___STRNDUP`: `dlsym(RTLD_NEXT, "__strndup")` errors so a diagnostic is formed. The diagnostic uses `write` which hasn't been intercepted => SIGSEGV
* `SANITIZER_INTERCEPT_*64`: the `_LARGEFILE64_SOURCE` functions are glibc specific. musl does something like `#define pread64 pread`
* Disabled `msg_iovlen msg_controllen cmsg_len` checks: musl is conforming while many implementations (Linux/FreeBSD/NetBSD/Solaris) are non-conforming. Since we pick the glibc definition, exclude the checks for musl (incompatible sizes but compatible offsets)

Pass through LIBCXX_HAS_MUSL_LIBC to make check-msan/check-tsan able to build libc++ (https://bugs.llvm.org/show_bug.cgi?id=48618).

Many sanitizer features are available now.

```
% ninja check-asan
(known issues:
* ASAN_OPTIONS=fast_unwind_on_malloc=0 odr-violations hangs
)
...
Testing Time: 53.69s
  Unsupported      : 185
  Passed           : 512
  Expectedly Failed:   1
  Failed           :  12

% ninja check-ubsan check-ubsan-minimal check-memprof # all passed

% ninja check-cfi
( all cross-dso/)
...
Testing Time: 8.68s
  Unsupported      : 264
  Passed           :  80
  Expectedly Failed:   8
  Failed           :  32

% ninja check-lsan
(With GetTls (D93972), 10 failures)
Testing Time: 4.09s
  Unsupported:  7
  Passed     : 65
  Failed     : 22

% ninja check-msan
(Many are due to functions not marked unsupported.)
Testing Time: 23.09s
  Unsupported      :   6
  Passed           : 764
  Expectedly Failed:   2
  Failed           :  58

% ninja check-tsan
Testing Time: 23.21s
  Unsupported      :  86
  Passed           : 295
  Expectedly Failed:   1
  Failed           :  25
```

Used `ASAN_OPTIONS=verbosity=2` to verify there is no unneeded interceptor.

Partly based on Jari Ronkainen's https://reviews.llvm.org/D63785#1921014

Note: we need to place `_FILE_OFFSET_BITS` above `#include "sanitizer_platform.h"` to avoid `#define __USE_FILE_OFFSET64 1` in 32-bit ARM `features.h`

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D93848
2021-01-06 10:55:40 -08:00
Mircea Trofin
dfc42ff390 [NFC] Removed unused prefixes in CodeGen/AMDGPU
This covers tests starting with m-r.

Differential Revision: https://reviews.llvm.org/D94181
2021-01-06 10:32:44 -08:00
Simon Pilgrim
7ad1a31bb3 [X86] Add commuted patterns test coverage for D93599
Suggested by @spatel
2021-01-06 18:03:20 +00:00
Reid Kleckner
c62fcf404e [X86] Remove [ER]SP from all CSR lists
The CSR lists control which registers are spilled and reloaded in the
prologue and epilogue. The stack pointer is managed explicitly, and
should never be pushed or popped. Remove it from these lists. This
affected regcall and preserves all / most.

Differential Revision: https://reviews.llvm.org/D94118
2021-01-06 09:50:46 -08:00
Mircea Trofin
caabf4d62f [NFC] Removed unused prefixes from CodeGen/AMDGPU
All the 'l'-starting tests.

Differential Revision: https://reviews.llvm.org/D94151
2021-01-06 09:34:11 -08:00
Matt Arsenault
d575318898 AMDGPU/GlobalISel: Update fdiv lowering for denormal/ulp interaction
Change the GlobalISel fast fdiv handling to match the changes in
2531535984ad989ce88aeee23cb92a827da6686e and
884acbb9e167d5668e43581630239d688edec8ad
2021-01-06 12:32:01 -05:00
Peter Waller
d954147555 [llvm][NFC] Disallow all warnings in TypeSize tests
This is a follow-up to a request from a reviewer [0]. The text may change in
the future and these tests should not produce any warning output.

[0] https://reviews.llvm.org/D91806#inline-879243

Reviewed By: sdesmalen, david-arm

Differential Revision: https://reviews.llvm.org/D94161
2021-01-06 17:17:07 +00:00
Francesco Petrogalli
85e110e6e7 [InstCombine] Update valueCoversEntireFragment to use TypeSize
* Update valueCoversEntireFragment to use TypeSize.
* Add a regression test.
* Assertions have been added to protect untested codepaths.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D91806
2021-01-06 17:14:59 +00:00
Matt Arsenault
7090f445c5 AMDGPU/GlobalISel: Add baseline IR tests for fdiv
The fdiv lowering is currently split between an IR pass and codegen,
so make sure this works end to end. We also currently differ from the
DAG on some edge cases, which this will show in a future change.
2021-01-06 11:37:00 -05:00
Matt Arsenault
f1cf42a216 AMDGPU: Explicitly use SelectionDAG in legacy intrinsic tests
GlobalISel will probably not support the legacy buffer intrinsics, so
don't fail when the default is switched.
2021-01-06 11:37:00 -05:00