Commit Graph

130456 Commits

Author SHA1 Message Date
Mandeep Singh Grang
2599294457 [LLVM] Remove unwanted --check-prefix=CHECK from unit tests. NFC.
Summary: Removed unwanted --check-prefix=CHECK from numerous unit tests.

Reviewers: t.p.northover, dblaikie, uweigand, MatzeB, tstellarAMD, mcrosier

Subscribers: mcrosier, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 23:51:52 +00:00
Marcin Koscielnicki
d78071238e [Mips] [MSan] VarArgMIPS64Helper: Use target's endian, not host's.
Ugh.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 23:46:59 +00:00
Kostya Serebryany
50620d6de4 [libFuzzer] more trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 22:37:44 +00:00
Tim Northover
8dffe5b866 ARM: fix assertion failure on -O0 cmpxchg.
Because lowering of CMP_SWAP_64 occurs during type legalization, there can be
i64 types produced by more than just a BUILD_PAIR or similar. My initial tests
used just incoming function args.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 22:25:02 +00:00
Nicolai Haehnle
318d6a2351 Add IntrWrite[Arg]Mem intrinsic property
Summary:
This property is used to mark an intrinsic that only writes to memory, but
neither reads from memory nor has other side effects.

An example where this is useful is the llvm.amdgcn.buffer.store.format.*
intrinsic, which corresponds to a store instruction that goes through a special
buffer descriptor rather than through a plain pointer.

With this property, the intrinsic should still be handled as having side
effects at the LLVM IR level, but machine scheduling can make smarter
decisions.

Reviewers: tstellarAMD, arsenm, joker.eph, reames

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 21:58:33 +00:00
Nicolai Haehnle
fea41fb59c AMDGPU: Guard VOPC instructions against incorrect commute
Summary:
The added testcase, which triggered this, was derived from a shader-db case
via bugpoint. A separate question is why scalar branching wasn't used.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 21:58:22 +00:00
Nicolai Haehnle
4b52862009 AMDGPU/SI: SGPR accounting in getSIProgramInfo must ignore exec_lo/hi
Summary:
A shader stored the live mask (initial exec mask) in an SGPR which was then
spilled during register allocation. The allocator quite reasonably
optimized turned the spill into

  v_writelane_b32 %vgpr, exec_lo, N
  v_writelane_b32 %vgpr, exec_hi, N+1

at the beginning of the shader, confusing the SGPR accounting.

No test case, because si-sgpr-spill.ll together with an upcoming patch for
WQM handling exhibits the problem.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 21:58:17 +00:00
Nicolai Haehnle
39980d6882 [TableGen] Make an error message slightly more informative
Reviewers: ab, spop, stoklund

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 21:58:10 +00:00
Vedant Kumar
4db32f4f46 Remove duplicated header contents, NFC
It looks like InstrProfiling.h was the victim of a bad merge. The header
guards in the file prevented the build from blowing up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 21:55:14 +00:00
Krzysztof Parzyszek
414bb96c93 [Hexagon] Fix operand swapping in HexagonPeephole
Also, disable zero- and size-extend optimizations for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 21:36:24 +00:00
Marcin Koscielnicki
9ebfa4db3c [AArch64] [ARM] Make a target-independent llvm.thread.pointer intrinsic.
Both AArch64 and ARM support llvm.<arch>.thread.pointer intrinsics that
just return the thread pointer.  I have a pending patch that does the same
for SystemZ (D19054), and there are many more targets that could benefit
from one.

