Commit Graph

180465 Commits

Author SHA1 Message Date
George Rimar
dce5977901 [yaml2elf] - Check we are able to set custom sh_link for .symtab/.dynsym
Allow using both custom numeric and string values for Link field of the
dynamic and regular symbol tables.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363042 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 10:00:51 +00:00
Simon Pilgrim
6317ed58b0 [DAGCombine] GetNegatedExpression - constant float vector support (PR42105)
Add support for negation of constant build vectors.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363040 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 09:44:33 +00:00
Simon Tatham
9837211609 [ARM] Add the non-MVE instructions in Arm v8.1-M.
This adds support for the new family of conditional selection /
increment / negation instructions; the low-overhead branch
instructions (e.g. BF, WLS, DLS); the CLRM instruction to zero a whole
list of registers at once; the new VMRS/VMSR and VLDR/VSTR
instructions to get data in and out of 8.1-M system registers,
particularly including the new VPR register used by MVE vector
predication.

To support this, we also add a register name 'zr' (used by the CSEL
family to force one of the inputs to the constant 0), and operand
types for lists of registers that are also allowed to include APSR or
VPR (used by CLRM). The VLDR/VSTR instructions also need a new
addressing mode.

The low-overhead branch instructions exist in their own separate
architecture extension, which we treat as enabled by default, but you
can say -mattr=-lob or equivalent to turn it off.

Reviewers: dmgreen, samparker, SjoerdMeijer, t.p.northover

Reviewed By: samparker

Subscribers: miyuki, javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363039 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 09:29:18 +00:00
Sander de Smalen
a813b38069 Change semantics of fadd/fmul vector reductions.
This patch changes how LLVM handles the accumulator/start value
in the reduction, by never ignoring it regardless of the presence of
fast-math flags on callsites. This change introduces the following
new intrinsics to replace the existing ones:

  llvm.experimental.vector.reduce.fadd -> llvm.experimental.vector.reduce.v2.fadd
  llvm.experimental.vector.reduce.fmul -> llvm.experimental.vector.reduce.v2.fmul

and adds functionality to auto-upgrade existing LLVM IR and bitcode.

Reviewers: RKSimon, greened, dmgreen, nikic, simoll, aemerson

Reviewed By: nikic

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363035 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 08:22:10 +00:00
Craig Topper
b34ced6c7d [X86] Add load folding isel patterns to scalar_math_patterns and AVX512_scalar_math_fp_patterns.
Also add a FIXME for the peephole pass not being able to handle this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363032 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 04:30:53 +00:00
Tom Stellard
9f6eb4ee41 Revert CMake: Make most target symbols hidden by default
This reverts r362990 (git commit 374571301dc8e9bc9fdd1d70f86015de198673bd)

This was causing linker warnings on Darwin:

ld: warning: direct access in function 'llvm::initializeEvexToVexInstPassPass(llvm::PassRegistry&)'
from file '../../lib/libLLVMX86CodeGen.a(X86EvexToVex.cpp.o)' to global weak symbol
'void std::__1::__call_once_proxy<std::__1::tuple<void* (&)(llvm::PassRegistry&),
std::__1::reference_wrapper<llvm::PassRegistry>&&> >(void*)' from file '../../lib/libLLVMCore.a(Verifier.cpp.o)'
means the weak symbol cannot be overridden at runtime. This was likely caused by different translation
units being compiled with different visibility settings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363028 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 03:21:13 +00:00
Peter Collingbourne
536b7f4575 Symbolize: Make DWPName a symbolizer option instead of an argument to symbolize{,Inlined}Code.
This makes the interface simpler and more consistent with the interface for
.dSYM files and fixes a bug where llvm-symbolizer would not read the dwp if
it was asked to symbolize data before symbolizing code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363025 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 02:32:27 +00:00
Peter Collingbourne
254898f6b8 Symbolize: Replace the Options constructor with in-class initialization. NFCI.
This is not only less code but also clearer at the use site.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363024 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 02:31:54 +00:00
Matt Arsenault
65de13b975 AtomicExpand: Don't crash on non-0 alloca
This now produces garbage on AMDGPU with a call to an nonexistent,
anonymous libcall but won't assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363022 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 01:35:07 +00:00
Matt Arsenault
15d90808ef AMDGPU: Expand < 32-bit atomics
Also fix AtomicExpand asserting on atomicrmw fadd/fsub.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363021 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 01:35:00 +00:00
Nico Weber
f4068f34be gn build: Merge r362939
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363020 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 01:29:11 +00:00
Nico Weber
54784fa169 gn build: Merge r362972
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363019 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 01:23:38 +00:00
Nico Weber
d9d0bb7e78 llvm-lib: Implement /machine: argument
And share some code with lld-link.

