65934 Commits

Author SHA1 Message Date
Martin Storsjo 551211dc56 [Demangle] Add a few more options to the microsoft demangler
This corresponds to commonly used options to UnDecorateSymbolName
within llvm.

Add them as hidden options in llvm-undname. MS undname.exe takes
numeric flags, corresponding to the UNDNAME_* constants, but instead
of hardcoding in mappings for those numbers, just add textual
options instead, as it the use of them here is primarily intended
for testing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374865 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-15 08:29:56 +00:00
David L. Jones 75cbca09a4 Revert [SROA] Reuse existing lifetime markers if possible
This reverts r374692 (git commit 92694eba933ef4ea0b1b6377809ff266df37d61b)

Reproducer sent to commit thread on llvm-commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374859 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-15 04:32:07 +00:00
Shiva Chen eee3ea147a [RISCV] Support fast calling convention
LLVM may annotate the function with fastcc if there has only one caller
and there're no other caller out of the module and the function is not
naked or contain variable arguments.

The fastcc functions could pass the arguments by the caller saved registers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374857 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-15 02:04:29 +00:00
Thomas Lively 60c24975c0 [WebAssembly] Trapping fptoint builtins and intrinsics
Summary:
The WebAssembly backend lowers fptoint instructions to a code sequence
that checks for overflow to avoid traps because fptoint is supposed to
be speculatable. These new builtins and intrinsics give users a way to
depend on the trapping semantics of the underlying instructions and
avoid the extra code generated normally.

Patch by coffee and tlively.

Reviewers: aheejin

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

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374856 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-15 01:11:51 +00:00
Sanjay Patel 820385076f Revert [InstCombine] fold a shifted bool zext to a select
This reverts r374828 (git commit 1f40f15d54aac06421448b6de131231d2d78bc75) due to bot breakage

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374851 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 23:55:39 +00:00
Alina Sbirlea caaecec384 [MemorySSA] Update for partial unswitch.
Update MSSA for blocks cloned when doing partial unswitching.
Enable additional testing with MSSA.
Resolves PR43641.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374850 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 23:52:39 +00:00
Craig Topper c7464a4ca2 [X86] Teach X86MCodeEmitter to properly encode zmm16-zmm31 as index register to vgatherpf/vscatterpf.
We need to encode bit 4 into the EVEX.V' bit. We do this right
for regular gather/scatter which use either MRMSrcMem or MRMDestMem
formats.  The prefetches use MRM*m formats.

Fixes an issue recently added to PR36202.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374849 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 23:48:24 +00:00
Craig Topper d74926b4d5 [X86] Add encoding tests for avx512pf vgatherpf/vscatterpf instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374848 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 23:48:12 +00:00
Jorge Gorbe Moya 9a694d933a Revert "Dead Virtual Function Elimination"
This reverts commit 9f6a873268e1ad9855873d9d8007086c0d01cf4f.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374844 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 23:25:25 +00:00
Philip Reames dc1d7acad3 [Tests] Add a SCEV analysis test for llvm.widenable.condition
Mostly because we don't appear to have one and a prototype patch I just saw would have broken the example committed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374835 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 22:42:35 +00:00
Jian Cai d6278197e0 [ARM][AsmParser] handles offset expression in parentheses
Summary:
Integrated assembler does not accept offset expressions surrounded by
parenthesis. Handle this case for GAS compability.
https://bugs.llvm.org/show_bug.cgi?id=43631

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374832 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 22:22:26 +00:00
Roman Tereshin 21a0296b2d [update_mir_test_checks] Handle MI flags properly
previously we would generate literal check lines w/ no reg-exps for
vregs as MI flags (nsw, ninf, etc.) won't be recognized as a part of MI.

Fixing that. Includes updating the MIR tests that suffered from the
problem.

Reviewed By: bogner

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374829 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 22:01:58 +00:00
Sanjay Patel 17f93c96ec [InstCombine] fold a shifted bool zext to a select
For a constant shift amount, add the following fold.
shl (zext (i1 X)), ShAmt --> select (X, 1 << ShAmt, 0)

https://rise4fun.com/Alive/IZ9

Fixes PR42257.

Based on original patch by @zvi (Zvi Rackover)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374828 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 21:56:40 +00:00
Sanjay Patel f4932ab6c4 [InstCombine] add tests for select/shift transforms; NFC
A transform proposal for the shift form is in D63382.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374818 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 20:28:03 +00:00
Philip Reames a8b14d4c58 [Tests] Add a test demonstrating a miscompile in the off-by-default loop-pred transform
Credit goes to Evgeny Brevnov for figuring out the problematic case.

