OSDN Git Service

android-x86/external-llvm.git
5 years ago[docs] Document LLVM_ENABLE_IDE
Shoaib Meenai [Fri, 15 Feb 2019 20:40:26 +0000 (20:40 +0000)]
[docs] Document LLVM_ENABLE_IDE

Use some of the wording and the motivating example from r344555. The
lack of documentation was pointed out by Roman Lebedev.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354167 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Fix LowerAsmOutputForConstraint.
Nirav Dave [Fri, 15 Feb 2019 20:01:55 +0000 (20:01 +0000)]
[X86] Fix LowerAsmOutputForConstraint.

Summary:
Update Flag when generating cc output.

Fixes PR40737.

Reviewers: rnk, nickdesaulniers, craig.topper, spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354163 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Move all the SSE legality checks out of FP_TO_INTHelper and up to LowerFP_TO_IN...
Craig Topper [Fri, 15 Feb 2019 19:21:39 +0000 (19:21 +0000)]
[X86] Move all the SSE legality checks out of FP_TO_INTHelper and up to LowerFP_TO_INT. NFCI

These checks aren't needed on the call to FP_TO_INTHelper from the type legalizer for splitting i64. We always want to use X87 FIST/FISTT to memory there.

Moving up the SSE checks will allow this routine to focus on what it cares about and makes its return semantics cleaner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354161 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRecommit "[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support."
Jonas Paulsson [Fri, 15 Feb 2019 19:13:55 +0000 (19:13 +0000)]
Recommit "[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support."

It seems there were some problem with using a .mir test. For some reason
doing '-stop-before=codegenprepare' and then '-start-before=codegenprepare'
on the output .mir file results in the NoVRegs Property after instruction
selection.

Recommitting the same test as an .ll file instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354160 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeExtractor] Do not lift lifetime.end markers for region inputs
Vedant Kumar [Fri, 15 Feb 2019 18:46:58 +0000 (18:46 +0000)]
[CodeExtractor] Do not lift lifetime.end markers for region inputs

If a lifetime.end marker occurs along one path through the extraction
region, but not another, then it's still incorrect to lift the marker,
because there is some path through the extracted function which would
ordinarily not reach the marker. If the call to the extracted function
is in a loop, unrolling can cause inputs to the function to become
optimized out as undef after the first iteration.

To prevent incorrect stack slot merging in the calling function, it
should be sufficient to lift lifetime.start markers for region inputs.
I've tested this theory out by doing a stage2 check-all with randomized
splitting enabled.

This is a follow-up to r353973, and there's additional context for this
change in https://reviews.llvm.org/D57834.

rdar://47896986

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354159 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[HotColdSplit] Schedule splitting late to fix perf regression
Vedant Kumar [Fri, 15 Feb 2019 18:46:44 +0000 (18:46 +0000)]
[HotColdSplit] Schedule splitting late to fix perf regression

With or without PGO data applied, splitting early in the pipeline
(either before the inliner or shortly after it) regresses performance
across SPEC variants. The cause appears to be that splitting hides
context for subsequent optimizations.

Schedule splitting late again, in effect reversing r352080, which
scheduled the splitting pass early for code size benefits (documented in
https://reviews.llvm.org/D57082).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354158 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA] Improved code comment. NFC
Andrea Di Biagio [Fri, 15 Feb 2019 18:28:11 +0000 (18:28 +0000)]
[MCA] Improved code comment. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354154 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix 80-column limit in SimplifyDemandedBits/SimplifyDemandedVectorElts. NFCI.
Simon Pilgrim [Fri, 15 Feb 2019 18:15:58 +0000 (18:15 +0000)]
Fix 80-column limit in SimplifyDemandedBits/SimplifyDemandedVectorElts. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354152 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MCA][LSUnit] Return the ID of the dependent memory operation from method
Andrea Di Biagio [Fri, 15 Feb 2019 18:05:59 +0000 (18:05 +0000)]
[MCA][LSUnit] Return the ID of the dependent memory operation from method
isReady(). NFCI

This is yet another change in preparation for a fix for PR37494.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354150 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] Demonstrate more missing atomicrmw transforms
Philip Reames [Fri, 15 Feb 2019 17:11:30 +0000 (17:11 +0000)]
[Tests] Demonstrate more missing atomicrmw transforms

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354146 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] fix crash while trying to narrow a binop of shuffles (PR40734)
Sanjay Patel [Fri, 15 Feb 2019 16:31:55 +0000 (16:31 +0000)]
[InstCombine] fix crash while trying to narrow a binop of shuffles (PR40734)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354144 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r354137 - OptionalStorage implementation for trivial type, take III
Serge Guelton [Fri, 15 Feb 2019 16:12:46 +0000 (16:12 +0000)]
Revert r354137 - OptionalStorage implementation for trivial type, take III

This still fails on some random platform, and I fail to reproduce the issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354142 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Fix inadequate verification of g_build_vector
Matt Arsenault [Fri, 15 Feb 2019 15:24:34 +0000 (15:24 +0000)]
GlobalISel: Fix inadequate verification of g_build_vector

Testing based on the total size of the elements failed to catch a few
invalid scenarios, so explicitly check the number of elements/operands
and types.

