1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

202832 Commits

Author SHA1 Message Date
Amara Emerson
399486642d [GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred), _, _)
This is needed for an upcoming change to how we translate conditional branches
which might generate these.

Differential Revision: https://reviews.llvm.org/D86383
2020-09-01 10:57:17 -07:00
Eric Astor
6aff3ef558 x87 FPU state instructions do not use an f32 memory location
These instructions actually use a 512-byte location, where bytes 464-511 are ignored.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D86942
2020-09-01 13:50:07 -04:00
Matt Arsenault
5e713f621a GlobalISel: Implement computeNumSignBits for G_SELECT 2020-09-01 12:50:19 -04:00
Matt Arsenault
731e73be24 GlobalISel: Port smarter known bits for umin/umax from DAG 2020-09-01 12:50:15 -04:00
Matt Arsenault
942cf2892e GlobalISel: Implement computeKnownBits for G_BSWAP and G_BITREVERSE 2020-09-01 12:49:57 -04:00
Qiu Chaofan
594eb7ba1d [PowerPC] Handle STRICT_FSETCC(S) in more cases
On -O0, i1 strict_fsetcc will be promoted to i32. We don't handle that
in TD patterns. This patch fills logic in PPCISelDAGToDAG to handle more
cases.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D86595
2020-09-02 00:33:21 +08:00
Sam Tebbs
745bb7deaa [DAGCombiner] Fold an AND of a masked load into a zext_masked_load
This patch folds an AND of a masked load and build vector into a zero
extended masked load.

Differential Revision: https://reviews.llvm.org/D86789
2020-09-01 17:02:07 +01:00
Amy Kwan
5ef8594309 [PowerPC] Implement instruction definitions/MC Tests for xvcvspbf16 and xvcvbf16spn
This patch adds the td instruction definitions of the xvcvspbf16 and xvcvbf16spn
instructions, along with their respective MC tests.

Differential Revision: https://reviews.llvm.org/D86794
2020-09-01 10:59:43 -05:00
Volkan Keles
72df60b8c0 GlobalISel: Add combines for extend operations
https://reviews.llvm.org/D86516
2020-09-01 08:50:06 -07:00
Matt Arsenault
b0476e1c15 GlobalISel: Implement computeNumSignBits for G_SEXTLOAD/G_ZEXTLOAD 2020-09-01 11:20:02 -04:00
Matt Arsenault
fbbea16c6b GlobalISel: Implement computeKnownBits for G_UNMERGE_VALUES 2020-09-01 11:19:27 -04:00
Paul Walker
b7e7bd3c3d Revert "Reapply D70800: Fix AArch64 AAPCS frame record chain"
This reverts commit e9d9a612084b47fc4277523561d61e675370c854.

This patch was previously revert by 04879086b44348cad600a0a1ccbe1f7776cc3cf9
with the reapplication being done after breaking the assert used to
ensure SP is always 16-byte aligned, which is a requirement of the AAPCS.

For extra context the latest patch caused runtime failures when
building with "-march=armv8-a+sve -mllvm -aarch64-sve-vector-bits-min=256".
2020-09-01 16:09:37 +01:00
Matt Arsenault
2c2bfb8ff0 GlobalISel: Artifact combine unmerge of unmerge
Unmerges have the same fundamental problem as G_TRUNC, and G_TRUNC
could be implemented in terms of G_UNMERGE_VALUES. Reducing the number
of elements in unmerge results ends up producing the original unmerge
type profile, so the artifact combiner needs to eliminate the
intermediate illegal registers. This avoids infinite looping in the
legalizer in a future change.

Assuming an unmerge has each result unmerged the same way, this ends
up producing a new unmerge of the source for every definition. I'm not
sure if the artifact combiner should either insert temporary merges
here and erase the original merge, or if the combiner should look at
uses from defs rather than defs from uses for unmerges.