Fuzzing probably also found it (lots of failures), but due to some silly infrastructure problems I hadn't gotten to the results before Evgeny hand reduced it from a benchmark.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374812 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 19:49:40 +00:00
Roman Lebedev da8e68c8aa [LoopIdiom] BCmp: loop exit count must not be wider than size_t that bcmp takes
As reported by Joerg Sonnenberger in IRC, for 32-bit systems,
where pointer and size_t are 32-bit, if you use 64-bit-wide variable
in the loop, you could end up with loop exit count being of the type
wider than the size_t. Now, i'm not sure if we can produce `bcmp`
from that (just truncate?), but we certainly should not assert/miscompile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374811 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 19:46:34 +00:00
Philip Reames f7875e639f [Tests] Add a few more tests for idioms with FP induction variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374807 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 19:10:39 +00:00
Teresa Johnson 2148b4c347 [ThinLTO] Fix printing of NoInline function summary flag
Summary:
The guard for printing function flags in the summary was not checking
the NoInline flag.

Reviewers: wmi

Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374802 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 18:37:31 +00:00
Matt Arsenault 82e1f2fe8c AMDGPU: Remove unnecessary IR from test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374800 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 18:30:29 +00:00
Jordan Rupprecht ba169d8e73 [llvm-objdump] Adjust spacing and field width for --section-headers
Summary:
- Expand the "Name" column past 13 characters when any of the section names are longer. Current behavior is a staggard output instead of a nice table if a single name is longer.
- Only print the required number of hex chars for addresses (i.e. 8 characters for 32-bit, 16 characters for 64-bit)
- Fix trailing spaces

Reviewers: grimar, jhenderson, espindola

Reviewed By: grimar

Subscribers: emaste, sbc100, arichardson, aheejin, seiya, llvm-commits, MaskRay

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374795 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 17:47:17 +00:00
Michael Berg 4fc0adb6ee Add FMF to vector ops for phi
Summary: Small amendment to handle vector cases for D67564.

Reviewers: spatel, eli.friedman, hfinkel, cameron.mcinally, arsenm, jmolloy, bogner

Reviewed By: cameron.mcinally, bogner

Subscribers: llvm-commits, efriedma, reames, bogner, wdng

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374794 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 17:39:32 +00:00
Jordan Rupprecht 67d83413d0 Reapply: [llvm-size] Tidy up error messages (PR42970)
Clean up some formatting inconsistencies in the error messages and correctly exit with non-zero in all error cases.

Originally submitted as r374771 and then reverted as r374780, this patch fixes the libObject test case in Object/macho-invalid.test.

Patch by Alex Cameron

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374793 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 17:29:15 +00:00
Vedant Kumar 90e20e8610 [llvm-profdata] Weaken "malformed-ptr-to-counter-array.test" to appease arm bots
There are a number arm bots failing after r374617 landed, and I'm not
sure why. It looks a bit like the error message llvm-profdata is
expected to print to stderr isn't flushed.

Weaken the test in an attempt to appease the arm bots: if this doesn't
work, that means that llvm-profdata is actually *not failing*, and that
will be a clear indication that some logic error is actually happening.

http://lab.llvm.org:8011/builders/clang-cmake-armv7-global-isel/builds/5604/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374792 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 17:20:22 +00:00
Artem Belevich d18370c782 [NVPTX] Restructure shfl instrinsics and add variants that return a predicate.
Also, amend constraints for non-sync variants that are no longer
available on sm_70+ with PTX6.4+.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374790 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 16:53:34 +00:00
Simon Pilgrim 7cb9be5d19 [CostModel][X86] Add CTLZ scalar costs
Add specific scalar costs for CTLZ instructions, we can't discriminate between CTLZ and CTLZ_ZERO_UNDEF so we have to assume the worst. Given how BSR is often a microcoded nightmare on some older targets we might still be underestimating it.

For targets supporting LZCNT (Intel Haswell+ or AMD Fam10+), we provide overrides that assume 1cy costs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374786 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 16:30:17 +00:00
Joerg Sonnenberger 732f95ff9a Reapply r374743 with a fix for the ocaml binding
Add a pass to lower is.constant and objectsize intrinsics

This pass lowers is.constant and objectsize intrinsics not simplified by
earlier constant folding, i.e. if the object given is not constant or if
not using the optimized pass chain. The result is recursively simplified
and constant conditionals are pruned, so that dead blocks are removed
even for -O0. This allows inline asm blocks with operand constraints to
work all the time.

