147462 Commits

Author SHA1 Message Date
Matt Arsenault
bdbe8280f2 Add address space mangling to lifetime intrinsics
In preparation for allowing allocas to have non-0 addrspace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 20:18:21 +00:00
Reid Kleckner
a8b5a980c8 [IR] Make AttributeSetNode public, avoid temporary AttributeList copies
Summary:
AttributeList::get(Fn|Ret|Param)Attributes no longer creates a temporary
AttributeList just to hide the AttributeSetNode type.

I've also added a factory method to create AttributeLists from a
parallel array of AttributeSetNodes. I think this simplifies
construction of AttributeLists when rewriting function prototypes.
Previously we would test if a particular index had attributes, and
conditionally add a temporary attribute list to a vector. Now the
attribute set vector is parallel to the argument vector already that
these passes already construct.

My long term vision is to wrap AttributeSetNode* inside an AttributeSet
type that holds the enum attributes, but that will come in a follow up
change.

I haven't done any performance measurements for this change because
profiling hasn't shown that any of the affected code is hot.

Reviewers: pete, chandlerc, sanjoy, hfinkel

Reviewed By: pete

Subscribers: jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 20:18:10 +00:00
Reid Kleckner
df685624d0 Remove svn:eol-style properties from some files so 'git llvm push' works for them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 20:16:54 +00:00
Zachary Turner
c29751d1b4 Fix signed / unsigned comparison warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 20:01:50 +00:00
Simon Atanasyan
20b5e3ba0b [mips] Use Triple::isLittleEndian to check endianness. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 19:42:44 +00:00
Sanjay Patel
4ac99f71cc [InstCombine] improve variable names; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 19:38:36 +00:00
Craig Topper
a0e581d63e [InstSimplify] Use cast instead of dyn_cast after isa<> check. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 19:37:10 +00:00
Zachary Turner
e98c913509 [llvm-pdbdump] Display padding bytes on record layout
When dumping classes, show where padding occurs, and at the end of the
class print statistics about how many bytes total of padding exist in a
class.

Since PDB doesn't specifically contain information about padding, we have
to mimic this by sort of reversing a small portion of the record layout
algorithm (e.g. looking at offsets and sizes and trying to determine
whether something is part of the same field or a new field).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 19:33:29 +00:00
Matt Arsenault
9b5d7f6374 [MemCpyOpt] Only replace memcpy with bitcast if address spaces match
Patch by James Price

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299866 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 19:00:25 +00:00
Daniel Berlin
13d8288f8e MemorySSA: Make lifetime starts defs for mustaliased pointers
Summary:
While we don't want them aliasing with other pointers, there seems to
be no point in not having them clobber must-aliased'd pointers.