While here, also add a FIXME about PR42180 and merge r360150 to llvm-lib.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363016 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 01:13:41 +00:00
Chris Bieneman
ef35a12044 Setup testing target dependencies for default runtimes
Summary: The default runtimes targets aren't getting their dependencies configured correctly which results in check-runtimes failing when built from a clean build.

Reviewers: phosek, compnerd

Reviewed By: phosek

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363015 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 00:25:57 +00:00
Yi Kong
0a0d6b794d [AArch64] Add more CPUs to host detection
Returns "cortex-a73" for 3rd and 4th gen Kryo; not precisely correct,
but close enough.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363013 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 00:05:36 +00:00
Puyan Lotfi
1a0e625848 [MIR-Canon] Fixing non-determinism that was breaking bots (NFC).
An earlier fix of a subtle iterator invalidation bug had uncovered a
nondeterminism that was present in the MultiUsers bag. Problem was that
MultiUsers was being looked up using pointers.

This patch is an NFC change that numbers each multiuser and processes each in
numbered order. This fixes the test failure on netbsd and will likely fix the
green-dragon bot too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363012 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 00:00:25 +00:00
Daniel Sanders
b565f08ec2 Break a couple more false dependencies on target libraries
Summary: Repeat r361567 for a few more tools.

Reviewers: bogner

Reviewed By: bogner

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363011 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 23:52:38 +00:00
Jonas Devlieghere
3cf7b4efc6 [dsymutil] Remove stale comment (NFC)
The comment was no longer relevant after r362621.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363008 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 23:30:20 +00:00
Shoaib Meenai
dc103f84a5 [Support] Explicitly detect recursive response files
Previous detection relied upon an arbitrary hard coded limit of 21
response files, which some code bases were running up against.

The new detection maintains a stack of processing response files and
explicitly checks if a newly encountered file is in the current stack.
Some bookkeeping data is necessary in order to detect when to pop the
stack.

Patch by Chris Glover.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363005 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 23:24:02 +00:00
Rong Xu
2581aa9e41 [PGO] Fix the buildbot failure in r362995
Fixed one unused variable warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363004 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 23:20:04 +00:00
Philip Reames
85a2f58ba7 [Tests] Adjust LFTR dead-iv tests to bypass undef cases
As pointed out by Nikita in review, undef and poison need to be handled separately.  Since we're no longer expecting any test improvements - just fixes for miscompiles - update the tests to bypass the existing undef check.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363002 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 23:17:10 +00:00
Cameron McInally
131800e73e [NFC][CodeGen] Forgot 2 unary FNeg tests in X86/fma-intrinsics-canonical.ll
Follow-up to r362999.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363001 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 23:02:36 +00:00
Cameron McInally
402b6f9543 [NFC][CodeGen] Add unary FNeg tests to X86/fma-intrinsics-canonical.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362999 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 22:45:54 +00:00
Tom Stellard
e0fccd9cf8 Fix typo from r362990 to fix Windows builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362997 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 22:40:32 +00:00
Rong Xu
f9ab36ca63 [PGO] Handle cases of non-instrument BBs
As shown in PR41279, some basic blocks (such as catchswitch) cannot be
instrumented. This patch filters out these BBs in PGO instrumentation.
It also sets the profile count to the fail-to-instrument edge, so that we
can propagate the counts in the CFG.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362995 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 22:36:27 +00:00
Philip Reames
150fff8ce4 [Tests] Split an LFTR dead-iv case
There are two interesting sub-cases here.  1) Switching IVs is legal, but only in pre-increment form.  and 2) Switching IVs is legal, and so is post-increment form.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362993 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 22:33:20 +00:00
Tom Stellard
2cda3f1ac0 CMake: Make most target symbols hidden by default
Summary:
For builds with LLVM_BUILD_LLVM_DYLIB=ON and BUILD_SHARED_LIBS=OFF
this change makes all symbols in the target specific libraries hidden
by default.

