Commit Graph

136748 Commits

Author SHA1 Message Date
Yaxun Liu
93a7ad2603 AMDGPU: Update AMDGPURuntimeMetadata.h for enums of address space qualifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 16:54:25 +00:00
Matt Arsenault
8f1b18be38 AMDGPU: Don't fold subregister extracts into tied operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 16:18:36 +00:00
Reid Kleckner
515497059a Revert "[SimplifyCFG] Rewrite SinkThenElseCodeToEnd"
This reverts commit r278660.

It causes downstream assertion failure in InstCombine on shuffle
instructions. Comes up in __mm_swizzle_epi32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278672 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 15:42:31 +00:00
Valery Pykhtin
9364829511 [AMDGPU] fix failure on printing of non-existing instruction operands.
Differential revision: https://reviews.llvm.org/D23323

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 10:56:48 +00:00
Sjoerd Meijer
47a3de7f4d MachineLoop: add methods findLoopControlBlock and findLoopPreheader
This adds two new utility functions findLoopControlBlock and findLoopPreheader
to MachineLoop and MachineLoopInfo. These functions are refactored and taken
from the Hexagon target as they are target independent; thus this is intendend to
be a non-functional change.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278661 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 08:22:42 +00:00
James Molloy
7bc6001b57 [SimplifyCFG] Rewrite SinkThenElseCodeToEnd
The new version has several advantages:
  1) IMSHO it's more readable and neater
  2) It handles loads and stores properly
  3) It can handle any number of incoming blocks rather than just two. I'll be taking advantage of this in a followup patch.

With this change we can now finally sink load-modify-store idioms such as:

    if (a)
      return *b += 3;
    else
      return *b += 4;

    =>

    %z = load i32, i32* %y
    %.sink = select i1 %a, i32 5, i32 7
    %b = add i32 %z, %.sink
    store i32 %b, i32* %y
    ret i32 %b

When this works for switches it'll be even more powerful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278660 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 08:04:56 +00:00
Prakhar Bahuguna
91c19fbe6c [Thumb] Validate branch target for CBZ/CBNZ instructions.
Summary:
The assembler currently does not check the branch target for CBZ/CBNZ
instructions, which only permit branching forwards with a positive offset. This
adds validation for the branch target to ensure negative PC-relative offsets are
not encoded into the instruction, whether specified as a literal or as an
assembler symbol.

Reviewers: rengolin, t.p.northover

Subscribers: llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 07:57:44 +00:00
James Molloy
bd7c3fb3bf [LSR] Don't try and create post-inc expressions on non-rotated loops
If a loop is not rotated (for example when optimizing for size), the latch is not the backedge. If we promote an expression to post-inc form, we not only increase register pressure and add a COPY for that IV expression but for all IVs!

Motivating testcase:

    void f(float *a, float *b, float *c, int n) {
      while (n-- > 0)
        *c++ = *a++ + *b++;
    }

It's imperative that the pointer increments be located in the latch block and not the header block; if not, we cannot use post-increment loads and stores and we have to keep both the post-inc and pre-inc values around until the end of the latch which bloats register usage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 07:53:03 +00:00
Craig Topper
24088baa9d [X86] PADDUSB/W instructions should be commutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278654 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 06:31:57 +00:00
Craig Topper
d1a8c19b04 [X86] Mark some of the X86 SDNodes as commutative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278653 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 04:47:30 +00:00
Craig Topper
ed1f4b6522 [X86] X86ISD::FANDN is not commutative or associative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278652 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 04:47:28 +00:00
David Majnemer
937229d0bb [ScopedNoAliasAA] collectMDInDomain should be a free function
collectMDInDomain doesn't use any class members, making it a free
function is not a functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278651 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 03:56:06 +00:00
David Majnemer
24f7cd87f7 [ScopedNoAliasAA] Only collect noalias nodes if we have alias.scope nodes
No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278646 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 02:23:50 +00:00
David Majnemer
a7273755a8 [ScopedNoAliasAA] Replace !ScopeNodes.size() with ScopeNodes.empty()
No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278645 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 02:23:48 +00:00
David Majnemer
28873d7b25 Revert "[ScopedNoAliasAA] Remove an unneccesary set"
This reverts commit r278641.  I'm not sure why but this has upset the
multistage builders...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 02:23:46 +00:00
David Majnemer
6bd5c84e0b [ScopedNoAliasAA] Remove an unneccesary set
We are trying to prove that one group of operands is a subset of
another.  We did this by populating two Sets and determining that every
element within one was inside the other.

