Commit Graph

23466 Commits

Author SHA1 Message Date
Krzysztof Parzyszek a9bb60c600 [Hexagon] Generate HVX code for comparisons and selects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320744 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 21:28:48 +00:00
Craig Topper f74c3ebbfb [X86] Don't zero the upper bits of the k-register before extracting a single bit from a vXi1.
This doesn't match the semantics of the extract_vector_elt operation. Nothing downstream knows the bits were zeroed so they still get masked or sign extended after the extrat anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320723 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 18:35:25 +00:00
Geoff Berry c04e9d0dbf [ARM] Fix isRenamable flag setting on expanded VSTMDIA opcode.
Fixes expensive-check ARM buildbot failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320718 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 18:06:25 +00:00
Simon Dardis e8153722a3 [mips] Update some tests before posting a patch, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320715 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 16:42:04 +00:00
Yaxun Liu 92d81a8d46 Revert CodeGen: Fix assertion in machine inst sheduler due to llvm.dbg.value
This commit might have caused regression on ppc64. Revert it to verify that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 16:12:04 +00:00
Simon Dardis 6ca3095cfb [mips] Add partial support for R6 in the long branch pass
MIPSR6 introduced several new jump instructions and deprecated
the use of the 'j' instruction. For microMIPS32R6, 'j' was removed
entirely and it only has non delay slot jumps.

This patch adds support for MIPSR6 by using some R6 instructions--
'bc' instead of 'j', 'jic $reg, 0' instead of 'jalr $zero, $reg'--
and modifies the sequences not to use delay slots for R6.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: dschuff, arichardson, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320703 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 14:55:25 +00:00
Benjamin Kramer f30ce39f3a Revert "[DAGCombine] Move AND nodes to multiple load leaves"
This reverts commit r320679. Causes miscompiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320698 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 14:03:07 +00:00
Michael Zuckerman 74c2e95576 [AVX512] Adding support for load truncate store of I1
store operation on a truncated memory (load) of vXi1 is poorly supported by LLVM and most of the time end with an assertion.
This patch fixes this issue.

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

Change-Id: Ida5523dd09c1ad384acc0a27e9e59273d28cbdc9

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320691 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 11:55:50 +00:00
Simon Pilgrim 9e819d59ee [X86] Add FMA4 schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320690 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 11:40:54 +00:00
Simon Pilgrim d355ea7abc [X86] Add FMA3 schedule tests
Rewrote to use inline asm for full coverage

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320689 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 11:30:01 +00:00
Francis Visoiu Mistrih 3f63013fb4 [CodeGen] Print global addresses as @foo in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`@foo` instead of `<ga:@foo>`.