If some day, we split the aliasing and ordering chains, we'd make this
not aliasing but an ordering barrier (IE it doesn't affect it's
memory, but we can't hoist it above it).

Reviewers: hfinkel, george.burgess.iv

Subscribers: Prazek, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 18:46:00 +00:00
Matthew Simpson
42df88e1f8 [ARM/AArch64] Ensure valid vector element types for interleaved accesses
This patch refactors and strengthens the type checks performed for interleaved
accesses. The primary functional change is to ensure that the interleaved
accesses have valid element types. The added test cases previously failed
because the element type is f128.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 18:34:37 +00:00
Craig Topper
f4272d1c37 [InstCombine] Use commutable matchers and m_OneUse in visitSub to shorten code. Add missing test cases.
In one case I removed commute handling for a multiply with a constant since we'll eventually get the constant on the right hand side.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 18:09:25 +00:00
Matt Arsenault
40cf5b3d29 AMDGPU: Fix crash when disassembling VOP3 mac
The unused dummy src2_modifiers is missing, so it crashes
when trying to print it.

I tried to fully remove src2_modifiers, but there are some
irritations in the places where it is converted to mad since
it starts to require modifying use lists while iterating over
them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 17:58:06 +00:00
Zachary Turner
a360984c0b [Support] Add support for finding unset bits in a BitVector.
BitVector had methods for searching for the first and next
set bits, but it did not have analagous methods for finding
the first and next unset bits.  This is useful when your ones
and zeros are grouped together and you want to iterate over
ranges of ones and zeros.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 17:18:54 +00:00
Zachary Turner
d2f46ef6a6 Fix line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 17:17:11 +00:00
Zachary Turner
08a5893e91 Remove eol-style:native from BitVector.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 17:15:11 +00:00
Craig Topper
0a52d06b89 [InstCombine] Use m_c_Add to shorten some code. Add testcases for this fold since they were missing. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 16:59:40 +00:00
Simon Pilgrim
8b6100048e [X86][MMX] Add fast-isel support for MMX non-temporal writes
Differential Revision: https://reviews.llvm.org/D31754

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 16:58:07 +00:00
Sanjay Patel
ea87eb616e [InstCombine] fix matching of or-of-icmps constants (PR32524)
Also, make the same change in and-of-icmps and remove a hack for detecting that case.

Finally, add some FIXME comments because the code duplication here is awful.

This should fix the remaining IR problem noted in:
https://bugs.llvm.org/show_bug.cgi?id=32524



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 16:55:57 +00:00
Adrian McCarthy
95d726af97 Improves pretty printing of variable types in llvm-pdbdump
* Adds support for pointers to arrays, which was missing
* Adds some tests
* Improves consistency of const and volatile qualifiers
* Eliminates non-composable special case code for arrays and function by using
  a more general recursive approach
* Has a hack for getting the calling convention into the right spot for
  pointer-to-functions

Given the rapid changes happenning in llvm-pdbdump, this may be difficult to
merge.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 16:43:09 +00:00
Craig Topper
4ed87e3dc1 [InstCombine] Support folding of add instructions with vector constants into select operations
We currently only fold scalar add of constants into selects. This improves this to support vectors too.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 16:40:00 +00:00
Sanjay Patel
31ad416f00 [InstCombine] add test for PR32524; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299846 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 16:28:08 +00:00
Diana Picus
af6290684b [ARM] GlobalISel: Support G_FPOW for float and double
Legalize to a libcall.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299841 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 09:27:39 +00:00
Craig Topper
7bb46d8056 [InstCombine] Use commutable and/or/xor matchers to simplify some code
Summary:
This is my first time using the commutable matchers so wanted to make sure I was doing it right.

Are there any other matcher tricks to further shrink this? Can we commute the whole match so we don't have to LHS and RHS separately?

Reviewers: davide, spatel

Reviewed By: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 07:13:40 +00:00
Craig Topper
1fafa7b072 [SelectionDAG] TargetLowering::SimplifyDemandedBits how to properly calculate KnownZero bits for ISD::SETCC and ISD::AssertZExt
Summary:
For SETCC we aren't calculating the KnownZero bits at all. I've copied the code from computeKnownZero over for this.

For AssertZExt we were only setting KnownZero for bits that were demanded. But the upper bits are zero whether they were demanded or not.

I'm interested in fixing this because my belief is the first part of the ISD::AND handling code in SimplifyDemandedBits largely exists because of these two bugs. In that code we go to computeKnownBits for the LHS and optimize a RHS constant. Because computeKnownBits handles SETCC and AssertZExt correctly we get better information sometimes than when we call SimplifyDemandedBits on the LHS later. With these two issues fixed in SimplifyDemandedBits I was able to remove that computeKnownBits call and still pass all X86 tests. I'll submit that change in a separate patch.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 07:06:44 +00:00
Craig Topper
17e3b0ef51 [InstCombine] Make sure we preserve fast math flags when folding fp instructions into phi nodes
Summary: I noticed in the select folding code that we copied fast math flags, but did not do the same for the similar handling in phi nodes. This patch fixes that to do the same thing as select

Reviewers: spatel, davide, majnemer, hfinkel

Reviewed By: davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 07:00:10 +00:00
Craig Topper
dbe1448360 [InstCombine] use m_c_And and m_c_Xor to handle commuted versions of a transform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299837 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 06:53:28 +00:00
Craig Topper
d178fa97c3 [InstCombine] Add test cases demonstrating missing handling for the commuted version of a transform. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299836 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 06:53:25 +00:00
Craig Topper
9ed6500653 [InstCombine] Remove unnecessary dyn_cast to BinaryOperator around some matcher checks in visitXor.
The matchers themselves should be enough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299835 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 06:53:23 +00:00
Craig Topper
1a4cc6a638 [InstCombine] Make the (A|B)^B -> A & ~B transform code consistent with the very similar (A&B)^B -> ~A & B code. This should be NFC except for the addition of hasOneUse check.
I think this code is still overly complicated and should use matchers, but first I wanted to make it consistent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299834 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 06:53:21 +00:00
Craig Topper
60e8e12279 [InstCombine] Use m_OneUse to shorten some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299833 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 06:53:19 +00:00
Zachary Turner
4dbdbc7904 Remove unused method.
This is causing build breaks, but it's unused anyway, so delete
it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299832 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 06:30:28 +00:00
Zachary Turner
18fcab5833 General usability improvements to generic PDB library.
1. Added some asserts to make sure concrete symbol types don't
   get constructed with RawSymbols that have an incompatible
   SymTag enum value.
2. Added new forwarding macros that auto-define an Id/Sym method
   pair whenever there is a method that returns a SymIndexId.
   Previously we would just provide one method that returned only
   the SymIndexId and it was up to the caller to use the Session
   object to get a pointer to the symbol.  Now we automatically
   get both the method that returns the Id, as well as a method
   that returns the pointer directly with just one macro.
3. Added some methods for dumping straight to stdout that can
   be used from inside the debugger for diagnostics during a
   debug session.
4. Added a clone() method and a cast<T>() method to PDBSymbol
   that can shorten some usage patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 06:14:09 +00:00
Xin Tong
64aab18a2e [SCCP] Resolve indirect branch target when possible.
Summary:
Resolve indirect branch target when possible.
This potentially eliminates more basicblocks and result in better evaluation for phi and other things.

Reviewers: davide, efriedma, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 00:33:25 +00:00
Sanjay Patel
23f07450a2 [InstCombine] remove dead cases from icmp pair switches; NFCI
"PredicatesFoldable" returns false for signed/unsigned mismatched pairs,
so these cases should never exist. We'll default to 'unreachable' on those 
predicate combos instead.

Most of what's left in these switches belongs in InstSimplify (and may 
already be there), so there's probably more that can be done to reduce
this code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 21:51:34 +00:00
Sanjay Patel
e093a14cd1 [InstCombine] remove duplicate test; NFC
I moved this test to 'not.ll' in r299824 but accidentally added a copy here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299828 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 21:45:52 +00:00
Davide Italiano
619694e7af [Mem2Reg] Remove AliasSetTracker updating logic from the pass.
No caller has been passing it for a long time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299827 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 20:47:14 +00:00
Sanjay Patel
d0196ef8d2 [SimplifyCFG] auto-generate better checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299825 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 16:16:32 +00:00
Sanjay Patel
8009ba263a [InstCombine] auto-generate better checks; NFC
Also, move a test next to its sibling to eliminate a file with just one test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 15:44:59 +00:00
Hal Finkel
cfe441c874 [MemorySSA] Fix use of pointsToConstantMemory in isUseTriviallyOptimizableToLiveOnEntry
In isUseTriviallyOptimizableToLiveOnEntry, pointsToConstantMemory needs to be
called on the load's pointer operand, not on the result of the load (which
might not even be a pointer).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299823 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 12:57:50 +00:00
Craig Topper
239032f668 [InstCombine] Extend some OR combines to support vectors.
This adds support for these combines for vectors
(X^C)|Y -> (X|Y)^C iff Y&C == 0
Y|(X^C) -> (X|Y)^C iff Y&C == 0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 06:12:41 +00:00
Craig Topper
c5f68270ad [InstCombine] Extend a canonicalization check to apply to vector constants too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299821 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 06:12:39 +00:00
Craig Topper
35b55965c4 [InstCombine] Add test cases to show missing support for vectors in an OR combine. Also add the commuted versions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299820 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 06:12:36 +00:00
Craig Topper
6fd8f78410 [InstCombine] Use the SubOne helper function to shorten some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 06:12:34 +00:00
Craig Topper
d8e1379d72 [InstCombine] rename variable for easier reading; NFC
We usually give constants a 'C' somewhere in the name...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299818 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-09 06:12:31 +00:00
Peter Collingbourne
b06c394fe3 MC: Remove unused virtual function MCObjectWriter::isWeak. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-08 23:35:49 +00:00
Matt Arsenault
1ad9b2d946 AMDGPU: Actually write nops for writeNopData
Before this was just writing 0s, which ends up looking like a
v_cndmask_b32 v0, s0, v0, vcc. Write out an encoded s_nop instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-08 21:28:38 +00:00
Coby Tayree
b28be420c0 [AsmParser]Emit an error if a macro has two (or more) parameters sharing the same name
Introducing a new error to macro parameters' parsing:
currently, llvm-mc won't complain if a macro have two (or more) named params with the same name.
this behavior is false, as there's no merit in having some params sharing a name.
now, instead of tolerate such a phenomena - emit an appropriate error.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-08 20:29:03 +00:00
Mehdi Amini
0b9a8d8fd2 Reorganize libLTO C API header lto.h (NFC)
This just makes it easier to follow the Doxygen blocks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299814 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-08 19:20:30 +00:00
Craig Topper
0a13ad6637 [IR] Inline Type::getScalarType() by using isVectorTy() and getVectorElementType() that were already available inline.
Seems to have very little compiled code size impact. But might give a tiny performance boost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299811 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-08 05:47:09 +00:00