However, this is unnecessary.  We can simply construct a single set and
test if each operand is within it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278641 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15 00:13:04 +00:00
Sanjay Patel
b3d14d2afd [InstCombine] add test for missing vector icmp fold
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 22:56:46 +00:00
Sanjay Patel
93591d18ed [InstCombine] add tests for vector icmp folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278637 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 22:44:10 +00:00
Sanjay Patel
aafbbf8cdb [InstCombine] add test for potentially missing vector icmp fold
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 22:30:07 +00:00
Sanjay Patel
bc87c37f6b [InstCombine] add test for missing vector icmp fold
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278635 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 22:29:27 +00:00
Sanjay Patel
411c4dba0b [InstCombine] add tests for missing vector icmp folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278634 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 22:28:50 +00:00
Sanjay Patel
9e679db4f1 [InstCombine] remove unnecessary function attributes from tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 21:48:21 +00:00
Sanjay Patel
6eea5bde3c [InstCombine] add tests for missing vector icmp folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278632 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 21:36:22 +00:00
Sanjay Patel
4865e7bd91 [InstCombine] add test for missing vector icmp fold
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 21:05:08 +00:00
Sanjay Patel
3bf3ce9256 [InstCombine] add test for missing vector icmp fold
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 20:39:42 +00:00
Craig Topper
98df2b17a8 [AVX-512] Mark VPMADDWD as commutable to match SSE/AVX version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278629 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 17:57:22 +00:00
Craig Topper
8cbb186f8c [AVX-512] Add masked commutable floating point max/min instructions to folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278628 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 17:57:19 +00:00
Craig Topper
48894694d5 [AVX-512] Add masked logical operations to memory folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 17:57:16 +00:00
Igor Breger
1a3669b36e [AVX512] Fix VFPCLASSSD/VFPCLASSSS intrinsic lowering. The i1 result should be zero extended according to SPEC.
Differential Revision: http://reviews.llvm.org/D23489

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278626 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 13:58:57 +00:00
Igor Breger
96cefd6f44 autogenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 09:34:39 +00:00
Igor Breger
bf57b01543 [AVX512] Fix insertelement i1 lowering.
1. Use shuffle to insert element i1 into vector. The previous implementation was incorrect ( dest_bit OR src_bit , it doesn't clear the bit if src_bit=0 )
2. Improve shuffle i1 vector, use CVT2MASK if supported instead TRUNCATE.

Differential Revision: http://reviews.llvm.org/D23347

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278623 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 05:25:07 +00:00
Saleem Abdulrasool
5724bf57e1 Revert "gold: add a cast to appease std::max NFC"
This was fixed differently by Teresa and this should no longer be needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278622 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 05:07:20 +00:00
Diana Picus
12fc2327af Revert "CodeGen: If Convert blocks that would form a diamond when tail-merged."
This reverts commit r278287.

This commit broke the clang-cmake-thumbv7-a15-full-sh bot.
See https://llvm.org/bugs/show_bug.cgi?id=28949

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 02:10:18 +00:00
Diana Picus
281da4f483 Revert "Codegen: Don't tail-duplicate blocks with un-analyzable fallthrough."
This reverts commit r278288.

r278287 broke the clang-cmake-thumbv7-a15-full-sh bot.
Revert this so we can get to r278287.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278620 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 02:10:12 +00:00
Sanjoy Das
d330744e57 [IRCE] Change variable grouping; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 01:04:50 +00:00
Sanjoy Das
39b554559f [IRCE] Create llvm::Loop instances for cloned out loops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 01:04:46 +00:00
Sanjoy Das
300cd13205 [IRCE] Don't iterate on loops that were cloned out
IRCE has the ability to further version pre-loops and post-loops that it
created, but this isn't useful at all.  This change teaches IRCE to
leave behind some metadata in the loops it creates (by cloning the main
loop) so that these new loops are not re-processed by IRCE.

Today this bug is hidden by another bug -- IRCE does not update LoopInfo
properly so the loop pass manager does not re-invoke IRCE on the loops
it split out.  However, once the latter is fixed the bug addressed in
this change causes IRCE to infinite-loop in some cases (e.g. it splits
out a pre-loop, a pre-pre-loop from that, a pre-pre-pre-loop from that
and so on).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278617 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 01:04:36 +00:00
Sanjoy Das
abf7d54189 [IRCE] Add better DEBUG diagnostic; NFC
NFC meaning IRCE should not _do_ anything different, but
-debug-only=irce will be a little friendlier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278616 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 01:04:31 +00:00
Mehdi Amini
2c1c0b444f Fix bitcode auto-upgrade when using bitcode lazy loading
The auto-upgrade path could be called before the VST (global
names) was fully parsed, and thus intrinsic names were not
available and the autoupgrade logic could not operate.

Fix link failures with ThinLTO.

This is a recommit of r278610 with a different fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278615 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-14 00:01:27 +00:00
Ron Lieberman
26d2a23314 Fix unsupported relocation type R_HEX_6_X' for symbol .rodata
LowerTargetConstantPool is not properly setting the TargetFlag to indicate
desired relocation. Coding error, the offset parameter was omitted, so the
TargetFlag was used as the offset, and the TargetFlag defaulted to zero.

This only affects -fpic compilation, and only those items created in a
Constant Pool, for example a vector of constants. Halide ran into this issue.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278614 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:41:11 +00:00
Mehdi Amini
4510860b03 Revert "Fix bitcode auto-upgrade when using bitcode lazy loading"
This reverts commit r278610. Tests are broken

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278613 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:39:14 +00:00
Sanjoy Das
3e63425485 [IRCE] Fix test case; NFC
The (negative) test case is supposed to check that IRCE does not muck
with range checks it cannot handle, not that it does the right thing in
the absence of profiling information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:36:40 +00:00
Sanjoy Das
c56bea66ca [IRCE] Be resilient in the face of non-simplified loops
Loops containing `indirectbr` may not be in simplified form, even after
running LoopSimplify.  Reject then gracefully, instead of tripping an
assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278611 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:36:35 +00:00
Mehdi Amini
c5432bdac5 Fix bitcode auto-upgrade when using bitcode lazy loading
The auto-upgrade path could be called before the VST (global
names) was fully parsed, and thus intrinsic names were not
available and the autoupgrade logic could not operate.

Fix link failures with ThinLTO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:31:53 +00:00
Mehdi Amini
804c815e77 Revert "Revert "Invariant start/end intrinsics overloaded for address space""
This reverts commit 32fc6488e48eafc0ca1bac1bd9cbf0008224d530.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:31:24 +00:00
Mehdi Amini
2eb84a568a Revert "Invariant start/end intrinsics overloaded for address space"
This reverts commit r276447.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:27:32 +00:00
Sanjoy Das
d2e55b6a0a [IRCE] Use dyn_cast instead of explicit isa/cast; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278607 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 22:00:12 +00:00
Sanjoy Das
81232a9017 [IRCE] Use range-for; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278606 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 22:00:09 +00:00
Mehdi Amini
568382ff0e [ADT] Add a reserve() method to DenseSet as well as an insert() for R-value
Recommit 278600 with some fixes to make the test more robust.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 20:42:19 +00:00
Mehdi Amini
80f0510b4f Revert "[ADT] Add a reserve method to DenseSet as well as an insert() for R-value"
This reverts commit r278600. The unittest does not pass on MSVC, there is
an extra move. Investigating how to make it more robust.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278603 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 20:14:39 +00:00