138150 Commits

Author SHA1 Message Date
Peter Collingbourne
5420de3f15 DebugInfo: New metadata representation for global variables.
This patch reverses the edge from DIGlobalVariable to GlobalVariable.
This will allow us to more easily preserve debug info metadata when
manipulating global variables.

Fixes PR30362. A program for upgrading test cases is attached to that
bug.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 01:12:59 +00:00
Michael Kuperstein
8d684cae12 [DAG] Refactor BUILD_VECTOR combine to make it easier to extend. NFCI.
This should make it easier to add cases that we currently don't cover,
like supporting more kinds of type mismatches and more than 2 input vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 00:57:43 +00:00
Hans Wennborg
45564d960b X86: Conditional tail calls should not have isBarrier = 1
That confuses e.g. machine basic block placement, which then doesn't
realize that control can fall through a block that ends with a conditional
tail call. Instead, isBranch=1 should be set.

Also, mark EFLAGS as used by these instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 00:21:32 +00:00
Eric Christopher
f016a03393 Temporarily Revert "[MC] Defer asm errors to post-statement failure" as it's causing errors on the sanitizer bots.
This reverts commit r281249.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 00:19:29 +00:00
Adam Nemet
29e20b96d3 [OptDiag] Add getHotness accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 23:46:34 +00:00
Philip Reames
3551718895 [LVI] Complete the abstract of the cache layer [NFCI]
Convert the previous introduced is-a relationship between the LVICache and LVIImple clases into a has-a relationship and hide all the implementation details of the cache from the lazy query layer.

The only slightly concerning change here is removing the addition of a queried block into the SeenBlock set in LVIImpl::getBlockValue.  As far as I can tell, this was effectively dead code.  I think it *used* to be the case that getCachedValueInfo wasn't const and might end up inserting elements in the cache during lookup.  That's no longer true and hasn't been for a while.  I did fixup the const usage to make that more obvious.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 22:38:44 +00:00
Sanjay Patel
0df9c0a9b5 add more tests for PR30273
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 22:28:29 +00:00
Lang Hames
d87460fb31 [ORC] Clang-format RPCSerialization.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 22:05:14 +00:00
Lang Hames
0f4402773f [ORC] Add some more documentation to RPCSerialization.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 22:05:12 +00:00
Philip Reames
ac22fbed43 [LVI] Sink a couple more cache manipulation routines into the cache itself [NFCI]
The only interesting bit here is the refactor of the handle callback and even that's pretty straight-forward.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 22:03:36 +00:00
Philip Reames
8efea574b6 [LVI] Abstract out the actual cache logic [NFCI]
Seperate the caching logic from the implementation of the lazy analysis.  For the moment, the lazy analysis impl has a is-a relationship with the cache; this will change to a has-a relationship shortly.  This was done as two steps merely to keep the changes simple and the diff understandable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 21:46:58 +00:00
Nico Weber
eebb0bcce0 Revert r281215, it caused PR30358.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 21:40:50 +00:00
Nico Weber
6e9445ddf8 attempt to unbreak build after r281254
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 21:15:44 +00:00
Lang Hames
08170c3c1c [ORC] Add missing <thread> header to RPCSerialization.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 20:45:01 +00:00
Lang Hames
b57c915405 [ORC] Replace the serialize/deserialize function pair with a SerializationTraits
class.

SerializationTraits provides serialize and deserialize methods corresponding to
the earlier functions, but also provides a name for the type. In future, this
name will be used to render function signatures as strings, which will in turn
be used to negotiate and verify API support between RPC clients and servers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 20:34:41 +00:00
Dehao Chen
77ad09277a Fix the bug introduced in r281252.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281253 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 20:29:54 +00:00
Dehao Chen
8c8aa02da6 Lower consecutive select instructions correctly.
Summary: If consecutive select instructions are lowered separately in CGP, it will introduce redundant condition check and branches that cannot be removed by later optimization phases. This patch lowers all consecutive select instructions at the same to to avoid inefficent code as demonstrated in https://llvm.org/bugs/show_bug.cgi?id=29095

Reviewers: davidxl

Subscribers: vsk, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 20:23:28 +00:00
Nirav Dave
a50fabab60 [MC] Defer asm errors to post-statement failure
Allow errors to be deferred and emitted as part of clean up to simplify
and shorten Assembly parser code. This will allow error messages to be
emitted in helper functions and be modified by the caller which has
better context.

As part of this many minor cleanups to the Parser:

