OSDN Git Service

android-x86/external-llvm.git
5 years ago[NFC] Fix name and clarifying comment for factored-out function
Max Kazantsev [Sun, 17 Feb 2019 15:22:48 +0000 (15:22 +0000)]
[NFC] Fix name and clarifying comment for factored-out function

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

5 years ago[InstCombine] add tests for unsigned saturated add; NFC
Sanjay Patel [Sun, 17 Feb 2019 15:09:41 +0000 (15:09 +0000)]
[InstCombine] add tests for unsigned saturated add; NFC

We're missing IR canonicalizations for this op as shown in D51929.

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

5 years ago[NFC] Factor out a function for future reuse
Max Kazantsev [Sun, 17 Feb 2019 15:04:09 +0000 (15:04 +0000)]
[NFC] Factor out a function for future reuse

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

5 years agoRevert [NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Sun, 17 Feb 2019 14:59:21 +0000 (14:59 +0000)]
Revert  [NFC] Better encapsulation of llvm::Optional Storage

I'm getting the feealing that current Optional implementation is full of UB :-/

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

5 years ago[NFC] Better encapsulation of llvm::Optional Storage
Serge Guelton [Sun, 17 Feb 2019 13:12:42 +0000 (13:12 +0000)]
[NFC] Better encapsulation of llvm::Optional Storage

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

5 years ago[LLVMSupport]: Remove a severely outdated README.
Kristina Brooks [Sun, 17 Feb 2019 01:52:18 +0000 (01:52 +0000)]
[LLVMSupport]: Remove a severely outdated README.

The LLVM Support library implementation has resided in
//llvm/lib/Support for a significant amount of time now,
with documentation having been updated with all references
to the "System library" being replaced with "Support library".

Since this file mirrors already existing documentation available
for Support library, includes dead links to documentation and
still refers to it as "System library", having it there is
confusing and updating it has very little point as it duplicates
information in documentation, except documentation is a lot more
up to date while this file has not been maintained.

Up to date documentation concerning this can be found here:
  http://llvm.org/docs/SupportLibrary.html

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

5 years ago[bindings/go] Fix building on 32-bit systems (ARM etc.)
whitequark [Sat, 16 Feb 2019 22:33:10 +0000 (22:33 +0000)]
[bindings/go] Fix building on 32-bit systems (ARM etc.)

Summary:
The patch in https://reviews.llvm.org/D53883 (by me) fails to build on 32-bit systems like ARM. Fix the array size to be less ridiculously large. 2<<20 should still be enough for all practical purposes.

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

Reviewers: whitequark, pcc

Reviewed By: whitequark

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

Tags: #llvm

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

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

5 years agoFixed code snippet in Kaleidoscope tutorial to reflect final full code listing
Wilfred Hughes [Sat, 16 Feb 2019 18:37:55 +0000 (18:37 +0000)]
Fixed code snippet in Kaleidoscope tutorial to reflect final full code listing

Patch by Frank He.

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

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

5 years agoFix typo in docs
Dmitri Gribenko [Sat, 16 Feb 2019 14:51:44 +0000 (14:51 +0000)]
Fix typo in docs

Patch by Alex Yursha.

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

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

5 years agoRevert r354199: Make Optional<T> Trivially Copyable when T is trivially copyable
Serge Guelton [Sat, 16 Feb 2019 09:47:23 +0000 (09:47 +0000)]
Revert r354199: Make Optional<T> Trivially Copyable when T is trivially copyable

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

5 years agoMake Optional<T> Trivially Copyable when T is trivially copyable
Serge Guelton [Sat, 16 Feb 2019 09:19:58 +0000 (09:19 +0000)]
Make Optional<T> Trivially Copyable when T is trivially copyable

This is another attempt in the process, works nicely on my setup,
let's check how it behaves on other targets.

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

5 years ago[X86] When type legalizing the result of a i64 fp_to_uint on 32-bit targets. Generate...
Craig Topper [Sat, 16 Feb 2019 08:25:42 +0000 (08:25 +0000)]
[X86] When type legalizing the result of a i64 fp_to_uint on 32-bit targets. Generate all of the ops as i64 and let them be legalized.

No need to manually split everything. We can let the type legalizer work for us.

The test change seems to be caused by some DAG ordering issue that was previously circumventing a one use check in LowerSELECT where FP selects are turned into blends if the setcc has one use. But it was running after an integer select and the same setcc had been legalized to cmov and X86SISD::CMP. This dropped the use count of the setcc, but wasn't what was intended.

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

5 years agollvm-nm: Observe -no-llvm-bc for archive members
Dave Lee [Sat, 16 Feb 2019 06:59:49 +0000 (06:59 +0000)]
llvm-nm: Observe -no-llvm-bc for archive members

