Commit Graph

23415 Commits

Author SHA1 Message Date
Craig Topper d70b230f0a [X86] Use Ld scheduler classes for instructions with folded loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 07:06:35 +00:00
Craig Topper 16c3915929 [X86] Correct the FMA3 regular expressions in the znver1 scheduler model.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320458 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 07:06:32 +00:00
Richard Trieu 4d049d8cfa Revert r318704 - [Sparc] efficient pattern for UINT_TO_FP conversion
See bug https://bugs.llvm.org/show_bug.cgi?id=35631
r318704 is giving a fatal error on some code with unsigned to floating point
conversions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 22:25:04 +00:00
Matt Arsenault c009e3de76 LSR: Check more intrinsic pointer operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 21:38:43 +00:00
Tony Jiang 5f52d2457c [PowerPC] Partially enable the ISEL expansion pass.
The pass to expand ISEL instructions into if-then-else sequences in patch D23630
is currently disabled. This patch partially enable it by always removing the
unnecessary ISELs (all registers used by the ISELs are the same one) and folding
the ISELs which have the same input registers into unconditional copies.

Differential Revision: https://reviews.llvm.org/D40497

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320414 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 20:42:37 +00:00
Krzysztof Parzyszek 50b5493cd6 [Hexagon] Add support for Hexagon V65
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320404 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 18:57:54 +00:00
Simon Pilgrim fd2e2d7cc7 [X86] Add LODS schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320403 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 18:39:42 +00:00
Simon Pilgrim 9497cd45ac [X86] Add CMP/TEST schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320402 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 18:32:59 +00:00
Simon Pilgrim a25caac084 [X86] Add AND/OR/XOR schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320400 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 18:23:24 +00:00
Simon Pilgrim c7bd85c064 [X86] Add ADD/SUB schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320397 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 18:13:40 +00:00
Simon Pilgrim 896b8ae1e0 [X86] Add ADC/SBB schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320395 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 17:59:05 +00:00
Simon Pilgrim 1713346d3b [X86] Add MOVSLQ schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320392 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 17:37:08 +00:00
Amara Emerson 4feece4289 [GlobalISel] Disable GISel for big endian.
This is due to PR26161 needing to be resolved before we can fix
big endian bugs like PR35359. The work to split aggregates into smaller LLTs
instead of using one large scalar will take some time, so in the mean time
we'll fall back to SDAG.

Some ARM BE tests xfailed for now as a result.

Differential Revision: https://reviews.llvm.org/D40789

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320388 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 16:58:29 +00:00
Simon Pilgrim 233e2ed2b9 [X86] Add LWP schedule tests
Tag LWP instructions as WriteSystem

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320387 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 16:47:21 +00:00
Simon Pilgrim b478f883ad [X86] Add INT/INTO schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320386 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 16:32:58 +00:00
Simon Pilgrim 49db9d5a54 [X86] Add IN/OUT schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320385 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 16:16:40 +00:00
Simon Pilgrim 9645076a52 [X86] Add IDIV schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320384 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 16:08:21 +00:00
Simon Pilgrim 00dfcddeb6 [X86] Add CMPXCHG schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320383 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 16:04:08 +00:00
Simon Pilgrim db0d1d38ba [X86] Add CLZERO schedule test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320382 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 15:53:12 +00:00
Simon Pilgrim aaffd12856 [X86] Add ADCX/ADOX/XADD/XLAT schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320380 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 15:41:52 +00:00
Nirav Dave 90ece7135a [X86] Modify Nontemporal tests to avoid deadstore optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320379 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 15:35:40 +00:00
Simon Pilgrim 8e6aca91b2 [X86] Add SETCC/STC/STD/UD2 schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320376 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 15:25:31 +00:00
Sanjay Patel 7e1d1537d3 [DAGCombiner] protect against an infinite loop between shl <--> mul (PR35579)
At first, I tried to thread the x86 needle and use a target hook (isVectorShiftByScalarCheap())
to disable the transform only for non-splat pow-of-2 constants, but not AVX2, but only some
element types, but...it's difficult.