* Unify parser cleanup on error
* Add Workaround for incorrect return values in ParseDirective instances
* Tighten checks on error-signifying return values for parser functions
  and fix in-tree TargetParsers to be more consistent with the changes.
* Fix AArch64 test cases checking for spurious error messages that are
  now fixed.

These changes should be backwards compatible with current Target Parsers
so long as the error status are correctly returned in appropriate
functions.

Reviewers: rnk, majnemer

Subscribers: aemerson, jyknight, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 20:03:02 +00:00
Sanjay Patel
06b5f13936 [InstCombine] add test for PR30327
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 19:50:08 +00:00
Sanjay Patel
6979660cda [InstCombine] regenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 19:29:26 +00:00
Elena Demikhovsky
1f6cc3cfe9 AVX-512: Added a test for -O0 mode. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 19:03:21 +00:00
Elena Demikhovsky
291712591e AVX-512: Simplified masked_gather_scatter test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 18:50:47 +00:00
Hemant Kulkarni
f4ef2f71ee Fix test failure in r281232
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 17:40:10 +00:00
Lang Hames
c12323739a [MCJIT] Fix some inconsistent handling of name mangling inside MCJIT.
This patch moves symbol mangling from findSymbol to getSymbolAddress. The
findSymbol, findExistingSymbol and findModuleForSymbol methods now always take
a mangled name, allowing the 'demangle-and-retry' cruft to be removed from
findSymbol. See http://llvm.org/PR28699 for details.

Patch by James Holderness. Thanks very much James!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 17:19:24 +00:00
Hemant Kulkarni
7ee831747c llvm-size: Add --totals option
Differential Revision: https://reviews.llvm.org/D24308

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 17:08:28 +00:00
Hemant Kulkarni
11981cd22e llvm-objdump: Add --start-address and --stop-address options
Differential Revision: https://reviews.llvm.org/D24160

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 17:08:22 +00:00
Sanjay Patel
bb4b1d9adf [InstCombine] use m_APInt to allow icmp X, C folds for splat constant vectors
isSignBitCheck could be changed to take a pointer param to avoid the 'UnusedBit' ugliness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 16:25:41 +00:00
Nicolai Haehnle
01a133c760 AMDGPU: Do not clobber SCC in SIWholeQuadMode
Reviewers: arsenm, tstellarAMD, mareko

Subscribers: arsenm, llvm-commits, kzhuravl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 16:25:20 +00:00
Ahmed Bougacha
ce3adfd9b4 [GlobalISel] Fix mismatched "<..)" in intrinsic MO printing. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281229 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 16:21:49 +00:00
James Molloy
0aa0c7d910 Revert "[ARM] Promote small global constants to constant pools"
This reverts commit r281213. It made a bot go bang: http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/14625

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 16:18:23 +00:00
Ahmed Bougacha
59a2759391 [BranchFolding] Unique added live-ins after hoisting code.
We're not supposed to have duplicate live-ins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 16:05:31 +00:00
Ahmed Bougacha
8faa07b28d [X86] Copy imp-uses when folding tailcall into conditional branch.
r280832 added 32-bit support for emitting conditional tail-calls, but
dropped imp-used parameter registers.  This went unnoticed until
r281113, which added 64-bit support, as this is only exposed with
parameter passing via registers.

Don't drop the imp-used parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 16:05:27 +00:00
David Majnemer
5db0b906e8 [FunctionAttrs] Don't try to infer returned if it is already on an argument
Trying to infer the 'returned' attribute if an argument is already
'returned' can lead to verification failure: inference might determine
that a different argument is passed through which would result in two
different arguments marked as 'returned'.

This fixes PR30350.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281221 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 16:04:59 +00:00
Sanjay Patel
7e05343232 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281220 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 15:52:28 +00:00
Sanjay Patel
3e9ba2b6c4 [InstCombine] add tests to show missing vector folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281219 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 15:51:42 +00:00
Igor Breger
97c0650440 add select i1 test, reproduser pr30249.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281218 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 15:27:02 +00:00
Sanjay Patel
29b1dcd7fc [InstCombine] add helper function for foldICmpUsingKnownBits; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 15:24:31 +00:00
Sam Kolton
724e56734b [AMDGPU] Assembler: Move disabled SDWA and DPP instruction into Disable asm variant
Summary: This removes disabled instructions from match tables so we will not match them at all.

Reviewers: tstellarAMD, vpykhtin, artem.tamazov