Summary:
This change fixes the `-no-llvm-bc` flag to work with object files within
archives. Currently the `-no-llvm-bc` flag works for regular object files, but
not static libraries, where it continues to show bitcode symbol info.

Original support was added in D4371.

Reviewers: compnerd, smeenai, pcc

Reviewed By: compnerd

Subscribers: rupprecht, keith, llvm-commits

Tags: #llvm

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

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

5 years ago[CMake] Use variables rather than ":" delimiters
Petr Hosek [Sat, 16 Feb 2019 03:57:35 +0000 (03:57 +0000)]
[CMake] Use variables rather than ":" delimiters

This is a follow up to D37644, this block was missed in that change.

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

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

5 years ago[X86] Don't prevent load folding for cvtsi2ss/cvtsi2sd based on hasPartialRegUpdate.
Craig Topper [Sat, 16 Feb 2019 03:34:54 +0000 (03:34 +0000)]
[X86] Don't prevent load folding for cvtsi2ss/cvtsi2sd based on hasPartialRegUpdate.

Preventing the load fold won't fix the partial register update since the
input we can fold is a GPR. So it will do nothing to prevent a false dependency
on an XMM register.

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

5 years ago[lit] Remove LitTestCase
Julian Lettner [Sat, 16 Feb 2019 00:44:00 +0000 (00:44 +0000)]
[lit] Remove LitTestCase

From the docs: `class LitTestCase(unittest.TestCase)`
LitTestCase is an adaptor for providing a 'unittest' compatible
interface to 'lit' tests so that we can run lit tests with standard
python test runners.

It does not seem to be used anywhere.

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

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

5 years ago[lit][NFC] Cleanup lit worker process handling
Julian Lettner [Sat, 16 Feb 2019 00:40:40 +0000 (00:40 +0000)]
[lit][NFC] Cleanup lit worker process handling

Move code that is executed on worker process to separate file. This
makes the use of the pickled arguments stored in global variables in the
worker a bit clearer. (Still not pretty though.)

Extract handling of parallelism groups to it's own function.

Use BoundedSemaphore instead of Semaphore. BoundedSemaphore raises for
unmatched release() calls.

Cleanup imports.

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

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

5 years ago[EarlyCSE & MSSA] Cap the clobbering calls in EarlyCSE.
Alina Sbirlea [Fri, 15 Feb 2019 22:47:54 +0000 (22:47 +0000)]
[EarlyCSE & MSSA] Cap the clobbering calls in EarlyCSE.

Summary:
Unlimitted number of calls to getClobberingAccess can lead to high
compile times in pathological cases.
Limitting getClobberingAccess to a fairly high number. Can be adjusted
based on users/need.
Note: this is the only user of MemorySSA currently enabled by default.
The same handling exists in LICM (disabled atm). As MemorySSA gains more
users, this logic of capping will need to move inside MemorySSA.

Reviewers: george.burgess.iv

Subscribers: llvm-commits

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

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

5 years ago[X86] Don't set exception mask bits when modifying FPCW to change rounding mode for...
Craig Topper [Fri, 15 Feb 2019 21:59:33 +0000 (21:59 +0000)]
[X86] Don't set exception mask bits when modifying FPCW to change rounding mode for fp->int conversion

When we need to do an fp->int conversion using x87 instructions, we need to temporarily change the rounding mode to 0b11 and perform a store. To do this we save the old value of the fpcw to the stack, then set the fpcw to 0xc7f, do the store, then restore fpcw. But the 0xc7f value forces the exception mask bits 1. While this is what they would be in the default FP environment, as we move to support changing the FP environments, we shouldn't make this assumption.

This patch changes the code to explicitly OR 0xc00 with the old value so that only the rounding mode is changed. Unfortunately, this requires two stack temporaries instead of one. One to hold the old value and one to hold the new value. Without two stack temporaries we would need an additional GPR. We already need one to do the OR operation in. This is similar to what gcc and icc do for this operation. Though they are both better at reusing the stack temporaries when there are multiple truncates in a function(or at least in a basic block)

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

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

5 years ago[InstCombine] Address a couple stylistic issues pointed out by reviewer [NFC]
Philip Reames [Fri, 15 Feb 2019 21:31:39 +0000 (21:31 +0000)]
[InstCombine] Address a couple stylistic issues pointed out by reviewer [NFC]

Better addressing comments from https://reviews.llvm.org/D58290.

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

5 years ago[InstCombine] Convert atomicrmws to xchg or store where legal
Philip Reames [Fri, 15 Feb 2019 21:23:51 +0000 (21:23 +0000)]
[InstCombine] Convert atomicrmws to xchg or store where legal

Implement two more transforms of atomicrmw:
1) We can convert an atomicrmw which produces a known value in memory into an xchg instead.
2) We can convert an atomicrmw xchg w/o users into a store for some orderings.

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

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

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