The new pass replaces the existing lowering in the codegen-prepare pass
and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert
on the intrinsics.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374784 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 16:15:14 +00:00
Sanjay Patel bd673156a7 [x86] adjust select to sra tests; NFC
Avoid demanded-bits-based specializations (that may not be ideal,
but that's another problem).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374783 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 15:53:55 +00:00
Cameron McInally 00c70bcbce [IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator
Reapply r374240 with fix for Ocaml test, namely Bindings/OCaml/core.ml.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374782 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 15:35:01 +00:00
David Green f36eb5e87c [ARM] Selection for MVE VMOVN
The adds both VMOVNt and VMOVNb instruction selection from the appropriate
shuffles. We detect shuffle masks of the form:
0, N, 2, N+2, 4, N+4, ...
or
0, N+1, 2, N+3, 4, N+5, ...
ISel will also try the opposite patterns, with inputs reversed. These are
selected to VMOVNt and VMOVNb respectively.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374781 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 15:19:33 +00:00
Nico Weber 852f45a10a Revert r374771 "[llvm-size] Tidy up error messages (PR42970)"
This reverts commit 83e52f5e1150018329b8907bb014c77ac382d611.

Makes Object/macho-invalid.test fail everywhere, e.g. here:
http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/23669/steps/test-llvm/logs/FAIL%3A%20LLVM%3A%3Amacho-invalid.test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374780 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 14:44:26 +00:00
Sanjay Patel a8bfb47f37 [x86] add tests for possible select to sra transforms; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374779 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 14:43:06 +00:00
David Green ec89325da0 [ARM] Add some VMOVN tests. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374777 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 14:29:26 +00:00
Simon Pilgrim 13da61c8c4 [CostModel][X86] Add CTPOP scalar costs (PR43656)
Add specific scalar costs for ctpop instructions, these are based on the llvm-mca's SLM throughput numbers (the oldest model we have).

For targets supporting POPCNT, we provide overrides that assume 1cy costs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374775 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 14:07:43 +00:00
Sander de Smalen d9a1cad588 [AArch64] Stackframe accesses to SVE objects.
Materialize accesses to SVE frame objects from SP or FP, whichever is
available and beneficial.

This patch still assumes the objects are pre-allocated. The automatic
layout of SVE objects within the stackframe will be added in a separate
patch.

Reviewers: greened, cameron.mcinally, efriedma, rengolin, thegameg, rovka

Reviewed By: cameron.mcinally

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374772 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 13:11:34 +00:00
Fangrui Song d24146fb6c [llvm-size] Tidy up error messages (PR42970)
Clean up some formatting inconsistencies in the error messages and correctly exit with non-zero in all error cases.

Differential Revision: https://reviews.llvm.org/D68906
Patch by Alex Cameron

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374771 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 12:51:47 +00:00
David Stenberg 3ae7172022 [DebugInfo] Fix truncation of call site immediates
Summary:
This addresses a bug in collectCallSiteParameters() where call site
immediates would be truncated from int64_t to unsigned.

This fixes PR43525.

Reviewers: djtodoro, NikolaPrica, aprantl, vsk

Reviewed By: aprantl

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374770 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 12:49:58 +00:00
Dmitri Gribenko e0cea29324 Revert "Add a pass to lower is.constant and objectsize intrinsics"
This reverts commit r374743. It broke the build with Ocaml enabled:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19218

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374768 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 12:22:48 +00:00
Alexander Timofeev 775d402bf1 [AMDGPU] Come back patch for the 'Assign register class for cross block values according to the divergence.'
Detailed description:

    After https://reviews.llvm.org/D59990 submit several issues were discovered.
    Changes in common code were preserved but AMDGPU specific part was reverted to keep the backend working correctly.

    Discovered issues were addressed in the following commits:

    https://reviews.llvm.org/D67662
    https://reviews.llvm.org/D67101
    https://reviews.llvm.org/D63953
    https://reviews.llvm.org/D63731

    This change brings back AMDGPU specific changes.

  Reviewed by: rampitec, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374767 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 12:01:10 +00:00
Andrea Di Biagio 30954cb6a9 [X86][BtVer2] Improved latency and throughput of float/vector loads and stores.
This patch introduces the following changes to the btver2 scheduling model:

- The number of micro opcodes for YMM loads and stores is now 2 (it was
  incorrectly set to 1 for both aligned and misaligned loads/stores).

- Increased the number of AGU resource cycles for YMM loads and stores
  to 2cy (instead of 1cy).

- Removed JFPU01 and JFPX from the list of resources consumed by pure
  float/vector loads (no MMX).

I verified with llvm-exegesis that pure XMM/YMM loads are no-pipe. Those
are dispatched to the FPU but not really issues on JFPU01.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374765 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 11:12:18 +00:00
Craig Topper eca2f6ad30 [X86] Teach EmitTest to handle ISD::SSUBO/USUBO in order to use the Z flag from the subtract directly during isel.
This prevents isel from emitting a TEST instruction that
optimizeCompareInstr will need to remove later.

In some of the modified tests, the SUB gets duplicated due to
the flags being needed in two places and being clobbered in
between. optimizeCompareInstr was able to optimize away the TEST
that was using the result of one of them, but optimizeCompareInstr
doesn't know to turn SUB into CMP after removing the TEST. It
only knows how to turn SUB into CMP if the result was already
dead.

With this change the TEST never exists, so optimizeCompareInstr
doesn't have to remove it. Then it can just turn the SUB into
CMP immediately.

Fixes PR43649.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374755 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 06:47:56 +00:00
Craig Topper 7cfac68776 [X86] Autogenerate complete checks. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374748 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 01:41:04 +00:00
Joerg Sonnenberger 314e3cde15 Add a pass to lower is.constant and objectsize intrinsics
This pass lowers is.constant and objectsize intrinsics not simplified by
earlier constant folding, i.e. if the object given is not constant or if
not using the optimized pass chain. The result is recursively simplified
and constant conditionals are pruned, so that dead blocks are removed
even for -O0. This allows inline asm blocks with operand constraints to
work all the time.

The new pass replaces the existing lowering in the codegen-prepare pass
and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert
on the intrinsics.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374743 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 23:00:15 +00:00
Johannes Doerfert b5c6f41f8c [Attributor] Shortcut no-return through will-return
No-return and will-return are exclusive, assuming the latter is more
prominent we can avoid updates of the former unless will-return is not
known for sure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374739 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 21:25:53 +00:00
Johannes Doerfert 6f5d69720f [Attributor][FIX] NullPointerIsDefined needs the pointer AS (AANonNull)
Also includes a shortcut via AADereferenceable if possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374737 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 20:48:26 +00:00
Johannes Doerfert d552441802 [Attributor][MemBehavior] Fallback to the function state for arguments
Even if an argument is captured, we cannot have an effect the function
does not have. This is fine except for the special case of `inalloca` as
it does not behave by the rules.

TODO: Maybe the special rule for `inalloca` is wrong after all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374736 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 20:47:16 +00:00
Johannes Doerfert 3b5635a0b3 [Attributor][FIX] Use check prefix that is actually tested
Summary:
This changes "CHECK" check lines to "ATTRIBUTOR" check lines where
necessary and also fixes the now exposed, mostly minor, problems.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374735 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 20:40:10 +00:00
Craig Topper cf5b798076 [X86] Enable use of avx512 saturating truncate instructions in more cases.
This enables use of the saturating truncate instructions when the
result type is less than 128 bits. It also enables the use of
saturating truncate instructions on KNL when the input is less
than 512 bits. We can do this by widening the input and then
extracting the result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374731 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 19:07:28 +00:00
Sanjay Patel 36f6866886 [ConstantFold] fix inconsistent handling of extractelement with undef index (PR42689)
Any constant other than zero was already folded to undef if the index is undef.
https://bugs.llvm.org/show_bug.cgi?id=42689

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374729 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 17:34:08 +00:00
Sanjay Patel 3b2a5e76e1 [InstCombine] don't assume 'inbounds' for bitcast deref or null pointer in non-default address space
Follow-up to D68244 to account for a corner case discussed in:
https://bugs.llvm.org/show_bug.cgi?id=43501

Add one more restriction: if the pointer is deref-or-null and in a non-default
(non-zero) address space, we can't assume inbounds.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374728 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 17:19:08 +00:00
Roman Lebedev c45f92289b [NFC][InstCombine] More test for "sign bit test via shifts" pattern (PR43595)
While that pattern is indirectly handled via
reassociateShiftAmtsOfTwoSameDirectionShifts(),
that incursme one-use restriction on truncation,
which is pointless since we know that we'll produce a single instruction.

Additionally, *if* we are only looking for sign bit,
we don't need shifts to be identical,
which isn't the case in general,
and is the blocker for me in bug in question:

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374726 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 17:11:16 +00:00