Here we just avoid the loop with the x86 vector transform that conflicts with the general DAG
combine and preserve all of the existing behavior AFAICT otherwise.

Some tests that will probably fail if someone does try to restrict this in a more targeted way
for x86-only may be found in:

test/CodeGen/X86/combine-mul.ll
test/CodeGen/X86/vector-mul.ll
test/CodeGen/X86/widen_arith-5.ll

This should prevent the infinite looping seen with:
https://bugs.llvm.org/show_bug.cgi?id=35579

Differential Revision: https://reviews.llvm.org/D41040


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320374 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 15:19:31 +00:00
Simon Pilgrim 302da6a9cc [X86] Add SAR/SHL/SHR schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320371 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 14:56:44 +00:00
Simon Pilgrim d8ae43374c [X86] Add RCL/RCR schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320370 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 14:46:42 +00:00
Krzysztof Parzyszek 5a03908a66 [Hexagon] Crash in instruction selection for insert_vector_elt for HVX
A wrong type was passed to insertVector, causing an out-of-bounds value
to be added an an operand to HexagonISD::INSERT. This later failed in
instruction selection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320369 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 14:46:06 +00:00
Nemanja Ivanovic 6c0ae87241 [PowerPC] Sign-extend negative constant stores
Second part of https://reviews.llvm.org/D40348.
Revision r318436 has extended all constants feeding a store to 64 bits
to allow for CSE on the SDAG. However, negative constants were zero extended
which made the constant being loaded appear to be a positive value larger than
16 bits. This resulted in long sequences to materialize such constants
rather than simply a "load immediate". This patch just sign-extends those
updated constants so that they remain 16-bit signed immediates if they started
out that way.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320368 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 14:35:48 +00:00
Diana Picus a4f4129e20 [ARM GlobalISel] Add test for a MOVTi16 pattern. NFC
Add test for matching an OR with 0xFFFF0000 to a MOVTi16.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320362 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 13:28:45 +00:00
Simon Pilgrim 504620ed99 [X86] Add fsgsbase schedule tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 13:25:02 +00:00
Alex Bradbury 181a9c9bcd [RISCV] Add custom CC_RISCV calling convention and improved call support
The TableGen-based calling convention definitions are inflexible, while
writing a function to implement the calling convention is very
straight-forward, and allows difficult cases to be handled more easily. With
this patch adds support for:
* Passing large scalars according to the RV32I calling convention
* Byval arguments
* Passing values on the stack when the argument registers are exhausted

The custom CC_RISCV calling convention is also used for returns.

This patch also documents the ABI lowering that a language frontend is 
expected to perform. I would like to work to simplify these requirements over 
time, but this will require further discussion within the LLVM community.

We add PendingArgFlags CCState, as a companion to PendingLocs.

The PendingLocs vector is used by a number of backends to handle arguments 
that are split during legalisation. However CCValAssign doesn't keep track of 
the original argument alignment. Therefore, add a PendingArgFlags vector which 
can be used to keep track of the ISD::ArgFlagsTy for every value added to 
PendingLocs.

Differential Revision: https://reviews.llvm.org/D39898



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320359 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 12:49:02 +00:00
Alex Bradbury d001eea165 [RISCV] Allow lowering of dynamic_stackalloc, stacksave, stackrestore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320358 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 12:38:17 +00:00
Alex Bradbury dcfcbe7bdc [RISCV] Implement prolog and epilog insertion
As frame pointer elimination isn't implemented until a later patch and we make 
extensive use of update_llc_test_checks.py, this changes touches a lot of the 
RISC-V tests.

Differential Revision: https://reviews.llvm.org/D39849


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 12:34:11 +00:00
Simon Pilgrim 1b5e053f7e [X86] Regenerate fsgsbase intrinsic tests. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320356 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 12:22:15 +00:00
Roger Ferrer Ibanez f815701fe1 [ARM] Use ADDCARRY / SUBCARRY
This is a preparatory step for D34515.