A new macro called LLVM_EXTERNAL_VISIBILITY has been added to mark symbols in these
libraries public, which is mainly needed for the definitions of the
LLVMInitialize* functions.

This patch reduces the number of public symbols in libLLVM.so by about
25%.  This should improve load times for the dynamic library and also
make abi checker tools, like abidiff require less memory when analyzing
libLLVM.so

One side-effect of this change is that for builds with
LLVM_BUILD_LLVM_DYLIB=ON and LLVM_LINK_LLVM_DYLIB=ON some unittests that
access symbols that are no longer public will need to be statically linked.

Before and after public symbol counts (using gcc 8.2.1, ld.bfd 2.31.1):
nm before/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
36221
nm after/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
26278

Reviewers: chandlerc, beanz, mgorny, rnk, hans

Reviewed By: rnk, hans

Subscribers: Jim, hiraditya, michaelplatings, chapuni, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, sbc100, jgravelle-google, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, mgrang, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, kristina, jsji, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362990 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 22:12:56 +00:00
Jessica Paquette
469555a2f0 [GlobalISel] Translate memset/memmove/memcpy from undef ptrs into nops
If the source is undef, then just don't do anything.

This matches SelectionDAG's behaviour in SelectionDAG.cpp.

Also add a test showing that we do the right thing here.
(irtranslator-memfunc-undef.ll)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362989 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 21:53:56 +00:00
Cameron McInally
cd12a17de4 [NFC][CodeGen] Add unary FNeg tests to some X86/ and XCore/ tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362987 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 21:31:59 +00:00
Erik Pilkington
569feb3a52 [demangle] Vendor extended types shouldn't be considered substitution candidates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362983 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 21:02:39 +00:00
Philip Reames
7510b2f07d Factor out a helper function for readability and reuse in a future patch [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362980 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 20:41:27 +00:00
Matt Davis
e39c45020a [Docs] [llvm-mca] Point out a caveat for using llvm-mca markers in source code.
Summary: See: https://bugs.llvm.org/show_bug.cgi?id=42173

Reviewers: andreadb, mattd, RKSimon, spatel

Reviewed By: andreadb

Subscribers: tschuett, gbedwell, llvm-commits, andreadb

Tags: #llvm

Patch by Max Marrone (maxpm)! Thanks!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362979 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 20:38:56 +00:00
Philip Reames
656142808a [Tests] Add tests for D62939 (miscompiles around dead pointer IVs)
Flesh out a collection of tests for switching to a dead IV within LFTR, both for the current miscompile, and for some cases which we should be able to handle via simple reasoning.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362976 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 19:45:59 +00:00
Philip Reames
4d44152a0f [LFTR] Use recomputed BE count
This was discussed as part of D62880.  The basic thought is that computing BE taken count after widening should produce (on average) an equally good backedge taken count as the one before widening.  Since there's only one test in the suite which is impacted by this change, and it's essentially equivelent codegen, that seems to be a reasonable assertion.  This change was separated from r362971 so that if this turns out to be problematic, the triggering piece is obvious and easily revertable.

For the nestedIV example from elim-extend.ll, we end up with the following BE counts:
BEFORE: (-2 + (-1 * %innercount) + %limit)
AFTER: (-1 + (sext i32 (-1 + %limit) to i64) + (-1 * (sext i32 %innercount to i64))<nsw>)

Note that before is an i32 type, and the after is an i64.  Truncating the i64 produces the i32. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362975 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 19:18:53 +00:00
Jinsong Ji
93d6b17c1c [PowerPC][HTM]Fix $zero is not a GPRC register for builtin_ttest
This was found during HTM cleanup.
Adding a test for builtin_ttest would expose following issue.

*** Bad machine code: Illegal physical register for instruction ***
 - function:    test10
 - basic block: %bb.0 entry (0xf0e57497b58)
 - instruction: %5:crrc0 = TABORTWCI 0, $zero, 0
 - operand 2:   $zero
  $zero is not a GPRC register.
LLVM ERROR: Found 1 machine code errors.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362974 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 19:04:14 +00:00
Jordan Rupprecht
7cc02fd898 [llvm-objcopy] Fix SHT_GROUP ordering.
Summary:
When llvm-objcopy sorts sections during finalization, it only sorts based on the offset, which can cause the group section to come after the sections it contains. This causes link failures when using gold to link objects created by llvm-objcopy.

Fix this for now by copying GNU objcopy's behavior of placing SHT_GROUP sections first. In the future, we may want to remove this sorting entirely to more closely preserve the input file layout.

This fixes https://bugs.llvm.org/show_bug.cgi?id=42052.

Reviewers: jakehehrlich, jhenderson, MaskRay, espindola, alexshap

Reviewed By: MaskRay

Subscribers: phuongtrang148993, emaste, arichardson, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362973 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 18:35:01 +00:00
Sanjay Patel
10f75512d4 [Analysis] add unit test file for VectorUtils; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362972 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 18:19:05 +00:00
Philip Reames
de4727f97d Prepare for multi-exit LFTR [NFC]
This change does the plumbing to wire an ExitingBB parameter through the LFTR implementation, and reorganizes the code to work in terms of a set of individual loop exits. Most of it is fairly obvious, but there's one key complexity which makes it worthy of consideration. The actual multi-exit LFTR patch is in D62625 for context.

Specifically, it turns out the existing code uses the backedge taken count from before a IV is widened. Oddly, we can end up with a different (more expensive, but semantically equivelent) BE count for the loop when requerying after widening.  For the nestedIV example from elim-extend, we end up with the following BE counts:
BEFORE: (-2 + (-1 * %innercount) + %limit)
AFTER: (-1 + (sext i32 (-1 + %limit) to i64) + (-1 * (sext i32 %innercount to i64))<nsw>)

This is the only test in tree which seems sensitive to this difference. The actual result of using the wider BETC on this example is that we actually produce slightly better code. :)