This failed to catch situations like
<4 x s16> = G_BUILD_VECTOR s32, s32 since the total size added
up. This also would fail to catch an implicit conversion between
pointers and scalars.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354139 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTry to organize MachineVerifier tests
Matt Arsenault [Fri, 15 Feb 2019 15:24:31 +0000 (15:24 +0000)]
Try to organize MachineVerifier tests

The Verifier is separate from the MachineVerifier, so move it to a
different directory. Some other verifier tests were scattered in
target codegen tests as well (although I'm sure I missed some). Work
towards using a more consistent naming scheme to make it clearer where
the gaps still are for generic instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354138 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoOptionalStorage implementation for trivial type, take III
Serge Guelton [Fri, 15 Feb 2019 15:17:29 +0000 (15:17 +0000)]
OptionalStorage implementation for trivial type, take III

This is another attempt at implementating optional storage
for trivially copyable type, using an union instead of a
raw buffer to hold the actual storage. This make it possible
to get rid of the reinterpret_cast, and hopefully to fix the UB
of the previous attempts.

This validates fine on my laptop for gcc 8.2 and gcc 4.8, I'll
revert if it breaks the validation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354137 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MergeICmps] Make base ordering really deterministic.
Clement Courbet [Fri, 15 Feb 2019 14:17:17 +0000 (14:17 +0000)]
[MergeICmps] Make base ordering really deterministic.

Summary:
The idea is that we now manipulate bases through a `unsigned BaseID` based on
order of appearance in the comparison chain rather than through the `Value*`.

Fixes 40714.

Reviewers: gchatelet

Subscribers: mgrang, jfb, jdoerfert, llvm-commits, hans

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354131 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MergeICmps][NFC] Improve doc.
Clement Courbet [Fri, 15 Feb 2019 12:58:06 +0000 (12:58 +0000)]
[MergeICmps][NFC] Improve doc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354128 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSpeculatively revert r354051 "Recommit Optional specialization for trivially copyable...
Hans Wennborg [Fri, 15 Feb 2019 12:20:33 +0000 (12:20 +0000)]
Speculatively revert r354051 "Recommit Optional specialization for trivially copyable types"
and
r354055 "Optional specialization for trivially copyable types, part2"

These are suspected to cause Clang to get miscompiled on Ubuntu 14.04
(Trusty) which uses GCC 4.8.4. Reverting for an hour to see if this
helps. See llvm-commits thread.

> Recommit Optional specialization for trivially copyable types
>
> Unfortunately the original code gets misscompiled by GCC (at least 8.1),
> this is a tentative workaround using std::memcpy instead of inplace new
> for trivially copyable types. I'll revert if it breaks.
>
> Original revision: https://reviews.llvm.org/D57097

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354126 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFCI] Factor out block removal from stack of nested loops
Max Kazantsev [Fri, 15 Feb 2019 12:18:10 +0000 (12:18 +0000)]
[NFCI] Factor out block removal from stack of nested loops

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354124 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix "field 'DFS' will be initialized after field 'DTU'" warning. NFCI.
Simon Pilgrim [Fri, 15 Feb 2019 12:13:16 +0000 (12:13 +0000)]
Fix "field 'DFS' will be initialized after field 'DTU'" warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354123 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[BPI] Look through bitcasts in calcZeroHeuristic
Sam Parker [Fri, 15 Feb 2019 11:50:21 +0000 (11:50 +0000)]
[BPI] Look through bitcasts in calcZeroHeuristic

Constant hoisting may have hidden a constant behind a bitcast so that
it isn't folded into its users. However, this prevents BPI from
calculating some of its heuristics that are based upon constant
values. So, I've added a simple helper function to look through these
casts.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354119 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Promote DFS to field for further use
Max Kazantsev [Fri, 15 Feb 2019 11:39:35 +0000 (11:39 +0000)]
[NFC] Promote DFS to field for further use

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354118 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][AVX] lowerShuffleAsLanePermuteAndPermute - fully populate the lane shuffle...
Simon Pilgrim [Fri, 15 Feb 2019 11:39:21 +0000 (11:39 +0000)]
[X86][AVX] lowerShuffleAsLanePermuteAndPermute - fully populate the lane shuffle mask (PR40730)

As detailed on PR40730, we are not correctly filling in the lane shuffle mask (D53148/rL344446) - we fill in for the correct src lane but don't add it to the correct mask element, so any reference to the correct element is likely to see an UNDEF mask index.

This allows constant folding to propagate UNDEFs prior to the lane mask being (correctly) lowered to vperm2f128.

This patch fixes the issue by fully populating the lane shuffle mask - this is more than is necessary (if we only filled in the required mask elements we might be able to match other shuffle instructions - broadcasts etc.), but its the most cautious approach as this needs to be cherrypicked into the 8.0.0 release branch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354117 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM GlobalISel] Style fix. NFCI
Diana Picus [Fri, 15 Feb 2019 10:50:02 +0000 (10:50 +0000)]
[ARM GlobalISel] Style fix. NFCI

Add the opcode for ADDrr / t2ADDrr to the Opcode cache, as we did for
all other opcodes where the handling is otherwise the same between arm
mode and thumb2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354115 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM GlobalISel] Support branches for Thumb2
Diana Picus [Fri, 15 Feb 2019 10:24:03 +0000 (10:24 +0000)]
[ARM GlobalISel] Support branches for Thumb2