Also print target flags in the MIR format since most of them are used on
global address operands.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 10:03:09 +00:00
Francis Visoiu Mistrih d398775f54 [CodeGen] Print external symbols as $symbol in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`$symbol` instead of `<es:symbol>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 10:02:58 +00:00
Sam Parker 290324b309 [DAGCombine] Move AND nodes to multiple load leaves
Recommitting rL319773, which was reverted due to a recursive issue
causing timeouts. This happened because I failed to check whether
the discovered loads could be narrowed further. In the case of a tree
with one or more narrow loads, that could not be further narrowed, as
well as a node that would need masking, an AND could be introduced
which could then be visited and recombined again with the same load.
This could again create the masking load, with would be combined
again... We now check that the load can be narrowed so that this
process stops.

Original commit message:
Search from AND nodes to find whether they can be propagated back to
loads, so that the AND and load can be combined into a narrow load.
We search through OR, XOR and other AND nodes and all bar one of the
leaves are required to be loads or constants. The exception node then
needs to be masked off meaning that the 'and' isn't removed, but the
loads(s) are narrowed still.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320679 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 09:31:01 +00:00
Craig Topper b82cf8d9d4 [X86] Make ANY_EXTEND from vXi1 Custom for more types.
We should be able to support ANY_EXTEND for any types we support ZERO_EXTEND for.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320675 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 08:26:00 +00:00
Craig Topper 10d4fa74b4 [SelectionDAG][X86] Improve legalization of v32i1 CONCAT_VECTORS of v16i1 for AVX512F.
A v32i1 CONCAT_VECTORS of v16i1 uses promotion to v32i8 to legalize the v32i1. This results in a bunch of extract_vector_elts and a build_vector that ultimately gets scalarized.

This patch checks to see if v16i8 is legal and inserts a any_extend to that so that we can concat v16i8 to v32i8 and avoid creating the extracts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320674 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 08:25:58 +00:00
Craig Topper 99c76f24e6 [SelectionDAG] When legalizing the result type of CONCAT_VECTORS, take into account whether the input type also needs to be promoted.
If so go ahead and get the promoted input vector to extract from. Previously, we would create a bunch of any_extends of extract_vector_elts with illegal input type that needs to be promoted. The legalization of those extract_vector_elts would then potentially introduce a truncate. So now we have a bunch of any_extends of truncates. By legalizing both parts together we avoid creating these extra nodes.

The test changes seem to be because we were previously combining the build_vector with the any_extend before the any_extend got combined with the truncate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320669 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 06:49:07 +00:00
Simon Pilgrim 0d2bb64760 [X86] Add missing MULX32 schedule test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320651 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 22:43:55 +00:00
Yaxun Liu 084f87947f CodeGen: Fix assertion in machine inst sheduler due to llvm.dbg.value
Two issues were found about machine inst scheduler when compiling ProRender
with -g for amdgcn target:

GCNScheduleDAGMILive::schedule tries to update LiveIntervals for DBG_VALUE, which it
should not since DBG_VALUE is not mapped in LiveIntervals.

when DBG_VALUE is the last instruction of MBB, ScheduleDAGInstrs::buildSchedGraph and
ScheduleDAGMILive::scheduleMI does not move RPTracker properly, which causes assertion.

This patch fixes that.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320650 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 22:38:09 +00:00
Simon Pilgrim 946486c389 [X86] Add CLWB schedule test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320644 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 22:09:09 +00:00
Simon Pilgrim d5956c26dc [X86] Move ADX schedule tests out of schedule-x86_64.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320637 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 21:49:09 +00:00
Adrian Prantl 267645038a Ignore metainstructions during the shrink wrap analysis
Shrink wrapping should ignore DBG_VALUEs referring to frame indices,
since the presence of debug information must not affect code
generation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 19:10:54 +00:00
Simon Pilgrim 83f6d00755 [X86] Add JCC/JECXZ/JECXZ/JRCXZ/LOOP schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320603 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 18:09:45 +00:00
Amaury Sechet c1f4787343 Regenerate test-shrink.ll test results. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320602 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 18:04:57 +00:00
Simon Pilgrim 6149067b94 [X86] Add RET/RETF schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320600 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 17:50:40 +00:00
Simon Pilgrim d797d31140 [X86] Add POP/PUSH schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320598 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 17:42:25 +00:00
Galina Kistanova e8e0a7cf7b Reverted r320229. It broke tests on builder llvm-clang-x86_64-expensive-checks-win.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320588 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 15:26:27 +00:00
Simon Pilgrim cd1040ad7c [X86] Add PREFETCH schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320587 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 15:12:02 +00:00
Simon Pilgrim 39485b9013 [X86] Add XCHG schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320586 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 15:02:10 +00:00
Simon Pilgrim 531cde9dc8 [X86] Add MOVNTI schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320585 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 14:51:06 +00:00
Nemanja Ivanovic 7b053da09f [PowerPC] MachineSSA pass to reduce the number of CR-logical operations
The initial implementation of an MI SSA pass to reduce cr-logical operations.
Currently, the only operations handled by the pass are binary operations where
both CR-inputs come from the same block and the single use is a conditional
branch (also in the same block).

Committing this off by default to allow for a period of field testing. Will
enable it by default in a follow-up patch soon.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320584 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 14:47:35 +00:00
Simon Pilgrim a9fb896797 [X86] Add ENTER/LEAVE schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320583 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 14:46:33 +00:00
Simon Pilgrim 4a0d45ff9b [X86] Add IMUL schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320582 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 14:24:04 +00:00
Simon Pilgrim 2057bb76d7 [X86] Add RDMSR/WRMSR, RDPMC + RDTSC/RDTSCP schedule tests
Add missing RDTSCP itinerary

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 14:22:04 +00:00
Simon Pilgrim 1cb7e40b26 [X86] Add ARPL/BOUND schedule tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 13:54:45 +00:00
Simon Pilgrim 6dc08a0926 [X86][SSE] MOVMSK only uses the sign bit from each vector element
Pass the input vector through SimplifyDemandedBits as we only need the sign bit from each vector element of MOVMSK

We'd probably get more hits if SimplifyDemandedBits was better at handling vectors...

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320570 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 11:43:14 +00:00
Roger Ferrer Ibanez bc4037e1bb [DAG] Promote ADDCARRY / SUBCARRY
Add missing case that was not implemented yet.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320567 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:45:21 +00:00
Francis Visoiu Mistrih d347e9783d [CodeGen] Print jump-table index operands as %jump-table.0 in both MIR and debug output
Work towards the unification of MIR and debug output by printing `%jump-table.0` instead of `<jt#0>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320566 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:30:59 +00:00
Francis Visoiu Mistrih c84690975a [CodeGen] Print constant pool index operands as %const.0 + 8 in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`%const.0 + 8` instead of `<cp#0+8>` and `%const.0 - 8` instead of
`<cp#0-8>`.