In review, we decided to accept that test change.  This patch is structured to preserve the old behavior, but a separate change will immediate follow with the behavior change.  (I wanted it separate for problem attribution purposes.)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362971 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 17:51:13 +00:00
Wolfgang Pieb
84f071dd78 [ELF][llvm-objdump] Treat dynamic tag values as virtual addresses instead of offsets
The ELF gABI requires the tag values of DT_REL, DT_RELA and DT_JMPREL to be
treated as virtual addresses. They were treated as offsets. Fixes PR41832.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362969 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 17:50:24 +00:00
Sameer AbuAsal
21022f9992 [RISCV] Replace map with set in getReqFeatures
Summary:
Use a set in getReqFeatures() in RISCVCompressInstEmitter instead of a map
because the index we save is not needed.

This also fixes bug 41666.

Reviewers: llvm-commits, apazos, asb, nickdesaulniers

Reviewed By: asb

Subscribers: Jim, nickdesaulniers, rbar, johnrusso, simoncook, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362968 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 17:15:45 +00:00
Jordan Rupprecht
abf16a584f [docs] Add 'git llvm revert' to getting started guide
Summary: This documents `git llvm revert rNNNNNN` in the getting started guide for broader visibility.

Reviewers: jyknight, mehdi_amini

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362966 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 17:00:49 +00:00
Andrea Di Biagio
19f37e1a1f [llvm-mca] Enable bottleneck analysis when flag -all-views is specified.
Bottleneck Analysis is one of the many views available in llvm-mca. Therefore,
it should be enabled when flag -all-views is passed in input to the tool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362964 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 16:56:25 +00:00
Francis Visoiu Mistrih
c030038e73 [FastISel] Skip creating unnecessary vregs for arguments
This behavior was added in r130928 for both FastISel and SD, and then
disabled in r131156 for FastISel.

This re-enables it for FastISel with the corresponding fix.

This is triggered only when FastISel can't lower the arguments and falls
back to SelectionDAG for it.

FastISel contains a map of "register fixups" where at the end of the
selection phase it replaces all uses of a register with another
register that FastISel sometimes pre-assigned. Code at the end of
SelectionDAGISel::runOnMachineFunction is doing the replacement at the
very end of the function, while other pieces that come in before that
look through the MachineFunction and assume everything is done. In this
case, the real issue is that the code emitting COPY instructions for the
liveins (physreg to vreg) (EmitLiveInCopies) is checking if the vreg
assigned to the physreg is used, and if it's not, it will skip the COPY.
If a register wasn't replaced with its assigned fixup yet, the copy will
be skipped and we'll end up with uses of undefined registers.