Just like arm mode, but with different opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354113 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Add assembler support for LA pseudo-instruction
Alex Bradbury [Fri, 15 Feb 2019 09:53:32 +0000 (09:53 +0000)]
[RISCV] Add assembler support for LA pseudo-instruction

This patch also introduces the emitAuipcInstPair helper, which is then used
for both emitLoadAddress and emitLoadLocalAddress.

Differential Revision: https://reviews.llvm.org/D55325
Patch by James Clarke.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354111 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV] Support assembling %got_pcrel_hi operator
Alex Bradbury [Fri, 15 Feb 2019 09:43:46 +0000 (09:43 +0000)]
[RISCV] Support assembling %got_pcrel_hi operator

Differential Revision: https://reviews.llvm.org/D55279
Patch by James Clarke.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354110 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM CGP] Fix ConvertTruncs
Sam Parker [Fri, 15 Feb 2019 09:04:39 +0000 (09:04 +0000)]
[ARM CGP] Fix ConvertTruncs

ConvertTruncs is used to replace a trunc for an AND mask, however
this function wasn't working as expected. By performing the change
later, we can create a wide type integer mask instead of a narrow -1
value, which could then be simply removed (incorrectly). Because we
now perform this action later, it's necessary to cache the trunc type
before we perform the promotion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354108 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Tweak SplitBlockAndInsertIfThen to use existing ThenBlock
Max Kazantsev [Fri, 15 Feb 2019 08:18:00 +0000 (08:18 +0000)]
[NFC] Tweak SplitBlockAndInsertIfThen to use existing ThenBlock

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354107 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TEST] Update test comments, refactor checks with update_test_checks.py
Max Kazantsev [Fri, 15 Feb 2019 07:06:52 +0000 (07:06 +0000)]
[TEST] Update test comments, refactor checks with update_test_checks.py

This patch changes messages in guards-related tests to adequately reflect
reality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354101 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoX86: Replace isSafeToClobberEFLAGS implementation
Matt Arsenault [Fri, 15 Feb 2019 04:01:39 +0000 (04:01 +0000)]
X86: Replace isSafeToClobberEFLAGS implementation

Also use modifiesRegister instead of looping over operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354098 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support."
Francis Visoiu Mistrih [Fri, 15 Feb 2019 03:01:09 +0000 (03:01 +0000)]
Revert "[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support."

This reverts commit aa0b77d3395dc6ab91647138139c1a15a3aa088d.

This fails to pass the machine verifier:
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/13579/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354096 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[lit][NFC] Cleanup copy&paste naming mistake
Julian Lettner [Fri, 15 Feb 2019 02:44:52 +0000 (02:44 +0000)]
[lit][NFC] Cleanup copy&paste naming mistake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354095 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-cxxfilt] Fix a comment typo. NFC.
Matt Davis [Fri, 15 Feb 2019 02:43:14 +0000 (02:43 +0000)]
[llvm-cxxfilt] Fix a comment typo. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354094 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GISel][NFC]: Add methods to speed up insertion into GISelWorklist
Aditya Nandakumar [Fri, 15 Feb 2019 01:37:54 +0000 (01:37 +0000)]
[GISel][NFC]: Add methods to speed up insertion into GISelWorklist

https://reviews.llvm.org/D58073

Speed up insertion during the initial populating phase into the
GISelWorkList by deferring repeatedly resizing the DenseMap.
This results in ~10% improvement in the combiner passes, and
~3% speedup in the Legalizer.

reviewed by: aemerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354093 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU: Set ABI version to 1 for code object v3
Konstantin Zhuravlyov [Thu, 14 Feb 2019 23:56:04 +0000 (23:56 +0000)]
AMDGPU: Set ABI version to 1 for code object v3

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354085 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[symbolizer] Avoid collecting symbols belonging to invalid sections.
Matt Davis [Thu, 14 Feb 2019 23:50:35 +0000 (23:50 +0000)]
[symbolizer] Avoid collecting symbols belonging to invalid sections.

Summary:
llvm-symbolizer would originally report symbols that belonged to an invalid object file section.
Specifically the case where: `*Symbol.getSection() == ObjFile.section_end()`
This patch prevents the Symbolizer from collecting symbols that belong to invalid sections.

The test  (from PR40591) introduces a case where two symbols have address 0,
one symbol is defined, 'foo', and the other is not defined, 'bar'.  This patch will cause
the Symbolizer to keep 'foo' and ignore 'bar'.

As a side note, the logic for adding symbols to the Symbolizer's store
(`SymbolizableObjectFile::addSymbol`) replaces symbols with the
same <address, size> pair.  At some point that logic should be revisited as in the
aforementioned case, 'bar' was overwriting 'foo' in the Symbolizer's store,
and 'foo' was forgotten.

This fixes PR40591

Reviewers: jhenderson, rupprecht

Reviewed By: rupprecht

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354083 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[INLINER] allow inlining of address taken blocks"
Nick Desaulniers [Thu, 14 Feb 2019 23:42:21 +0000 (23:42 +0000)]
Revert "[INLINER] allow inlining of address taken blocks"

This reverts commit 19e95fe61182945b7b68ad15348f144fb996633f.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354082 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[INLINER] allow inlining of address taken blocks
Nick Desaulniers [Thu, 14 Feb 2019 23:35:53 +0000 (23:35 +0000)]
[INLINER] allow inlining of address taken blocks