This patch merges the ARM and AArch64 intrinsics into a single target
independent one that will also be used by subsequent targets.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 20:51:05 +00:00
Lang Hames
11f1b9399b [Orc] Add move ops for OrcRemoteTargetClient and OrcRemoteTargetServer to
appease MSVC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 20:22:50 +00:00
Krzysztof Parzyszek
2d715342de [Hexagon] Fix printing the address operand of S2_storerinewabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 20:20:33 +00:00
Tim Shen
ac94d4bd34 [PPC, SSP] Support PowerPC Linux stack protection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 20:14:52 +00:00
Tim Shen
e7221e673c [SSP, 2/2] Create llvm.stackguard() intrinsic and lower it to LOAD_STACK_GUARD
With this change, ideally IR pass can always generate llvm.stackguard
call to get the stack guard; but for now there are still IR form stack
guard customizations around (see getIRStackGuard()). Future SSP
customization should go through LOAD_STACK_GUARD.

There is a behavior change: stack guard values are not CSEed anymore,
since we should never reuse the value in case that it has been spilled (and
corrupted). See ssp-guard-spill.ll. This also cause the change of stack
size and codegen in X86 and AArch64 test cases.

Ideally we'd like to know if the guard created in llvm.stackprotector() gets
spilled or not. If the value is spilled, discard the value and reload
stack guard; otherwise reuse the value. This can be done by teaching
register allocator to know how to rematerialize LOAD_STACK_GUARD and
force a rematerialization (which seems hard), or check for spilling in
expandPostRAPseudo. It only makes sense when the stack guard is a global
variable, which requires more instructions to load. Anyway, this seems to go out
of the scope of the current patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 19:40:37 +00:00
Lang Hames
3993a484fe [Orc] Add explicit move ops to OrcRemoteTargetRPCAPI for MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 19:35:16 +00:00
Lang Hames
1f32c5f299 [Orc] Fix missing return in RPC move assignment operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 19:34:46 +00:00
Jacques Pienaar
5ea3f527c8 [lanai] Add lowering for SETCCE i32.
* Add lowering for SETCCE i32.
* Add test to check lowering of i64 compares uses SETCCE expansion (outside of EQ and NE).
* Fix select.ll test and immediate form selection for RI operations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 19:15:25 +00:00
David Majnemer
7f0d15f9a5 [ValueTracking, VectorUtils] Refactor getIntrinsicIDForCall
The functionality contained within getIntrinsicIDForCall is two-fold: it
checks if a CallInst's callee is a vectorizable intrinsic.  If it isn't
an intrinsic, it attempts to map the call's target to a suitable
intrinsic.

Move the mapping functionality into getIntrinsicForCallSite and rename
getIntrinsicIDForCall to getVectorIntrinsicIDForCall while
reimplementing it in terms of getIntrinsicForCallSite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 19:10:21 +00:00
Sanjoy Das
13e21eb07d [X86] Simplify StackMapShadowTracker; NFC
- Elide trivial contructor and desctructor
 - Move implementation out of an unnecessary explicit llvm namespace
   scope

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 18:48:16 +00:00
Sanjoy Das
ffd20497ee [X86MCInstLower] Clean up EmitNops; NFC
Instead of having a conditional assert inside EmitNops, refactor so that
the caller can have the assert instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266793 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 18:48:13 +00:00
Krzysztof Parzyszek
1c960f5468 [Hexagon] Implement branch relaxation
Patch by Sirish Pande.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 18:30:18 +00:00
Duncan P. N. Exon Smith
d33fbe4f07 IR: Enable debug info type ODR uniquing for forward decls
Add a new method, DICompositeType::buildODRType, that will create or
mutate the DICompositeType for a given ODR identifier, and use it in
LLParser and BitcodeReader instead of DICompositeType::getODRType.

The logic is as follows:

  - If there's no node, create one with the given arguments.
  - Else, if the current node is a forward declaration and the new
    arguments would create a definition, mutate the node to match the
    new arguments.
  - Else, return the old node.