In a few cases this regresses from using 16-bit shifts for 8-bit
values to using 32-bit shifts, but I think these can be legalized
later (the other legalization rules don't try very hard to use 16-bit
shifts either).
2020-09-01 11:01:33 -04:00
Matt Arsenault
0b482d168b PowerPC: Switch test to generated checks 2020-09-01 11:01:02 -04:00
Matt Arsenault
d53b63f0b3 AMDGPU: Check some offsets in test
This will make updating the checks easier in a future change.
2020-09-01 11:01:02 -04:00
Matt Arsenault
0dc8d17f28 AMDGPU: Convert test to MIR
Currently the dbg_value ends up in the relaxed branch block. A future
commit will push the dbg_value out of this block, and I'm not sure how
to coax the IR into producing the same MIR at the relevant point.
2020-09-01 11:01:02 -04:00
Anh Tuyen Tran
c3a3d1596a [LoopIdiomRecognizePass] Options to disable part or the entire Loop Idiom Recognize Pass
Loop Idiom Recognize Pass (LIRP) attempts to transform loops with subscripted arrays
into memcpy/memset function calls. In some particular situation, this transformation
introduces negative impacts. For example: https://bugs.llvm.org/show_bug.cgi?id=47300

This patch will enable users to disable a particular part of the transformation, while
he/she can still enjoy the benefit brought about by the rest of LIRP. The default
behavior stays unchanged: no part of LIRP is disabled by default.

Reviewed By: etiotto (Ettore Tiotto)

Differential Revision: https://reviews.llvm.org/D86262
2020-09-01 13:59:24 +00:00
Georgii Rymar
41a5636b6f [llvm-readobj] - Remove Error.cpp,.h and drop dependencies in the code.
We have Error.cpp/.h which contains some code for working with error codes.
In fact we use Error/Expected<> almost everywhere already and we can get rid
of these files.

Note: a few places in the code used readobj specific error codes,
e.g. `return readobj_error::unknown_symbol`. But these codes are never really used,
i.e. the code checks the fact of a success/error call only.
So I've changes them to `return inconvertibleErrorCode()` for now.
It seems that these places probably should be converted to use `Error`/`Expected<>`.

Differential revision: https://reviews.llvm.org/D86772
2020-09-01 16:46:17 +03:00
Sanjay Patel
41c06ff50d [InstCombine] adjust recip sqrt tests for better coverage; NFC
Goes with D86726
2020-09-01 09:43:42 -04:00
Raphael Isemann
c3c7a59967 Reland [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library
This relands e9a3d1a401b07cbf7b11695637f1b549782a26cd which was originally
missing linking LLVMSupport into LLMVFileCheck which broke the SHARED_LIBS build.

Original summary:

The actual FileCheck logic seems to be implemented in LLVMSupport. I don't see a
good reason for having FileCheck implemented there as it has a very specific use
while LLVMSupport is a dependency of pretty much every LLVM tool there is. In
fact, the only use of FileCheck I could find (outside the FileCheck tool and the
FileCheck unit test) is a single call in GISelMITest.h.

This moves the FileCheck logic to its own LLVMFileCheck library. This way only
FileCheck and the GlobalISelTests now have a dependency on this code.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D86344
2020-09-01 14:59:28 +02:00
Xing GUO
30fe55a858 [llvm-dwarfdump][test] Add tests for dumping the .debug_line_str section.
This patch adds tests for dumping the .debug_line_str section. The
dumper of the debug_line_str section is able to write nonprintable
strings as escaped chars while the dumper of the debug_str and
debug_str.dwo sections cannot. I will fix them and add tests for them
in a follow-up patch.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D86916
2020-09-01 20:22:01 +08:00
Georgii Rymar
9b7fcf0c26 [llvm-readobj][test] - Remove amdgpu-elf-definitions.test
`amdgpu-elf-definitions.test` is a file that tests
`Format`, 'OS/ABI' and 'Machine' fields printed for EM_AMDGPU.
It uses a precompiled object.

It is not needed to have it, because:
1) We already test formats in `file-header-format.test` + `llvm/unittests/Object/ELFObjectFileTest.cpp`.
2) We test 'OS/ABI' in `file-header-os-abi.test` for all possible values.
3) We test machine types in `file-header-machine-types.test`

In addition we have `amdgpu-elf-headers.test` which tests EM_AMDGPU specific flags. I.e.
it also tests the fact that llvm-readobj/elf are able to dump such objects.

This patch removes the test case and the corresponding binary.

Differential revision: https://reviews.llvm.org/D86774
2020-09-01 14:04:14 +03:00
Georgii Rymar
15a336cfd6 [llvm-readobj][test] - Update the comment in archive.test
Addresses post commit review comment for D86771.
2020-09-01 14:02:13 +03:00
Georgii Rymar
522d076ef9 [llvm-readobj/elf] - Report warnings instead of errors when dumping broken stack sizes sections.
This replaces `reportError` calls with `reportUniqueWarning` and improves testing
for the code that is related to stack sizes dumping.