as long as their uses does not contain calls to functions that capture
the argument (potentially allowing the blockaddress to "escape" the
lifetime of the caller).

TODO:
- add more tests
- fix crash in llvm::updateCGAndAnalysisManagerForFunctionPass when
  invoking Transforms/Inline/blockaddress.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354079 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[x86] add tests for extractelement of FP; NFC
Sanjay Patel [Thu, 14 Feb 2019 23:17:22 +0000 (23:17 +0000)]
[x86] add tests for extractelement of FP; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354077 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[lit] Remove --single-process option (use -j1 instead)
Julian Lettner [Thu, 14 Feb 2019 22:46:56 +0000 (22:46 +0000)]
[lit] Remove --single-process option (use -j1 instead)

Remove `--single-process` command line option. Use `-j1` instead.

Also see commit: 96adb78b120b6aa9739eb714534dc8e819f7bc52

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354073 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMC/ELF: Allow targets to set ABI version
Konstantin Zhuravlyov [Thu, 14 Feb 2019 22:42:09 +0000 (22:42 +0000)]
MC/ELF: Allow targets to set ABI version

Tests are in the follow up change

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354072 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoGlobalISel: Add alignment to LegalityQuery MMOs
Matt Arsenault [Thu, 14 Feb 2019 22:41:09 +0000 (22:41 +0000)]
GlobalISel: Add alignment to LegalityQuery MMOs

This allows targets to specify the minimum alignment required for the
load/store.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354071 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReplace gcroot verifier tests
Matt Arsenault [Thu, 14 Feb 2019 22:41:01 +0000 (22:41 +0000)]
Replace gcroot verifier tests

These haven't been checking anything useful and have been testing the
wrong failure reason for many years. Replace them with something which
stresses what is actually implemented in the verifier now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354070 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[lit] Set --single-process for single tests and --threads=1
Julian Lettner [Thu, 14 Feb 2019 22:30:07 +0000 (22:30 +0000)]
[lit] Set --single-process for single tests and --threads=1

Summary:
Automatically upgrade debugging experience (single process, no thread
pool) when:
  1) we only run a single test
  2) user specifies `-j1`

Details:
Fix `--max-failures` in single process mode. Option did not have an
effect in single process mode.

Add display feedback for single process mode. Adapted test.

Improve argument checking (require positive integers).

`--single-process` is now essentially an alias for `-j1`. Should we
remove it?

Reviewers: rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354068 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Fix RegBankSelect for GEP.
Matt Arsenault [Thu, 14 Feb 2019 22:24:28 +0000 (22:24 +0000)]
AMDGPU/GlobalISel: Fix RegBankSelect for GEP.

This is basically a pointer typed add, so shouldn't be any different.
This was assuming everything was an SGPR, which is not true.

Also cleanup legality for GEP. I don't seem to be seeing the problem
the hack marking s64 as a legal pointer type the comment mentions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354067 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU] Ressociate 'add (add x, y), z' to use SALU
Stanislav Mekhanoshin [Thu, 14 Feb 2019 22:11:25 +0000 (22:11 +0000)]
[AMDGPU] Ressociate 'add (add x, y), z' to use SALU

Reassociate adds to collect scalar operands in a single
instruction when possible. That will result in a scalar
add followed by vector instead of two vector adds, thus
better utilizing SALU.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354066 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAMDGPU/GlobalISel: Handle split for 64-bit VALU select
Matt Arsenault [Thu, 14 Feb 2019 21:58:12 +0000 (21:58 +0000)]
AMDGPU/GlobalISel: Handle split for 64-bit VALU select

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354065 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ThinLTO] Detect partially split modules during the thin link
Teresa Johnson [Thu, 14 Feb 2019 21:22:50 +0000 (21:22 +0000)]
[ThinLTO] Detect partially split modules during the thin link

Summary:
The changes to disable LTO unit splitting by default (r350949) and
detect inconsistently split LTO units (r350948) are causing some crashes
when the inconsistency is detected in multiple threads simultaneously.
Fix that by having the code always look for the inconsistently split
LTO units during the thin link, by checking for the presence of type
tests recorded in the summaries.

Modify test added in r350948 to remove single threading required to fix
a bot failure due to this issue (and some debugging options added in the
process of diagnosing it).

Reviewers: pcc

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354062 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CMake] Fix ability to use LLVM_ENABLE_PROJECTS with LLVM_EXTERNAL_PROJECTS
Chris Bieneman [Thu, 14 Feb 2019 20:57:17 +0000 (20:57 +0000)]
[CMake] Fix ability to use LLVM_ENABLE_PROJECTS with LLVM_EXTERNAL_PROJECTS

LLVM r353148, changed the circumstances in which the project source directory variables are created to only create them for LLVM projects. This patch initializes the directory variables for projects specified in `LLVM_EXTERNAL_PROJECTS` as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354060 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Add todos for possible atomicrmw transforms
Philip Reames [Thu, 14 Feb 2019 20:48:36 +0000 (20:48 +0000)]
[InstCombine] Add todos for possible atomicrmw transforms

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354059 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCanonicalize all integer "idempotent" atomicrmw ops
Philip Reames [Thu, 14 Feb 2019 20:41:17 +0000 (20:41 +0000)]
Canonicalize all integer "idempotent" atomicrmw ops