This fix moves the replacement of registers before the emission of
copies for the live-ins.

The initial motivation for this fix is to enable tail calls for
swiftself functions, which were blocked because we couldn't prove that
the swiftself argument (which is callee-save) comes from a function
argument (live-in), because there was an extra copy (vreg to vreg).

A few tests are affected by this:

* llvm/test/CodeGen/AArch64/swifterror.ll: we used to spill x21
(callee-save) but never reload it because it's attached to the return.
We now don't even spill it anymore.
* llvm/test/CodeGen/*/swiftself.ll: we tail-call now.
* llvm/test/CodeGen/AMDGPU/mubuf-legalize-operands.ll: I believe this
test was not really testing the right thing, but it worked because the
same registers were re-used.
* llvm/test/CodeGen/ARM/cmpxchg-O0.ll: regalloc changes
* llvm/test/CodeGen/ARM/swifterror.ll: get rid of a copy
* llvm/test/CodeGen/Mips/*: get rid of spills and copies
* llvm/test/CodeGen/SystemZ/swift-return.ll: smaller stack
* llvm/test/CodeGen/X86/atomic-unordered.ll: smaller stack
* llvm/test/CodeGen/X86/swifterror.ll: same as AArch64
* llvm/test/DebugInfo/X86/dbg-declare-arg.ll: stack size changed

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362963 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 16:53:37 +00:00
Cameron McInally
f36937ccde [ExecutionEngine] Fix rL362941: Add UnaryOperator visitor to the interpreter
Missed break statements. This was D62881.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362958 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 16:05:25 +00:00
Piotr Sobczak
944600b17a [AMDGPU] Optimize image_[load|store]_mip
Summary:
Replace image_load_mip/image_store_mip
with image_load/image_store if lod is 0.

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362957 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 15:58:51 +00:00
Simon Tatham
692343df5a Revert rL362953 and its followup rL362955.
These caused a build failure because I managed not to notice they
depended on a later unpushed commit in my current stack. Sorry about
that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362956 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 15:58:19 +00:00
Simon Tatham
5cdc09e570 [ARM] Add the non-MVE instructions in Arm v8.1-M.
This should have been part of r362953, but I had a finger-trouble
incident and committed the old rather than new version of the patch.
Sorry.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362955 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 15:41:58 +00:00
Sanjay Patel
04e978b788 [InstCombine] allow unordered preds when canonicalizing to fabs()
We have a known-never-nan value via 'nnan', so an unordered predicate
is the same as its ordered sibling.

Similar to:
rL362937

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362954 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 15:39:00 +00:00
Simon Tatham
534ca812a9 [ARM] Add the non-MVE instructions in Arm v8.1-M.
This adds support for the new family of conditional selection /
increment / negation instructions; the low-overhead branch
instructions (e.g. BF, WLS, DLS); the CLRM instruction to zero a whole
list of registers at once; the new VMRS/VMSR and VLDR/VSTR
instructions to get data in and out of 8.1-M system registers,
particularly including the new VPR register used by MVE vector
predication.

To support this, we also add a register name 'zr' (used by the CSEL
family to force one of the inputs to the constant 0), and operand
types for lists of registers that are also allowed to include APSR or
VPR (used by CLRM). The VLDR/VSTR instructions also need some new
addressing modes.

The low-overhead branch instructions exist in their own separate
architecture extension, which we treat as enabled by default, but you
can say -mattr=-lob or equivalent to turn it off.

Reviewers: dmgreen, samparker, SjoerdMeijer, t.p.northover

Reviewed By: samparker

Subscribers: miyuki, javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362953 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 15:36:34 +00:00
Whitney Tsang
b1c4b0155f [DA] Add an option to control delinearization validity checks
Summary: Dependence Analysis performs static checks to confirm validity
of delinearization. These checks often fail for 64-bit targets due to
type conversions and integer wrapping that prevent simplification of the
SCEV expressions. These checks would also fail at compile-time if the
lower bound of the loops are compile-time unknown.
Author: bmahjour
Reviewer: Meinersbur, jdoerfert, kbarton, dmgreen, fhahn
Reviewed By: Meinersbur, jdoerfert, dmgreen
Subscribers: fhahn, hiraditya, javed.absar, llvm-commits, Whitney,
etiotto
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D62610

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362952 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 15:29:07 +00:00