Differential revision: https://reviews.llvm.org/D86783
2020-09-01 13:46:54 +03:00
Sourabh Singh Tomar
0940e21689 [NFCI] Removed an un-used declaration got accidentally introduced in f91d18eaa946b2d2ea5a9 2020-09-01 15:59:04 +05:30
Raphael Isemann
02ebf2f3b4 Revert "[lldb] Add reproducer verifier"
This reverts commit 297f69afac58fc9dc13897857a5e70131c5adc85. It broke
the Fedora 33 x86-64 bot. See the review for more info.
2020-09-01 12:21:44 +02:00
David Sherwood
c4d572ac0e [SVE][CodeGen] Fix TypeSize/ElementCount related warnings in sve-split-load.ll
I have fixed up a number of warnings resulting from TypeSize -> uint64_t
casts and calling getVectorNumElements() on scalable vector types. I
think most of the changes are fairly trivial except for those in
DAGTypeLegalizer::SplitVecRes_MLOAD I've tried to ensure we create
the MachineMemoryOperands in a sensible way for scalable vectors.

I have added a CHECK line to the following test:

  CodeGen/AArch64/sve-split-load.ll

that ensures no new warnings are added.

Differential Revision: https://reviews.llvm.org/D86697
2020-09-01 07:47:59 +01:00
David Green
c8b43e910b Revert "[ARM] Register pressure with -mthumb forces register reload before each call"
Expensive checks are failing, complaining about additional MMO operands
added to the branch.
2020-09-01 07:39:54 +01:00
Max Kazantsev
6748e7476e [Test] Move IndVars test to a proper place 2020-09-01 12:17:31 +07:00
Petr Hosek
11e2ca0270 [CMake] Use find_library for ncurses
Currently it is hard to avoid having LLVM link to the system install of
ncurses, since it uses check_library_exists to find e.g. libtinfo and
not find_library or find_package.

With this change the ncurses lib is found with find_library, which also
considers CMAKE_PREFIX_PATH. This solves an issue for the spack package
manager, where we want to use the zlib installed by spack, and spack
provides the CMAKE_PREFIX_PATH for it.

This is a similar change as https://reviews.llvm.org/D79219, which just
landed in master.

Patch By: haampie

Differential Revision: https://reviews.llvm.org/D85820
2020-08-31 20:06:21 -07:00
Alina Sbirlea
c9a8d991e6 [MemorySSA] Clean up single value phis.
MemoryPhis with a single value are correct, but can lead to errors when
updating. Clean up single entry Phis newly added when cloning blocks.
Resolves PR46574.
2020-08-31 19:26:08 -07:00
Xing GUO
45321f3e73 [DWARFYAML] Make the debug_str section optional.
This patch makes the debug_str section optional. When the debug_str
section exists but doesn't contain anything, yaml2obj will emit a
section header for it.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D86860
2020-09-01 10:02:09 +08:00
Hamilton Tobon Mosquera
aef078ab19 [OpenMPOpt][NFC] Moving constants as struct static attributes 2020-08-31 19:05:00 -05:00
Christopher Tetreault
b93c073189 [SVE] Remove calls to VectorType::getNumElements() from llvm-stress
Differential Revision: https://reviews.llvm.org/D86898
2020-08-31 15:51:15 -07:00
Lang Hames
8c3159bb6b [ORC] Remove an unused variable.
The unused Main variable was accidentally left in an earlier commit.
2020-08-31 15:35:55 -07:00
Jonas Devlieghere
7448020ce4 [lldb] Add reproducer verifier
Add a reproducer verifier that catches:

 - Missing or invalid home directory
 - Missing or invalid working directory
 - Missing or invalid module/symbol paths
 - Missing files from the VFS

The verifier is enabled by default during replay, but can be skipped by
passing --reproducer-no-verify.

Differential revision: https://reviews.llvm.org/D86497
2020-08-31 15:14:18 -07:00
Christopher Tetreault
bcc3cadef7 [SVE] Mark VectorType::getNumElements() deprecated
getNumElements() is being removed from base VectorType in
order to eliminate the class of bugs in which a scalable vector
is accidentally treated like a fixed length vector. Clients of
this function should either call getElementCount(), and handle
the case where getElementCount().isScalable() is true, or they can
cast to FixedVectorType and call getNumElements() if they are
sure that the vector has fixed width.