For "idempotent" atomicrmw instructions which we can't simply turn into load, canonicalize the operation and constant. This reduces the matching needed elsewhere in the optimizer, but doesn't directly impact codegen.

For any architecture where OR/Zero is not a good default choice, you can extend the AtomicExpand lowerIdempotentRMWIntoFencedLoad mechanism. I reviewed X86 to make sure this works well, haven't audited other backends.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354058 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoStop enabling clang-tools-extra automatically when clang is in LLVM_ENABLE_PROJECTS
Nico Weber [Thu, 14 Feb 2019 20:26:35 +0000 (20:26 +0000)]
Stop enabling clang-tools-extra automatically when clang is in LLVM_ENABLE_PROJECTS

If you want to build clang-tools-extra with monorepo, just add it to
LLVM_ENABLE_PROJECTS like with other projects.

See also "Separating clang-tools-extra from clang in LLVM_ENABLE_PROJECTS"
on cfe-dev.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354057 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoOptional specialization for trivially copyable types, part2
Serge Guelton [Thu, 14 Feb 2019 19:41:44 +0000 (19:41 +0000)]
Optional specialization for trivially copyable types, part2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354055 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRecommit Optional specialization for trivially copyable types
Serge Guelton [Thu, 14 Feb 2019 19:17:00 +0000 (19:17 +0000)]
Recommit Optional specialization for trivially copyable types

Unfortunately the original code gets misscompiled by GCC (at least 8.1),
this is a tentative workaround using std::memcpy instead of inplace new
for trivially copyable types. I'll revert if it breaks.

Original revision: https://reviews.llvm.org/D57097

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354051 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTeach instcombine about remaining "idempotent" atomicrmw types
Philip Reames [Thu, 14 Feb 2019 18:39:14 +0000 (18:39 +0000)]
Teach instcombine about remaining "idempotent" atomicrmw types

Expand on Quentin's r353471 patch which converts some atomicrmws into loads. Handle remaining operation types, and fix a slight bug. Atomic loads are required to have alignment. Since this was within the InstCombine fixed point, somewhere else in InstCombine was adding alignment before the verifier saw it, but still, we should fix.

Terminology wise, I'm using the "idempotent" naming that is used for the same operations in AtomicExpand and X86ISelLoweringInfo. Once this lands, I'll add similar tests for AtomicExpand, and move the pattern match function to a common location. In the review, there was seemingly consensus that "idempotent" was slightly incorrect for this context.  Once we setle on a better name, I'll update all uses at once.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354046 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSupport: use internal `call_once` on PPC64le
Saleem Abdulrasool [Thu, 14 Feb 2019 18:36:52 +0000 (18:36 +0000)]
Support: use internal `call_once` on PPC64le

Always use the internal `call_once` for PPC64le.  This is needed to
support the Swift toolchain on PPC64le.

Patch by Sarvesh Tamba!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354045 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-ar] Implement the P modifier.
Jordan Rupprecht [Thu, 14 Feb 2019 18:35:13 +0000 (18:35 +0000)]
[llvm-ar] Implement the P modifier.

Summary:
GNU ar has a `P` modifier that changes filename comparisons to use full paths instead of the basename. As noted in the GNU docs, regular archives are not created with full path names, so P is used to deal with archives created by other archive programs (e.g. see the updated `absolute-paths.test` test case).

Since thin archives use full path names -- paths are relative to the archive -- it seems very error prone to not imply P when dealing with thin archives, so P is implied in those cases. (I think this is a deviation from GNU ar that makes sense).

This fixes PR37436 via https://github.com/ClangBuiltLinux/linux/issues/33.

Reviewers: mstorsjo, pcc, ruiu, davide, david2050, rnk

Subscribers: tpimh, llvm-commits, nickdesaulniers

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354044 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] cleanup inline asm register generation. NFCI.
Nirav Dave [Thu, 14 Feb 2019 18:06:21 +0000 (18:06 +0000)]
[X86] cleanup inline asm register generation. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354042 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support.
Jonas Paulsson [Thu, 14 Feb 2019 17:58:48 +0000 (17:58 +0000)]
[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support.

Review: Ulrich Weigand
https://reviews.llvm.org/D58240

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354039 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] Add tests for all idemptotent atomicrmws
Philip Reames [Thu, 14 Feb 2019 17:01:15 +0000 (17:01 +0000)]
[Tests] Add tests for all idemptotent atomicrmws

Base for a followup patch to strengthen the InstCombine transform, and then integrate the ExpandAtomics logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354036 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][AVX] Add PR40730 test case
Simon Pilgrim [Thu, 14 Feb 2019 14:45:32 +0000 (14:45 +0000)]
[X86][AVX] Add PR40730 test case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354034 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRefine ArgPromotion metadata handling
Teresa Johnson [Thu, 14 Feb 2019 14:14:24 +0000 (14:14 +0000)]
Refine ArgPromotion metadata handling

Summary:
In r353537 we now copy all metadata to the new function, with the old
being removed when the old function is eliminated. In some cases the old
function is dropped to a declaration (seems to only occur with the old
PM). Go ahead and clear all metadata from the old function to handle that
case, since verification will complain otherwise. This is consistent
with what was being done for debug metadata before r353537.

