Commit Graph

28734 Commits

Author SHA1 Message Date
Roman Lebedev
0c2484c2df [X86][NFC] Autogenerate check lines in cmovcmov.ll test
Investigating 8-bit cmov promotion, this test comes up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355496 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 11:47:43 +00:00
Simon Pilgrim
917bdb560e [DAGCombiner] Enable SMULO/UMULO vector combine support (PR40442)
Differential Revision: https://reviews.llvm.org/D58968

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355495 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 11:04:21 +00:00
Simon Pilgrim
01dbaf4f8c [X86][SSE] VSELECT(XOR(Cond,-1), LHS, RHS) --> VSELECT(Cond, RHS, LHS)
As noticed on D58965

DAGCombiner::visitSELECT has something similar, so we should be able to move this to DAGCombiner and support VSELECT as well at some point.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355494 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 10:54:43 +00:00
Ayonam Ray
62fa6d90b1 [CodeGen] Omit range checks from jump tables when lowering switches with unreachable default
During the lowering of a switch that would result in the generation of a
jump table, a range check is performed before indexing into the jump
table, for the switch value being outside the jump table range and a
conditional branch is inserted to jump to the default block. In case the
default block is unreachable, this conditional jump can be omitted. This
patch implements omitting this conditional branch for unreachable
defaults.

Differential Revision: https://reviews.llvm.org/D52002
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355490 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 10:01:02 +00:00
Ayonam Ray
46b09a3368 Reversing the commit of revision 355483 since it is giving a regression on a newly added test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355487 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 07:51:28 +00:00
Craig Topper
f8ea8c96b8 [X86] Enable the add with 128 -> sub with -128 encoding trick with X86ISD::ADD when the carry flag isn't used.
This allows us to use an 8-bit sign extended immediate instead of a 16 or 32 bit immediate.

Also do similar for 0x80000000 with 64-bit adds to avoid having to use a movabsq.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355485 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 07:36:38 +00:00
Craig Topper
c8a70731d1 [X86] Suppress load folding for add/sub with 128 immediate.
128 won't fit in a sign extended 8-bit immediate, but we can negate it to -128 and use the other operation. This results in a shorter encoding since the move would have used 16 or 32 bits for the immediate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355484 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 07:36:36 +00:00
Ayonam Ray
b71ba91724 [CodeGen] Omit range checks from jump tables when lowering switches with unreachable default
During the lowering of a switch that would result in the generation of a
jump table, a range check is performed before indexing into the jump
table, for the switch value being outside the jump table range and a
conditional branch is inserted to jump to the default block. In case the
default block is unreachable, this conditional jump can be omitted. This
patch implements omitting this conditional branch for unreachable
defaults.

Differential Revision: https://reviews.llvm.org/D52002
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355483 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 07:27:45 +00:00
Roman Lebedev
c0f01ed825 [X86][NFC] Add proper test for promotion of i8 cmov's of trunc's
There was no proper test for that code in X86TargetLowering::LowerSELECT().
Noticed accidentally while trying to modify the last branch in that function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355452 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 22:43:53 +00:00
Heejin Ahn
5b3a6d5e25 [WebAssembly] Disable MachineBlockPlacement pass
Summary:
This pass hurts code size for wasm and sometimes generates irreducible
control flow.
Context: https://github.com/emscripten-core/emscripten/pull/8233

Reviewers: kripken, dschuff

Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355437 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 20:35:34 +00:00
Roman Lebedev
5fe8b23a58 [NFC][CodeGen][X86][AArch64] Add tests for C++ std::midpoint() pattern (PR40965)
Tests only for integers, not floating point or pointers.

The scalar 8-bit case uses branch instead of CMOV,
because there is no no 8-bit CMOV.

Vector tests are for consistency, since it can be vectorized.

https://bugs.llvm.org/show_bug.cgi?id=40965

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355436 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 20:18:47 +00:00
Matt Arsenault
2d90299c79 AMDGPU: Preserve undef flag when expanding SI_IF
Fixes undefined value verifier error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355426 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 18:38:00 +00:00
Craig Topper
db8da4672b [X86] Enable 8-bit SHL to convert to LEA
Differential Revision: https://reviews.llvm.org/D58870

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355425 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 18:37:41 +00:00
Craig Topper
ebaba96d61 [X86] Allow 8-bit INC/DEC to be converted to LEA.
We already do this for 16/32/64 as well as 8-bit add with register/immediate. Might as well do it for 8-bit INC/DEC too.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355424 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 18:37:37 +00:00
Craig Topper
b3da570dea [X86] Enable 8-bit OR with disjoint bits to convert to LEA
We already support 8-bits adds in convertToThreeAddress. But we can also support 8-bit OR if the bits are disjoint. We already do this for 16/32/64.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355423 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 18:37:33 +00:00
Simon Pilgrim
e46d0f6df4 [X86][SSE] Regenerate vector zero tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355412 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 16:52:14 +00:00
Jessica Paquette
3cd66813b0 Revert "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"
This broke test-suite::aarch64_neon_intrinsics.test

Reverting while I look into it.