Deprecated VectorType functions will be removed after the LLVM
12 branch.

See: http://lists.llvm.org/pipermail/llvm-dev/2020-March/139811.html

Reviewed By: fpetrogalli

Differential Revision: https://reviews.llvm.org/D78127
2020-08-31 15:13:04 -07:00
Hamilton Tobon Mosquera
b5757ca2c4 [OpenMPOpt][HideMemTransfersLatency] Get values stored in offload arrays
getValuesInOffloadArrays goes through the offload arrays in __tgt_target_data_begin_mapper getting the values stored in them before the call is issued.

call void @__tgt_target_data_begin_mapper(arg0, arg1,
    i8** %offload_baseptrs, i8** %offload_ptrs, i64* %offload_sizes,
...)

Diferential Revision: https://reviews.llvm.org/D86300
2020-08-31 15:33:05 -05:00
Arthur Eubanks
8e53f78912 [docs] Fix indentation in FileCheck.rst
Fixes
C:\src\llvm-project\llvm\docs\CommandGuide\FileCheck.rst:745:Bullet list ends without a blank line; unexpected unindent.
2020-08-31 13:20:04 -07:00
Craig Topper
0ce780b084 [X86][CGP] Add gather test cases for D86371. 2020-08-31 13:12:53 -07:00
Sanjay Patel
251968146e [IR][GVN] allow intrinsics in Instruction's isCommutative query (2nd try)
The 1st try was reverted because I missed an assert that
needed softening.

As discussed in D86798 / rG09652721 , we were potentially
returning a different result for whether an Instruction
is commutable depending on if we call the base class or
derived class method.

This requires relaxing asserts in GVN, but that pass
seems to be working otherwise.

NewGVN requires more work because it uses different
code paths for numbering binops and calls.
2020-08-31 16:01:19 -04:00
Christopher Tetreault
6b50d3055a [SVE] Remove calls to VectorType::getNumElements from InstCombine
Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D82237
2020-08-31 12:59:10 -07:00
Roman Lebedev
4aba95741f [NFC][InstCombine] visitPHINode(): cleanup PHI CSE instruction replacement
As @nikic is pointing out in https://reviews.llvm.org/rGbf21ce7b908e#inline-4647
this must be sufficient otherwise `EliminateDuplicatePHINodes()`
would have hit issues with it already.
2020-08-31 22:29:39 +03:00
Martin Storsjö
ecdd8dabe2 [ORC] Remove a stray semicolon, silencing warnings. NFC. 2020-08-31 22:25:25 +03:00
Prathamesh Kulkarni
e87ae397a6 [ARM] Register pressure with -mthumb forces register reload before each call
This patch implements the foldMemoryOperand hook in Thumb1InstrInfo,
allowing tBLXr and a spilled function address to be combined back into a
tBL. This can help with codesize at Oz, especailly in the tinycrypt
library.

Differential Revision: https://reviews.llvm.org/D79785
2020-08-31 20:00:30 +01:00
Craig Topper
94e25784f5 [X86][CGP] Pre-commit test cases for D86371. 2020-08-31 10:48:56 -07:00
Qiu Chaofan
55050110d2 [NFC] [DAGCombiner] Refactor bitcast folding within fabs/fneg
fabs and fneg share a common transformation:

(fneg (bitconvert x)) -> (bitconvert (xor x sign))
(fabs (bitconvert x)) -> (bitconvert (and x ~sign))

This patch separate the code into a single method.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D86862
2020-09-01 00:48:12 +08:00
Qiu Chaofan
9b5b508e71 [NFC] [DAGCombiner] Remove unnecessary negation in visitFNEG
In visitFNEG of DAGCombiner, the folding of (fneg (fsub c, x)) is
redundant since getNegatedExpression already handles it.
2020-09-01 00:35:01 +08:00
Florian Hahn
102583c8b4 [llvm-reduce] Create returns with undef values for non-void functions.
Currently replaceBranchTerminator/removeUninterestingBBsFromSwitch
always creates `ret void` instructions if no successor is in the chunk.

This results in invalid IR for functions with non-void return types,
which makes those reductions unfeasible. Instead, create `ret ty undef`
for functions with non-void return types.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D86849
2020-08-31 16:33:46 +01:00
Sean Fertile
73015ddfca [PowerPC][AIX] Add test for returning a vector type. [NFC]
Shows error produced when trying to return a vector, which is not
yet supported.
2020-08-31 11:14:17 -04:00