Reviewers: davidxl, uabelho

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354032 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV.
Florian Hahn [Thu, 14 Feb 2019 13:59:39 +0000 (13:59 +0000)]
[LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV.

The test case requires the peeled loop to be forgotten after peeling,
even though it does not have a parent. When called via the unroller,
SE->forgetTopmostLoop is also called, so the test case would also pass
without any SCEV invalidation, but peelLoop is exposed as utility
function. Also, in the test case, simplifyLoop will make changes,
removing the loop from SCEV, but it is better to not rely on this
behavior.

Reviewers: sanjoy, mkazantsev

Reviewed By: mkazantsev

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354031 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RISCV][NFC] Add RV64I CHECK lines to inline-asm.ll test
Alex Bradbury [Thu, 14 Feb 2019 13:09:54 +0000 (13:09 +0000)]
[RISCV][NFC] Add RV64I CHECK lines to inline-asm.ll test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354028 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoReapply [VFS] Allow multiple RealFileSystem instances with independent CWDs.
Sam McCall [Thu, 14 Feb 2019 12:57:01 +0000 (12:57 +0000)]
Reapply [VFS] Allow multiple RealFileSystem instances with independent CWDs.

This reverts commit r351091.
The original mac breakages are addressed by ensuring the root directory
we're working from is fully symlink-resolved before starting.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354026 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MIPS GlobalISel] Select phi instruction for integers
Petar Avramovic [Thu, 14 Feb 2019 12:36:19 +0000 (12:36 +0000)]
[MIPS GlobalISel] Select phi instruction for integers

Select G_PHI for integers for MIPS32.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354025 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Instrumentation][NFC] Fix warning.
Clement Courbet [Thu, 14 Feb 2019 12:10:49 +0000 (12:10 +0000)]
[Instrumentation][NFC] Fix warning.

lib/Transforms/Instrumentation/AddressSanitizer.cpp:1173:29: warning: extra ‘;’ [-Wpedantic]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354024 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MIPS GlobalISel] Select branch instructions
Petar Avramovic [Thu, 14 Feb 2019 11:39:53 +0000 (11:39 +0000)]
[MIPS GlobalISel] Select branch instructions

Select G_BR and G_BRCOND for MIPS32.
Unconditional branch G_BR does not have register operand,
for that reason we only add tests.
Since conditional branch G_BRCOND compares register to zero on MIPS32,
explicit extension must be performed on i1 condition in order to set
high bits to appropriate value.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354022 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMake widenable condition transparent for MemoryWriteTracking
Max Kazantsev [Thu, 14 Feb 2019 11:10:29 +0000 (11:10 +0000)]
Make widenable condition transparent for MemoryWriteTracking

Side effects of widenable condition intrinsic are modelled via
InaccessibleMemOnly, and there is no way to say that it isn't
really writing any memory. This patch teaches MemoryWriteTracking
ignore this intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354021 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTeach isGuaranteedToTransferExecutionToSuccessor about widenable conditions
Max Kazantsev [Thu, 14 Feb 2019 11:10:21 +0000 (11:10 +0000)]
Teach isGuaranteedToTransferExecutionToSuccessor about widenable conditions

Widenable condition intrinsic is guaranteed to return value, notify
the isGuaranteedToTransferExecutionToSuccessor function about it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354020 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix an accidentally flipped pair of arguments, NFCI
Jeremy Morse [Thu, 14 Feb 2019 11:09:24 +0000 (11:09 +0000)]
Fix an accidentally flipped pair of arguments, NFCI

While rebasing a refactor in r353950 I accidentally swapped two function
arguments; one is SelectionDAGBuilders "current" DebugLoc, the other is the one
from the "current" debug intrinsic. They're probably always identical, but I
haven't proved that yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354019 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Ensure we update the correct flags in the peephole optimiser
David Green [Thu, 14 Feb 2019 11:09:24 +0000 (11:09 +0000)]
[ARM] Ensure we update the correct flags in the peephole optimiser

The Arm peephole optimiser code keeps track of both an MI and a SubAdd that can
be used to optimise away a CMP. In the rare case that both are found and not
ruled-out as valid, we could end up setting the flags on the wrong one.

Instead make sure we are using SubAdd if it exists, as it will be closer to the
CMP.

The testcase here is a little theoretical, with a dead def of cpsr. It should
hopefully show the point.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354018 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Support] Fix TempFile::discard to not leave behind temporary files
Andrew Ng [Thu, 14 Feb 2019 11:08:49 +0000 (11:08 +0000)]
[Support] Fix TempFile::discard to not leave behind temporary files

Moved the remove of the temporary file to after the close to avoid
remove failures caused by ETXTBSY errors.

This issue was seen when FileOutputBuffer falls back to an in memory
buffer due to the inability to mmap the on disk file. This occurred when
running LLD on an Ubuntu VM in VirtualBox on a Windows host attempting
to write the output to a VirtualBox shared folder.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354017 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC] Refactor LICM code for better readability
Max Kazantsev [Thu, 14 Feb 2019 09:04:12 +0000 (09:04 +0000)]
[NFC] Refactor LICM code for better readability

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354013 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj][test] Add all GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} bits
Fangrui Song [Thu, 14 Feb 2019 07:52:51 +0000 (07:52 +0000)]
[llvm-readobj][test] Add all GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} bits