Subscribers: wdng, nhaehnle, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 14:42:43 +00:00
James Molloy
91db09d0e8 [Thumb] Teach ISel how to lower compares of AND bitmasks efficiently
For the common pattern (CMPZ (AND x, #bitmask), #0), we can do some more efficient instruction selection if the bitmask is one consecutive sequence of set bits (32 - clz(bm) - ctz(bm) == popcount(bm)).

1) If the bitmask touches the LSB, then we can remove all the upper bits and set the flags by doing one LSLS.
2) If the bitmask touches the MSB, then we can remove all the lower bits and set the flags with one LSRS.
3) If the bitmask has popcount == 1 (only one set bit), we can shift that bit into the sign bit with one LSLS and change the condition query from NE/EQ to MI/PL (we could also implement this by shifting into the carry bit and branching on BCC/BCS).
4) Otherwise, we can emit a sequence of LSLS+LSRS to remove the upper and lower zero bits of the mask.

1-3 require only one 16-bit instruction and can elide the CMP. 4 requires two 16-bit instructions but can elide the CMP and doesn't require materializing a complex immediate, so is also a win.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 14:30:48 +00:00
Sanjay Patel
c04a5a1fc4 fix formatting/typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 14:25:46 +00:00
James Molloy
30cc1de5a7 [ARM] Promote small global constants to constant pools
If a constant is unamed_addr and is only used within one function, we can save
on the code size and runtime cost of an indirection by changing the global's storage
to inside the constant pool. For example, instead of:

      ldr r0, .CPI0
      bl printf
      bx lr
    .CPI0: &format_string
    format_string: .asciz "hello, world!\n"

We can emit:

      adr r0, .CPI0
      bl printf
      bx lr
    .CPI0: .asciz "hello, world!\n"

This can cause significant code size savings when many small strings are used in one
function (4 bytes per string).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 13:42:16 +00:00
Chad Rosier
0c54a0640f [LoopInterchange] Improve debug output. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281212 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 13:24:47 +00:00
Pablo Barrio
ccaa95d2c6 Fix the Thumb test for vfloat intrinsics
Summary:
This test was not testing the intrinsics. A function like this:

define %v4f32 @test_v4f32.floor(%v4f32 %a){
...
        %1 = call %v4f32 @llvm.floor.v4f32(%v4f32 %a)
...
}

is transformed into the following assembly:

_test_v4f32.floor:              @ @test_v4f32.floor
...
        bl _floorf
...

In each function tested, there are two CHECK: one that checked
for the label and another one for the intrinsic that should be used
inside the function (in our case, "floor"). However, although the
first CHECK was matching the label, the second was not matching the
intrinsic, but the second "floor" in the same line as the label.

This is fixed by making the first CHECK match the entire line.

Reviewers: jmolloy, rengolin

Subscribers: rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 13:14:14 +00:00
Rafael Espindola
9c7d316ce3 Define a dummy zlib::uncompress when zlib is not available.
Should fix link errors in some bots when it is used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281208 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 13:00:51 +00:00
Tim Northover
5d592ae6b2 GlobalISel: support translation of global addresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281207 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 12:10:41 +00:00
Tim Northover
39f340dd0f GlobalISel: translate GEP instructions.
Unlike SDag, we use a separate G_GEP instruction (much simplified, only taking
a single byte offset) to preserve the pointer type information through
selection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281205 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 11:20:22 +00:00
Tim Northover
7a92e735b6 GlobalISel: disambiguate types when printing MIR
Some generic instructions have multiple types. While in theory these always be
discovered by inspecting the single definition of each generic vreg, in
practice those definitions won't always be local and traipsing through a big
function to find them will not be fun.

So this changes MIRPrinter to print out the type of uses as well as defs, if
they're known to be different or not known to be the same.

On the parsing side, we're a little more flexible: provided each register is
given a type in at least one place it's mentioned (and all types are
consistent) we accept the MIR. This doesn't introduce ambiguity but makes
writing tests manually a bit less painful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 11:20:10 +00:00
Eric Liu
217343a63a Fix WebAssembly broken build related to interface change in r281172.
Reviewers: bkramer

Subscribers: jfb, llvm-commits, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 09:35:59 +00:00
Elena Demikhovsky
d186dd43ad AVX-512: Added a test case that should be optimized in the future. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 06:26:03 +00:00
NAKAMURA Takumi
56e56fbc57 llvm/test/CodeGen/AMDGPU/infinite-loop-evergreen.ll REQUIRES +Asserts.
This might not *crash* with -Asserts. I saw it caused infinite loop in the codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12 04:27:28 +00:00