This change:
 - makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
 - lowering is done by first converting the boolean value into the carry flag
   using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
   using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
   operations does the actual addition.
 - for subtraction, given that ISD::SUBCARRY second result is actually a
   borrow, we need to invert the value of the second operand and result before
   and after using ARMISD::SUBE. We need to invert the carry result of
   ARMISD::SUBE to preserve the semantics.
 - given that the generic combiner may lower ISD::ADDCARRY and
   ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
   as well otherwise i64 operations now would require branches. This implies
   updating the corresponding test for unsigned.
 - add new combiner to remove the redundant conversions from/to carry flags
   to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
 - fixes PR34045
 - fixes PR34564
 - fixes PR35103

Differential Revision: https://reviews.llvm.org/D35192



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320355 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 12:13:45 +00:00
Alex Bradbury 1e4e4646ad [RISCV] Support lowering FrameIndex
Introduces the AddrFI "addressing mode", which is necessary simply because 
it's not possible to write a pattern that directly matches a frameindex.

Ensure callee-saved registers are accessed relative to the stackpointer. This
is necessary as callee-saved register spills are performed before the frame
pointer is set.

Move HexagonDAGToDAGISel::isOrEquivalentToAdd to SelectionDAGISel, so we can 
make use of it in the RISC-V backend.

Differential Revision: https://reviews.llvm.org/D39848


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320353 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 11:53:54 +00:00
Diana Picus 5e9125c6c7 [ARM GlobalISel] Add tests for PKHBT and PKHTB
Test (some of) the patterns for selecting PKHBT and PKHTB. The others
are just very similar to the ones we're testing and there would be
little value in covering them as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320352 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 11:44:23 +00:00
Aleksandar Beserminji 9d32402369 [mips] Removal of microMIPS64R6
All files and parts of files related to microMIPS4R6 are removed.
When target is microMIPS4R6, errors are printed.

This is LLVM part of patch.

Differential Revision: https://reviews.llvm.org/D35625



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320350 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 11:21:40 +00:00
Craig Topper ff09090aac [DAGCombiner] Support folding (mulhs/u X, 0)->0 for vectors.
We should probably also fold (mulhs/u X, 1) for vectors, but that's harder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320344 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 08:33:20 +00:00
Craig Topper f4e6ea2ff0 [X86] Regenerate test with update_llc_test_checks.py
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320342 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 06:16:26 +00:00
Craig Topper 2f772f1283 [X86] Add a test case for masked scatter where the index needs to be legalized from v2i32 while other types are legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320340 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 01:48:10 +00:00
Simon Pilgrim 4c7cc92ee5 [X86] Add ROL/ROR schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320334 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 22:11:56 +00:00
Simon Pilgrim c9e47b5ea1 [X86] Add DIV/MUL/NEG/NOP/NOT/PAUSE schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320333 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 21:56:24 +00:00
Simon Pilgrim 526fb7cef7 [X86] Add DEC/INC schedule tests
Include i686 (non-REX) variant tests as well

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320332 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 21:28:00 +00:00
Simon Pilgrim 100df14e1e [X86] Add INS/OUTS schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320331 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 21:10:28 +00:00
Simon Pilgrim d2cf8e243e [X86] Add CMPS/MOVS/SCAS/STOS schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320330 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 20:58:22 +00:00
Simon Pilgrim 83b413acfd [X86] Add CMOV schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320329 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 20:46:57 +00:00
Simon Pilgrim 3bbb614b3a [X86] Add BT/BTC/BTR/BTS schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 20:22:47 +00:00
Craig Topper 03558038ae [X86] Rename some instructions that start with Int_ to have the _Int at the end.
This matches AVX512 version and is more consistent overall. And improves our scheduler models.

In some cases this adds _Int to instructions that didn't have any Int_ before. It's a side effect of the adjustments made to some of the multiclasses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 19:47:56 +00:00
Simon Pilgrim b6c07b3f94 [X86][X87] Fix typo in znver1 FIST/FISTT schedule patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320322 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 19:19:22 +00:00
Simon Pilgrim 9b036516f6 [X86][X87] Add missing x87 scheduler tests
Split off some 'n' instruction versions to make it clearer when WAIT is being inserted

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 18:53:15 +00:00