And delete trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354011 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRelax test to check for a valid number instead of a specific number
Douglas Yung [Thu, 14 Feb 2019 04:11:09 +0000 (04:11 +0000)]
Relax test to check for a valid number instead of a specific number
to be like every other check in this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354007 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Make (f80 (sint_to_fp (i16))) use fistps/fisttps instead of fistpl/fisttpl...
Craig Topper [Thu, 14 Feb 2019 01:41:43 +0000 (01:41 +0000)]
[X86] Make (f80 (sint_to_fp (i16))) use fistps/fisttps instead of fistpl/fisttpl when SSE is enabled.

When SSE is enabled sint_to_fp with i16 is blindly promoted to i32, but that changes the behavior of f80 conversion.

Move the promotion to i16 to LowerFP_TO_INT so we can limit it based on the floating point type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354003 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[llvm-objdump] Allow short options without arguments to be grouped"
Matthew Voss [Thu, 14 Feb 2019 01:39:43 +0000 (01:39 +0000)]
Revert "[llvm-objdump] Allow short options without arguments to be grouped"

Reverted due to failures on the llvm-hexagon-elf.

This reverts commit 77e1f27476c89f65eeb496d131065177e6417f23.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354002 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objdump] Allow short options without arguments to be grouped
Matthew Voss [Thu, 14 Feb 2019 00:39:40 +0000 (00:39 +0000)]
[llvm-objdump] Allow short options without arguments to be grouped

Summary:

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

Reviewers: kristina, jhenderson, grimar, jakehehrlich, rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353998 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[globalisel][combine] Split existing rules into a match and apply step
Daniel Sanders [Thu, 14 Feb 2019 00:15:28 +0000 (00:15 +0000)]
[globalisel][combine] Split existing rules into a match and apply step

Summary:
The declarative tablegen definitions split rules into match and apply steps.
Prepare for that by doing the same in the C++ implementations. This aids
some of the migration effort while the tablegen version is incomplete.

Reviewers: bogner, volkan, aditya_nandakumar, paquette, aemerson

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, Petar.Avramovic, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353996 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-ar][libObject] Fix relative paths when nesting thin archives.
Jordan Rupprecht [Wed, 13 Feb 2019 23:39:41 +0000 (23:39 +0000)]
[llvm-ar][libObject] Fix relative paths when nesting thin archives.

Summary:
When adding one thin archive to another, we currently chop off the relative path to the flattened members. For instance, when adding `foo/child.a` (which contains `x.txt`) to `parent.a`, when flattening it we should add it as `foo/x.txt` (which exists) instead of `x.txt` (which does not exist).

As a note, this also undoes the `IsNew` parameter of handling relative paths in r288280. The unit test there still passes.

This was reported as part of testing the kernel build with llvm-ar: https://patchwork.kernel.org/patch/10767545/ (see the second point).

Reviewers: mstorsjo, pcc, ruiu, davide, david2050, inglorion

Reviewed By: ruiu

Subscribers: void, jdoerfert, tpimh, mgorny, hans, nickdesaulniers, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353995 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PowerPC][NFC] Added tests for prologue and epilogue code gen.
Stefan Pintilie [Wed, 13 Feb 2019 23:37:23 +0000 (23:37 +0000)]
[PowerPC][NFC] Added tests for prologue and epilogue code gen.

Added four test files to check the existing behaviour of prologue
and epilogue code generation. This patch was done as a setup for
the upcoming patch listed on Phabricator that will change how the
prologue and epilogue work.
The upcoming patch is: https://reviews.llvm.org/D42590

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353994 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ConstProp] add IR tests to show miscompiles; NFC
Sanjay Patel [Wed, 13 Feb 2019 23:27:31 +0000 (23:27 +0000)]
[ConstProp] add IR tests to show miscompiles; NFC

A fix for these is proposed in D51216.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353992 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj] Dump GNU_PROPERTY_X86_ISA_1_{NEEDED,USED} notes in .note.gnu.property
Fangrui Song [Wed, 13 Feb 2019 23:18:05 +0000 (23:18 +0000)]
[llvm-readobj] Dump GNU_PROPERTY_X86_ISA_1_{NEEDED,USED} notes in .note.gnu.property

Reviewers: grimar, rupprecht

Reviewed By: rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353991 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Inline a single use helper function, and remove last non-MMO interface...
Philip Reames [Wed, 13 Feb 2019 23:01:11 +0000 (23:01 +0000)]
[SelectionDAG] Inline a single use helper function, and remove last non-MMO interface [NFC]

For D57601, we need to know whether the instruction is volatile.  We'd either have to pass yet another parameter, or just standardize on the MMO interface.  I chose the second.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353989 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[RegAllocGreedy] Take last chance recoloring into account in evicting.
Mark Lacey [Wed, 13 Feb 2019 22:56:43 +0000 (22:56 +0000)]
[RegAllocGreedy] Take last chance recoloring into account in evicting.

Last chance recoloring inserts into FixedRegisters those virtual
registers it is attempting to assign a physical register to.

We must consider these when we consider candidates for eviction so that
we do not end up evicting something while we are attempting to recolor
to assign it.