This adds a missing feature supported by the current DITypeIdentifierMap
(which I'm slowly making redudant).  The only remaining difference is
that the DITypeIdentifierMap has a "the-last-one-wins" rule, whereas
DICompositeType::buildODRType has a "the-first-one-wins" rule.

For now I'm leaving behind DICompositeType::getODRType since it has
obvious, low-level semantics that are convenient for unit testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 18:00:19 +00:00
David L Kreitzer
46f6a88948 Preliminary changes for fixing PR27241. Generalized/restructured some things
in preparation for enabling the outgoing parameter store-to-push optimization
for 64-bit targets.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 17:43:44 +00:00
Duncan P. N. Exon Smith
8fe60de98c Linker: Simplify test/Linker/dicompositetype-unique.ll, NFC
Simplify the test logic a little, sharing logic between the two linking
directions by specifying -check-prefix multiple times.  Now it's more
obvious what's hte same and different between the two directions, and
there is less CHECK duplication.  This is a prep for expanding the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 17:43:43 +00:00
Zachary Turner
67622ea1d0 [llvm-pdbdump] Print a better error message when PDB loading fails.
Differential Revision: http://reviews.llvm.org/D19234

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266772 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 17:36:58 +00:00
Lang Hames
80e5a5716b [Orc] Add move ops to RPC to satisfy MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 17:26:59 +00:00
Chad Rosier
2974be9d8b [ValueTracking] Improve isImpliedCondition for conditions with matching operands.
This patch improves SimplifyCFG to catch cases like:

  if (a < b) {
    if (a > b) <- known to be false
      unreachable;
  }

Phabricator Revision: http://reviews.llvm.org/D18905

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 17:19:14 +00:00
Lang Hames
18d3f58338 [Orc] Add pthread dependence to the RPCUtilsTest unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 17:13:52 +00:00
Duncan P. N. Exon Smith
d72293fc94 IR: LLVMContextTest => DebugTypeODRUniquingTest, NFC
The second test in this file is actually testing DICompositeType API,
not LLVMContext API (after r266742 moved it to a higher level).  This
really doesn't make sense in an LLVMContextTest.  Rename the tests
before adding more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 17:11:06 +00:00
Duncan P. N. Exon Smith
001edd0424 Linker: Avoid constructing ValueMap::MDMapT
Calling ValueMap::MD lazily constructs a ValueMap, which mallocs the
buckets.  Instead of swapping constructed maps, move around the
underlying Optional<MDMapT>.  This gets rid of some unnecessary malloc
traffic from r266579 (not that it showed up on a profile).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 16:57:24 +00:00
Brendon Cahoon
4455a132ce [DependenceAnalysis] Refactor uses of getConstantPart. NFC.
Rather than checking for the SCEV type prior to calling
getContantPart, perform the checks in the function. This reduces
the number of places where the checks are needed.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 16:46:57 +00:00
Mehdi Amini
12cc10fde1 Fix Gold test after r266750 (ModuleLinker: Do not import linkonce/weak as "external_weak")
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 16:21:37 +00:00
Duncan P. N. Exon Smith
64d3314d1a IR: Use Optional instead of unique_ptr for Metadata map in ValueMap, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 16:17:48 +00:00
Mehdi Amini
5c025fc0a6 ModuleLinker: Do not import linkonce/weak as "external_weak"
Summary:
There is no reason to have a weak reference because the external
definition will be weak.

Reviewers: rafael

Subscribers: llvm-commits, tejohnson

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 16:11:05 +00:00
Duncan P. N. Exon Smith
75cc051139 IR: Use Optional instead of unique_ptr for debug info ODR type map, NFC
Save a level of malloc indirection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266749 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 16:06:50 +00:00
Teresa Johnson
9507885b18 Enable ODR uniquing of DITypes in more places
Summary:
This is a follow-on to apply Duncan's new DIType ODR uniquing from
r266549 and r266713 in more places.

Enable enableDebugTypeODRUniquing() for ThinLTO backends invoked via
libLTO, similar to the way r266549 enabled this for ThinLTO backend
threads launched from gold-plugin.

Also enable enableDebugTypeODRUniquing in opt, similar to the way
r266549 enabled this for llvm-link (on by default, can be disabled with
new -disable-debug-info-type-map option), since we may perform ThinLTO
importing from opt.

Reviewers: dexonsmith, joker.eph

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 15:48:30 +00:00
Duncan P. N. Exon Smith
511eb032bb IR: getOrInsertODRUniquedType => DICompositeType::getODRType, NFC
Lift the API for debug info ODR type uniquing up a layer.  Instead of
clients managing the map directly on the LLVMContext, add a static
method to DICompositeType called getODRType and handle the map in the
background.  Also adds DICompositeType::getODRTypeIfExists, so far just
for convenience in the unit tests.

This simplifies the logic in LLParser and BitcodeReader.  Because of
argument spam there are actually a few more lines of code now; I'll see
if I come up with a reasonable way to clean that up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 14:55:09 +00:00
Duncan P. N. Exon Smith
ef55fa5ba5 IR: Require DICompositeType for ODR uniquing type map
Tighten up the API for debug info ODR type uniquing in LLVMContext.  The
only reason to allow other DIType subclasses is to make the unit tests
prettier :/.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 14:42:55 +00:00
Simon Pilgrim
ee5f5d934b [InstCombine][X86] Added extra tests introduced for D17490
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 12:59:52 +00:00
Simon Pilgrim
153162f4b6 [InstCombine][X86] Regenerate SSE combine tests as part of setup for D17490
Regenerated with utils/update_test_checks.py 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 12:56:46 +00:00
Simon Pilgrim
580e952c7e [X86][AVX2] Prefer VPERMQ/VPERMPD over VINSERTI128/VINSERTF128 for unary shuffles
Using VPERMQ/VPERMPD allows memory folding of the (repeated) input where VINSERTI128/VINSERTF128 can not.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266728 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 12:26:40 +00:00
Mehdi Amini
82f54f86a5 Minor improvement to debug output for Function Importer (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 09:21:30 +00:00
Sanjoy Das
a1ff4a6198 Add a description for the PatchableFunction pass; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266721 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 06:25:02 +00:00
Sanjoy Das
07f6d807bc Disable the PatchableFunction pass for NVPTX & Wasm
PatchableFunction requires AllVRegsAllocated that these targets don't
provide.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 06:24:58 +00:00
Daniel Berlin
4c8f9b3334 Correct IDF calculator for ReverseIDF
Summary:
Need to use predecessors for reverse graph, successors for forward graph.
succ_iterator/pred_iterator are not compatible, this patch is all the work necessary to work around that (which is what everywhere else does).  Not sure if there is a better way, so cc'ing some random folks to take a gander :)

Reviewers: dblaikie, qcolombet, echristo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 06:13:28 +00:00
Lang Hames
3bf6fb9d27 [Orc] Disable RPC callST unit test until the S390 failures encountered during
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/3459 can be
debugged/fixed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 06:01:51 +00:00
Sanjoy Das
151328540e Introduce a "patchable-function" function attribute
Summary:
The `"patchable-function"` attribute can be used by an LLVM client to
influence LLVM's code generation in ways that makes the generated code
easily patchable at runtime (for instance, to redirect control).
Right now only one patchability scheme is supported,
`"prologue-short-redirect"`, but this can be expanded in the future.

Reviewers: joker.eph, rnk, echristo, dberris

Subscribers: joker.eph, echristo, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 05:24:47 +00:00
Duncan P. N. Exon Smith
2663f35684 IR: Rename API for enabling ODR uniquing of DITypes, NFC
As per David's review, rename everything in the new API for ODR type
uniquing of debug info.

    ensureDITypeMap  => enableDebugTypeODRUniquing
    destroyDITypeMap => disableDebugTypeODRUniquing
    hasDITypeMap     => isODRUniquingDebugTypes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 04:55:25 +00:00
Lang Hames
4576e07c30 [ORC] Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 04:44:21 +00:00