Example failure:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/17740

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355408 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 15:47:00 +00:00
Simon Pilgrim
7bb5d42fe3 [X86] Add SMULO/UMULO combine tests
Include scalar and vector test variants covering the folds in DAGCombiner (vector isn't currently supported - PR40442)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355407 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 15:36:45 +00:00
Simon Pilgrim
b2b3e65c2d Fix typo in constant vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355405 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 15:06:01 +00:00
Simon Pilgrim
349f5f864a [X86] Add SADDO/UADDO and SSUBO/USUBO combine tests
Include scalar and vector test variants covering the folds in DAGCombiner (vector isn't currently supported - PR40442)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355404 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 14:52:42 +00:00
Simon Pilgrim
a38100a64a [X86] Add test cases for D58874
Add scalar and vector test cases for missing (add (add (xor a, -1), b), 1) -> (sub b, a) fold

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355400 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 13:52:09 +00:00
Carl Ritson
dfa4156319 [AMDGPU] Fix DPP operand order in atomic optimizer
Summary:
Ensure order of operands in DPP atomic optimizer final WWM step is appropriate for sub instructions.

Change-Id: I631d050e1c00a3b4bc7c11a90437064403c4cf30

Reviewers: sheredom, tpr

Reviewed By: sheredom

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, jfb, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355394 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 12:21:44 +00:00
Oliver Stannard
3a22eb400f [ARM] Fix select_cc lowering for fp16
When lowering a select_cc node where the true and false values are of type f16,
we can't use a general conditional move because the FP16 instructions do not
support conditional execution. Instead, we must ensure that the condition code
is one of the four supported by the VSEL instruction.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355385 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 10:42:34 +00:00
David Stuttard
624049efdc [AMDGPU] Omit KILL instructions from hazard recognizer
Summary:
In some cases the KILL was causing a hazard to be introduced as these were
scheduled into hazard slots, but don't result in an instruction.

KILL shouldn't be considered for hazard recognition.

Change-Id: Ib6d2a2160f8c94cd0ce611ab198c7e4f46aeffcf

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355384 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 10:25:16 +00:00
Chen Zheng
df3d6b9db8 [PowerPC] fix killed/dead flag after convert x-form to d-form tranformation.
Differential Revision: https://reviews.llvm.org/D58428


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355378 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 04:56:54 +00:00
Yonghong Song
20d279e5b1 [BPF] Do not generate BTF sections unnecessarily
If There is no types/non-empty strings, do not generate
.BTF section. If there is no func_info/line_info, do
not generate .BTF.ext section.

Signed-off-by: Yonghong Song <yhs@fb.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355360 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 01:01:21 +00:00
Florian Hahn
9c41c0b504 Fix invalid target triples in tests. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355349 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 23:37:41 +00:00
Jessica Paquette
01d87547d6 [GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT
This adds instruction selection support for G_EXTRACT_VECTOR_ELT for cases
where the index is defined by a G_CONSTANT.

It also factos out the lane copy opcode selection part into its own function,
`getLaneCopyOpcode`. This is used by both `selectUnmergeValues` and
`selectExtractElt`.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355344 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 22:35:32 +00:00
Jessica Paquette
f3d5cf2f71 [GlobalISel][AArch64] Legalize vector G_SELECT
Just scalarize it, and add a test showing it works.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355339 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 21:12:46 +00:00
Amara Emerson
efbf288c6f Re-commit r355104: "[AArch64][GlobalISel] Add support for 64 bit vector shuffle using TBL1."
The code to materialize a mask from a constant pool load tried to use a 128 bit
LDR to load a 64 bit constant pool entry, which was 8 byte aligned. This resulted
in a link failure in the NEON tests in the test suite since the LDR address was
unaligned. This change fixes that to instead emit a 64 bit LDR if the entry is
64 bit, before converting back to a 128 bit register for the TBL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355326 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 19:16:00 +00:00
Craig Topper
b6ab93e6a5 [DAGCombiner][X86][SystemZ][AArch64] Combine some cases of (bitcast (build_vector constants)) between legalize types and legalize dag.
This patch enables combining integer bitcasts of integer build vectors when the new scalar type is legal. I've avoided floating point because the implementation bitcasts float to int along the way and we would need to check the intermediate types for legality

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355324 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 19:12:16 +00:00
Simon Pilgrim
e11ae4fd35 [X86] Regenerate illegal type load test with non-undef load address.
This would be affected by an upcoming patch without undoing some of the bugpoint reduction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355316 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 14:49:02 +00:00
Jeremy Morse
273b7e422a [X86] Avoid codegen changes when DBG_VALUE appears between lowered selects
X86TargetLowering::EmitLoweredSelect presently detects sequences of CMOV pseudo
instructions without accounting for debug intrinsics. This leads to different
codegen with and without option -g, if a DBG_VALUE instruction lands in the
middle of several lowered selects.

Work around this by skipping over debug instructions when looking for CMOV
sequences, and sinking those debug insts into the EmitLoweredSelect sunk block.
This might slightly shift where variables appear in the instruction sequence,
but won't re-order assignments.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355307 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 10:56:02 +00:00
Oliver Stannard
b649874e8d [ARM] Fix selection of VLDR.16 instruction with imm offset
The isScaledConstantInRange function takes upper and lower bounds which are
checked after dividing by the scale, so the bounds checks for half, single and
double precision should all be the same. Previously, we had wrong bounds checks
for half precision, so selected an immediate the instructions can't actually
represent.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355305 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 09:17:38 +00:00
Heejin Ahn
ba7414dc84 [WebAssembly] Delete ThrowUnwindDest map from WasmEHFuncInfo
Summary:
Before when we implemented the first EH proposal, 'catch <tag>'
instruction may not catch an exception so there were multiple EH pads an
exception can unwind to. That means a BB could have multiple EH pad
successors.

Now after we switched to the new proposal, every 'catch' instruction
catches an exception, and there is only one catchpad per catchswitch, so
we at most have one EH pad successor, making `ThrowUnwindDest` map in
`WasmEHInfo` unnecessary.

Keeping `ThrowUnwindDest` map in `WasmEHInfo` has its own problems,
because other optimization passes can split a BB that contains possibly
throwing calls (previously invokes), and we have to update the map every
time that happens, which is not easy for common CodeGen passes.

This also correctly updates successor info in LateEHPrepare when we add
a rethrow instruction.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355296 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-03 22:35:56 +00:00
Craig Topper
58dbe6ba52 [X86] Regenerate test to get the full FP operands printed. NFC
Missed when I updated the printer to print implicit %st operand on binops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355295 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-03 20:28:52 +00:00
Simon Pilgrim
1ab32adbf4 [X86] getShuffleScalarElt - peek through insert/extract subvector nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355288 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-03 14:11:05 +00:00
Craig Topper
512e218137 [X86] Prefer VPBLENDD for v2i64/v4i64 blends with AVX2.
We were using VPBLENDW for v2i64 and VBLENDPD for v4i64. VPBLENDD has better throughput than VPBLENDW on some CPUs so it makes sense to use it when possible. VBLENDPD will probably become VBLENDD during execution domain fixing, but we might as well use integer in isel while we can.

This should work around some issues with the domain fixing pass prefering PBLENDW when we start with PBLENDW. There may still be some v8i16 cases that could use PBLENDD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355281 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-03 00:18:07 +00:00
Amaury Sechet
9547351415 Add test case for add to sub transformation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355269 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-02 14:28:59 +00:00
Xing GUO
b6c0a18fa7 [Codegen] fix typos in test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355264 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-02 08:03:59 +00:00
Thomas Lively
341140cf85 [WebAssembly] Expand operations not supported by SIMD
Summary:
This prevents crashes in instruction selection when these operations
are used. The tests check that the scalar version of the instruction
is used where applicable, although some expansions do not use the
scalar version.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355261 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-02 03:32:25 +00:00
Amaury Sechet
04a0f33211 [X86] Improve use of SHLD/SHRD
Summary:
This extends the variety of pattern that can generate a SHLD instead of using two shifts.

This fixes a regression that would be introduced by D57367 or D33587

Reviewers: RKSimon, craig.topper

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355260 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-02 02:44:16 +00:00
Amaury Sechet
76b7cba4c0 Add test case for truncate funnel shifts. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355258 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-02 02:24:36 +00:00
Vlad Tsyrklevich
31ec6de6ca Revert "[MIPS GlobalISel] Fix mul operands"
This reverts commit r355178, it is causing ASan failures on the
sanitizer bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355219 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 18:58:22 +00:00
Oliver Stannard
ed849dca81 [ARM] Fix FP16 stack loads/stores for Thumb2 with frame pointer
The new addressing mode added for the v8.2A FP16 instructions uses bit 8 of the
immediate to encode the sign of the offset, like the other FP loads/stores, so
need to be treated the same way.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355201 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 14:20:28 +00:00
Oliver Stannard
c064077099 [ARM] Consider undefined-on-NaN conditions in checkVSELConstraints
This function was not checking for the condition code variants which are
undefined if either input is NaN, so we were missing selection of the VSEL
instruction in some cases when using -fno-honor-nans or -ffast-math.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355199 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 13:58:25 +00:00
Simon Pilgrim
46036c4d66 [X86] Regenerate legalize test files
Noticed while getting update_mir_test_checks.py to work on python3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355198 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 13:13:40 +00:00
Simon Pilgrim
30fbca3fc5 [Thumb] Add some integer abs testcases for different typesizes.
Committed on behalf of @ikulagin (Ivan Kulagin)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355197 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 12:08:50 +00:00
Diana Picus
de23a6b25f [ARM GlobalISel] Support G_CTLZ for Thumb2
Same as ARM mode but with different opcode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355191 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 10:12:28 +00:00
Diana Picus
6535445674 [ARM GlobalISel] Check target flags in test. NFCI
There was a time when we couldn't dump target-specific flags such as
arm-sbrel etc, so the tests didn't check for them. We can now be more
specific in our tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355189 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 10:01:22 +00:00