This is hitting in an out-of-tree target and no longer reproduces on
trunk. That does not appear to be a result of it having been fixed, but
rather, it appears that optimization changes and/or other changes to
register allocation mask the problem.

I haven't found a way to come up with a reasonable test case for this
(i.e. one that I can actually commit to open source, is reasonable
in size, and actually reproduces the issue).

rdar://problem/45708741

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353988 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AVR] Fix a typo - 's/analisys/analysis'
Dylan McKay [Wed, 13 Feb 2019 22:31:37 +0000 (22:31 +0000)]
[AVR] Fix a typo - 's/analisys/analysis'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353987 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] memory.fill
Thomas Lively [Wed, 13 Feb 2019 22:25:18 +0000 (22:25 +0000)]
[WebAssembly] memory.fill

Summary:
memset lowering, fix argument types in memcpy lowering, and
test encodings. Depends on D57736.

Reviewers: aheejin

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353986 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NewPM] Second attempt at porting ASan
Leonard Chan [Wed, 13 Feb 2019 22:22:48 +0000 (22:22 +0000)]
[NewPM] Second attempt at porting ASan

This is the second attempt to port ASan to new PM after D52739. This takes the
initialization requried by ASan from the Module by moving it into a separate
class with it's own analysis that the new PM ASan can use.

Changes:
- Split AddressSanitizer into 2 passes: 1 for the instrumentation on the
  function, and 1 for the pass itself which creates an instance of the first
  during it's run. The same is done for AddressSanitizerModule.
- Add new PM AddressSanitizer and AddressSanitizerModule.
- Add legacy and new PM analyses for reading data needed to initialize ASan with.
- Removed DominatorTree dependency from ASan since it was unused.
- Move GlobalsMetadata and ShadowMapping out of anonymous namespace since the
  new PM analysis holds these 2 classes and will need to expose them.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353985 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Bulk memory intrinsics and builtins
Thomas Lively [Wed, 13 Feb 2019 22:11:16 +0000 (22:11 +0000)]
[WebAssembly] Bulk memory intrinsics and builtins

Summary:
implements llvm intrinsics and clang intrinsics for
memory.init and data.drop.

Reviewers: aheejin

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

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353983 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r353962
Serge Guelton [Wed, 13 Feb 2019 22:11:09 +0000 (22:11 +0000)]
Revert r353962

Specialization of Optional for trivially copyable types yields failure on the buildbots I fail to reproduce locally.
Better safe than sorry, reverting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353982 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r353957.
Peter Collingbourne [Wed, 13 Feb 2019 21:03:23 +0000 (21:03 +0000)]
gn build: Merge r353957.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353980 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SelectionDAG] Kill last uses of getAtomic w/o a MMO operand [NFC]
Philip Reames [Wed, 13 Feb 2019 20:42:59 +0000 (20:42 +0000)]
[SelectionDAG] Kill last uses of getAtomic w/o a MMO operand [NFC]

The helper function was used by only two callers, and largely ended up providing distinct functionality based on optional arguments and opcode.  Inline and simply to make the functionality much more clear.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353977 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add 'mpx' to getHostCPUFeatures.
Craig Topper [Wed, 13 Feb 2019 20:12:41 +0000 (20:12 +0000)]
[X86] Add 'mpx' to getHostCPUFeatures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353974 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[CodeExtractor] Only lift lifetime markers present in the extraction region
Vedant Kumar [Wed, 13 Feb 2019 19:53:38 +0000 (19:53 +0000)]
[CodeExtractor] Only lift lifetime markers present in the extraction region

When CodeExtractor finds liftime markers referencing inputs to the
extraction region, it lifts these markers out of the region and inserts
them around the call to the extracted function (see r350420, PR39671).

However, it should *only* lift lifetime markers that are actually
present in the extraction region. I.e., if a start marker is present in
the extraction region but a corresponding end marker isn't (or vice
versa), only the start marker (or end marker, resp.) should be lifted.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353973 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] More unordered atomic lowering tests
Philip Reames [Wed, 13 Feb 2019 19:49:17 +0000 (19:49 +0000)]
[Tests] More unordered atomic lowering tests

This time, focused around narrowing and widening transformations.  Also, include a few simple memory optimization tests to highlight missed oppurtunities.  This is part of building up the test base for D57601.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353972 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] RMW folding tests w/unordered atomic operations
Philip Reames [Wed, 13 Feb 2019 18:41:54 +0000 (18:41 +0000)]
[Tests] RMW folding tests w/unordered atomic operations

We get a suprising number of these today actually, but some are missed. The main point of this is strengthen the test set for D57601.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353966 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Tests] Add a bunch of tests for load folding w/unordered atomics
Philip Reames [Wed, 13 Feb 2019 18:26:01 +0000 (18:26 +0000)]
[Tests] Add a bunch of tests for load folding w/unordered atomics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353964 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add 'fxsr' to the getHostCPUFeatures detection code.
Craig Topper [Wed, 13 Feb 2019 18:21:36 +0000 (18:21 +0000)]
[X86] Add 'fxsr' to the getHostCPUFeatures detection code.

We implicitly mark this feature as enabled when the target is 64-bits, but our detection code for -march=native didn't support it so you can't detect it on 32-bit targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353963 91177308-0d34-0410-b5e6-96231b3b80d8