87216 Commits

Author SHA1 Message Date
Nicolai Haehnle
ac2300f5ed AMDGPU: Release the scavenged offset register during VGPR spill
Summary:
This fixes a crash where subsequent spills would be unable to scavenge
a register. In particular, it fixes a crash in piglit's
spec@glsl-1.50@execution@geometry@max-input-components (the test still
has a shader that fails to compile because of too many SGPR spills, but
at least it doesn't crash any more).

This is a candidate for the release branch.

Reviewers: arsenm, tstellarAMD

Subscribers: qcolombet, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:13:58 +00:00
Sanjay Patel
76f5f56312 [x86] refactor masked load/store combine logic ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 20:02:45 +00:00
Derek Schuff
d239e9c2e5 [WebAssembly] Switch varags calling convention to use a register
Instead of passing varargs directly on the user stack, allocate a buffer in
the caller's stack frame and pass a pointer to it. This simplifies the C
ABI (e.g. non-C callers of C functions do not need to use C's user stack if
they have their own mechanism) and allows further optimizations in the future
(e.g. fewer functions may need to use the stack).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260421 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:51:04 +00:00
Chad Rosier
43fe5fc136 [AArch64] Refactor is logic into a helper function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:45:48 +00:00
Teresa Johnson
bc947a0d8d Revert "[ThinLTO] Use MD5 hash in function index." due to bot failure
This reverts commit r260408. Bot failure that I need to investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 19:11:15 +00:00
Teresa Johnson
f38049c501 [ThinLTO] Use MD5 hash in function index.
Summary:
This patch uses the lower 64-bits of the MD5 hash of a function name as
a GUID in the function index, instead of storing function names. Any
local functions are first given a global name by prepending the original
source file name. This is the same naming scheme and GUID used by PGO in
the indexed profile format.

This change has a couple of benefits. The primary benefit is size
reduction in the combined index file, for example 483.xalancbmk's
combined index file was reduced by around 70%. It should also result in
memory savings for the index file in memory, as the in-memory map is
also indexed by the hash instead of the string.

Second, this enables integration with indirect call promotion, since the
indirect call profile targets are recorded using the same global naming
convention and hash. This will enable the function importer to easily
locate function summaries for indirect call profile targets to enable
their import and subsequent promotion.

The original source file name is recorded in the bitcode in a new
module-level record for use in the ThinLTO backend pipeline.

Reviewers: davidxl, joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:57:54 +00:00
Chad Rosier
0b08398212 [AArch64] Update comment to match reality. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260406 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:49:28 +00:00
Colin LeMahieu
89dcdff198 [MC] Merge VK_PPC_TPREL in to generic VK_TPREL.
Differential Revision: http://reviews.llvm.org/D17038

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260401 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:32:01 +00:00
Rong Xu
7a71e16708 [PGO] Indirect-call profile annotation in IR level profiling
This patch reads the indirect-call value records in the profile and makes the
annotation in the indirect-call instruction. This is for IR level profile
instrumentation.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260400 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:24:45 +00:00
Matt Arsenault
41d5fe81a2 AMDGPU: Fix indentation and variable names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260399 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:21:45 +00:00
Matt Arsenault
e6640ee461 AMDGPU: Split R600 and SI load lowering
These weren't actually sharing anything in the common
LowerLOAD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260398 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:21:39 +00:00
Teresa Johnson
c6f574dfd7 [ThinLTO] Move global processing from Linker to TransformUtils (NFC)
Summary:
As discussed on IRC, move the ThinLTOGlobalProcessing code out of
the linker, and into TransformUtils. The name of the class is changed
to FunctionImportGlobalProcessing.

Reviewers: joker.eph, rafael

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260395 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:11:31 +00:00
James Y Knight
c7f8b27879 [SPARC] Repair floating-point condition encodings in assembly parser.
The encodings for floating point conditions A(lways) and N(ever) were
incorrectly specified for the assembly parser, per Sparc manual v8 page
121. This change corrects that mistake.

Also, strangely, all of the branch instructions already had MC test
cases, except for the broken ones. Added the tests.

Patch by Chris Dewhurst

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:47:20 +00:00
Daniel Berlin
a70447cea6 Rename a member variable to be more accurate with how it is used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:41:25 +00:00
Daniel Berlin
ff47e0a2ba Constify two functions, make them accessible to unit tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260387 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:39:43 +00:00
Rong Xu
c7d7fb02f4 [PGO] Differentiate Clang instrumentation and IR level instrumentation profiles
This patch uses one bit in profile version to differentiate Clang
instrumentation and IR level instrumentation profiles.

PGOInstrumenation generates a COMDAT variable __llvm_profile_raw_version so
that the compiler runtime can set the right profile kind.
For Maco-O platform, we generate the variable as linkonce_odr linkage as
COMDAT is not supported.

PGOInstrumenation now checks this bit to make sure it's an IR level
instrumentation profile.

The patch was submitted as r260164 but reverted due to a Darwin test breakage.
Original Differential Revision: http://reviews.llvm.org/D15540

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 17:18:30 +00:00
Chad Rosier
d013f79f46 [AArch64] This bit of logic is specific to pairing. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 15:52:46 +00:00
Teresa Johnson
c82666acc5 Fix VST_CODE_* bitcode id comments (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 15:02:51 +00:00
Andrey Turetskiy
69a6a1d018 [X86] Fix stack alignment for MCU target, by Anton Nadolskiy.
This patch fixes stack alignments for MCU (should be aligned to 4 bytes).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260375 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 11:57:06 +00:00
Dylan McKay
bcdf24772f [AVR] Add instruction definitions
Summary: Add the AVR instruction tablegen definitions.

Reviewers: stoklund, hfinkel, dsanders, arsenm, vkalintiris

Subscribers: dylanmckay, agnat, rjordans, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 08:55:23 +00:00
JF Bastien
fd0c395b22 X86: Remove useless semicolon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260359 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 04:04:12 +00:00
Tom Stellard
8983a17ea2 StructurizeCFG: Initialize SkipUniformRegions in the default constructor
This should fix some random bot failures caused by r260336.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 01:10:09 +00:00
Lang Hames
db7e3d1e5c [Orc] Add lazy-JITting support for i386.
This patch adds a new class, OrcI386, which contains the hooks needed to
support lazy-JITing on i386 (currently only for Pentium 2 or above, as the JIT
re-entry code uses the FXSAVE/FXRSTOR instructions).

Support for i386 is enabled in the LLI lazy JIT and the Orc C API, and
regression and unit tests are enabled for this architecture.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 01:02:33 +00:00
Tom Stellard
7c9f178cf7 StructurizeCFG: Add an option for skipping regions with only uniform branches
Summary:
Tests for this will be added once the AMDGPU backend enables this
option.

Reviewers: arsenm

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 00:39:37 +00:00
Amaury Sechet
b711faf7b3 Add support for struct in C API test
Summary: As per title. This also include extra support for insertvalue and extracvalue.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260335 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 00:38:50 +00:00
Amaury Sechet
6f6b35477f Add binding for counting argument and find called value of call and invoke instruction from the C API.
Summary: As per title. This remove the need to rely on internal knowledge of call and invoke instruction to find called value and argument count.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260332 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 00:09:37 +00:00
Sanjay Patel
70cbdcc9e5 [x86] convert masked load of exactly one element to scalar load
This is the load counterpart to the store optimization that was added in:
http://reviews.llvm.org/rL260145



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 23:44:35 +00:00
Justin Lebar
c4f6eb8e3b Add convergent-removing bits to FunctionAttrs pass.
Summary:
Remove the convergent attribute on any functions which provably do not
contain or invoke any convergent functions.

After this change, we'll be able to modify clang to conservatively add
'convergent' to all functions when compiling CUDA.

Reviewers:  jingyue, joker.eph

Subscribers: llvm-commits, tra, jhen, hfinkel, resistor, chandlerc, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 23:03:22 +00:00
Peter Collingbourne
4162134c71 Fix GCC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 23:01:38 +00:00
Ahmed Bougacha
3248c624fa [CodeGen] Prefer "if (SDValue R = ...)" to "if (R.getNode())". NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 22:54:12 +00:00
Ahmed Bougacha
55579b6f90 [X86] Don't reuse an unrelated variable, create a new one. NFC.
Using Op makes it look like we're doing something with it.
We're really not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 22:54:05 +00:00
Ahmed Bougacha
4910e4e046 [X86] Remove unnecessary assignment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 22:53:58 +00:00
Amaury Sechet
a92e5eb421 Add C binding for AllocaInst::getAllocatedType
Summary:
Comes with an awesome test.

Depends on D16912

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 22:50:53 +00:00
Peter Collingbourne
40cd497a24 WholeProgramDevirt: introduce.
This pass implements whole program optimization of virtual calls in cases
where we know (via bitset information) that the list of callees is fixed. This
includes the following:

- Single implementation devirtualization: if a virtual call has a single
  possible callee, replace all calls with a direct call to that callee.

- Virtual constant propagation: if the virtual function's return type is an
  integer <=64 bits and all possible callees are readnone, for each class and
  each list of constant arguments: evaluate the function, store the return
  value alongside the virtual table, and rewrite each virtual call as a load
  from the virtual table.

- Uniform return value optimization: if the conditions for virtual constant
  propagation hold and each function returns the same constant value, replace
  each virtual call with that constant.

- Unique return value optimization for i1 return values: if the conditions
  for virtual constant propagation hold and a single vtable's function
  returns 0, or a single vtable's function returns 1, replace each virtual
  call with a comparison of the vptr against that vtable's address.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 22:50:34 +00:00
Amaury Sechet
0999758bcf Improve the C API echo test tool to emit basic block is the right order.
Summary: As per title. Also add a facility method to get the name of a basic block from the C API.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 22:36:41 +00:00
Simon Atanasyan
fff6db5983 [mips] Extend MipsAsmParser class to handle %got(sym + const) expressions
Now the parser supports `%got(sym)` expressions only but `%got(sym + const)`
variant is also valid and accepted by GAS.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260305 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 22:31:49 +00:00
Sanjoy Das
e27b451510 [MemoryBuiltins] Fix an issue with hasNoAliasAttr
Summary:
`hasNoAliasAttr` is buggy: it checks to see if the called function has
a `noalias` attribute, which is incorrect since functions are not even
allowed to have the `noalias` attribute.  The comment on its only
caller, `llvm::isNoAliasFn`, makes it pretty clear that the intention
to do the `noalias` check on the return value, and not the callee.

Unfortunately I couldn't find a way to test this upstream -- fixing
this does not change the observable behavior of any of the passes that
use this.  This is not very surprising, since `noalias` does not tell
anything about the contents of the allocated memory (so, e.g., you
still cannot fold loads).  I'll be happy to be proven wrong though.

Reviewers: chandlerc, reames

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 21:54:18 +00:00
Philip Reames
6d94591fc9 [Verifier] Add checks for masked.load and masked.store intrinsics
While trying to track down what appears to be a LoopVectorizer bug, I noticed that we had no validation of the correctness of calls emitted to @llvm.masked.load and @llvm.masked.store.  This meant malformed IR was showing up much much later than it should.  Hopefully, having Verifier rules in place will make this easier to isolate.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 21:43:12 +00:00
Sanjay Patel
068c0ce5f1 [SelectionDAG] make getMemBasePlusOffset() accessible; NFCI
I reinvented this functionality in http://reviews.llvm.org/D16828 because it was
hidden away as a static function. The changes in x86 are not based on a complete
audit. I suspect there are other possible uses there, and there are almost certainly
more potential users in other targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260295 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 21:42:04 +00:00
Chad Rosier
3b3e0dc608 [AArch64] This check is specific to merging instructions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 21:20:12 +00:00
Philip Reames
ffcd478bb1 [InstCombine][GC] Handle gc.relocations of vector type
We introduced gc.relocates of vector-of-pointer types a couple of weeks back.  Somehow, I missed updating the InstCombine rule to account for this.  If we hit this code path with a vector-of-pointers gc.relocate, we'd crash on a cast<PointerType>.

I also took the chance to do a bit of code style cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 21:09:22 +00:00
Geoff Berry
d3a670dcad [AArch64] AArch64LoadStoreOptimizer: fix bug in pre-inc check iterator
Summary:
Fix case where a pre-inc/dec load/store would not be formed if the
add/sub that forms the inc/dec part of the operation was the first
instruction in the block being examined.

Reviewers: mcrosier, jmolloy, t.p.northover, junbuml

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 20:47:21 +00:00
Chad Rosier
a9adb28214 [AArch64] Bail even earlier if the instructions modifieds the base register. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 20:44:41 +00:00
Chad Rosier
ea51072695 [AArch64] Simplify. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 20:27:45 +00:00
Chad Rosier
466cf9cf32 [AArch64] Add an assert to ensure we don't scale an offset that can't be scaled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 20:18:07 +00:00
Chad Rosier
452287c5a0 [AArch64] Add a FIXME about invalid KILL markers after the ld/st opt pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 19:42:19 +00:00
Ehsan Akhgari
a20946b352 llvm-config: Add preliminary Windows support
Summary:
This patch adds Windows support for a few of the llvm-config commands,
including cflags, ldflags, libs, and system-libs.

Currently llvm-config is untested, so this patch adds tests for the
commands that it fixes as well.

Reviewers: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 19:41:14 +00:00
Chad Rosier
41dc0a6d10 [AArch64] Remove redundant calls and clang format. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 19:33:42 +00:00
Colin LeMahieu
4ea9b605fc [Hexagon] Fixing relocation generation and adding tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 19:18:02 +00:00
Colin LeMahieu
3f9e772b2c [MC] Adding GOTREL expression variant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 19:17:34 +00:00