Only debug syntax is affected.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:30:45 +00:00
Stefan Maksimovic 061f5ff24a [mips] Provide additional DSP bitconvert patterns
Previously, v2i16 -> f32 bitcast could not be matched.
Add patterns to support matching this and similar types of bitcasts.

Differential revision: https://reviews.llvm.org/D40959


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320562 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:13:35 +00:00
Serguei Katkov 407ce54852 Revert "[CGP] Enable select in complex addr mode"
Causes: Assertion `ScaledReg == nullptr' failed.

This actually a revert of rL320551.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 07:39:35 +00:00
Serguei Katkov 596e2d5bc4 [CGP] Enable select in complex addr mode
Enable select instruction handling in complex addr modes.

Reviewers: john.brawn, reames, aaboud
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D40634


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 06:57:59 +00:00
Krzysztof Parzyszek 6c7d4481f9 [Hexagon] Relax some checks in testcases, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320529 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 21:44:04 +00:00
Krzysztof Parzyszek ac78b4324b [Hexagon] Better detection of identity and undef masks in shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320523 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 20:23:12 +00:00
Krzysztof Parzyszek 206ac235d7 [Hexagon] Fix wrong order of operands for vmux
Shuffle generation uses vmux to collapse vectors resulting from two
individual shuffles into one. The indexes of the elements selected
from the first operand were indicated by 0xFF in the constant vector
used in the compare instruction, but the compare (veqb) set the bits
corresponding to the 0x00 elements, thus inverting the selection.

Reverse the order of operands to vmux to get the correct output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 19:32:41 +00:00
Sanjoy Das f51ad9b5b3 Reapply "[X86] Flag BroadWell scheduler model as complete"
This reverts commit r320508, in effect re-applying r320308.  Simon has already
reverted the parts that caused the crash that motivated the revert in r320492.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320512 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 19:11:31 +00:00
Sanjoy Das feb0ef44d7 Revert "[X86] Flag BroadWell scheduler model as complete"
This reverts commit r320308.  r320308 crashes LLC, please see the llvm-commits
thread for a reproducer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320508 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 18:40:58 +00:00
Nirav Dave 28ea9743f6 [X86] Cleanup type conversion of 64-bit load-store pairs.
Summary:
Simplify and generalize chain handling and search for 64-bit load-store pairs.
Nontemporal test now converts 64-bit integer load-store into f64 which it realizes directly instead of splitting into two i32 pairs.

Reviewers: craig.topper, spatel

Reviewed By: craig.topper

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 18:25:48 +00:00
Geoff Berry 3b391fe80e [MachineOperand][MIR] Add isRenamable to MachineOperand.
Summary:
Add isRenamable() predicate to MachineOperand.  This predicate can be
used by machine passes after register allocation to determine whether it
is safe to rename a given register operand.  Register operands that
aren't marked as renamable may be required to be assigned their current
register to satisfy constraints that are not captured by the machine
IR (e.g. ABI or ISA constraints).

Reviewers: qcolombet, MatzeB, hfinkel

Subscribers: nemanjai, mcrosier, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320503 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 17:53:59 +00:00
Simon Pilgrim 258219304a [X86] Remove CompleteModel tags from CPU targets until we have better error checking (PR35636)
The checks we have for complete models are not great and miss many cases - e.g. in PR35636 it failed to recognise that only the first output (of 2) was actually tagged by the InstRW

Raised PR35639 and PR35643 as examples

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320492 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 16:12:53 +00:00
Ayman Musa 2139df9b5d [X86] Recognize constant arrays with special values and replace loads from it with subtract and shift instructions, which then will be replaced by X86 BZHI machine instruction.
Recognize constant arrays with the following values:
  0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, .... , 2^(size - 1) -1
where //size// is the size of the array.

the result of a load with index //idx// from this array is equivalent to the result of the following:
  (0xFFFFFFFF >> (sub 32, idx))             (assuming the array of type 32-bit integer).

And the result of an 'AND' operation on the returned value of such a load and another input, is exactly equivalent to the X86 BZHI instruction behavior.

See test cases in the LIT test for better understanding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320481 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 14:13:51 +00:00