Commit Graph

76804 Commits

Author SHA1 Message Date
Cameron Esfahani
d02540a1d7 Value soft float calls as more expensive in the inliner.
Summary: When evaluating floating point instructions in the inliner, ask the TTI whether it is an expensive operation.  By default, it's not an expensive operation.  This keeps the default behavior the same as before.  The ARM TTI has been updated to return back TCC_Expensive for targets which don't have hardware floating point.

Reviewers: chandlerc, echristo

Reviewed By: echristo

Subscribers: t.p.northover, aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228263 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 02:09:33 +00:00
Reid Kleckner
6d3ceb23c7 Try to fix the build in MCValue.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228256 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 01:23:14 +00:00
Sean Silva
bd59cd48d5 Fixup.
Didn't see these calls in my release build locally when testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228254 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 01:13:47 +00:00
Sean Silva
a875e3d4d6 [MC] Remove various unused MCAsmInfo parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 00:58:51 +00:00
Duncan P. N. Exon Smith
09b44e9be7 IR: Rename 'operator ==()' to 'isKeyOf()', NFC
`isKeyOf()` is a clearer name than overloading `operator==()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228242 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 00:51:35 +00:00
Colin LeMahieu
91568ff3aa [Hexagon] Deleting unused instructions and adding isCodeGenOnly to some defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 00:10:16 +00:00
Colin LeMahieu
69a33e427e [Hexagon] Updating load extend to i64 patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228237 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 23:55:16 +00:00
Kostya Serebryany
5d85a10810 [fuzzer] add flag prefer_small_during_initial_shuffle, be a bit more verbose
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228235 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 23:42:42 +00:00
Colin LeMahieu
2747f4aaf5 [Hexagon] Cleaning up i1 load and extension patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228232 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 23:27:48 +00:00
Colin LeMahieu
083cc71ab3 [Hexagon] Simplifying more load and store patterns and using new addressing patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228231 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 23:23:16 +00:00
Tom Stellard
26bfda9dd3 R600/SI: Enable subreg liveness by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228228 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 23:14:18 +00:00
Colin LeMahieu
18c8166405 [Hexagon] Simplifying some load and store patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228227 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 23:10:21 +00:00
Duncan P. N. Exon Smith
783e0e4b23 AsmParser: Split out LineField, NFC
Split out `LineField`, which restricts the legal line numbers.  This
will make it easier to be consistent between different node parsers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228226 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:59:18 +00:00
Colin LeMahieu
82bc37ed90 [Hexagon] Converting absolute-address load patterns to use AddrGP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228225 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:54:51 +00:00
Colin LeMahieu
0f9cf365b2 [Hexagon] Converting atomic store/load to use AddrGP addressing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228223 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:40:36 +00:00
Colin LeMahieu
243f011835 [Hexagon] Simplifying some store patterns. Adding AddrGP addressing forms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228220 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:36:28 +00:00
Kostya Serebryany
46c638cfc8 [fuzzer] add -runs=N to limit the number of runs per session. Also, make sure we do some mutations w/o cross over.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228214 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:20:09 +00:00
Duncan P. N. Exon Smith
8054a41a27 Fix GCC error caused by r228211
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228213 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:13:28 +00:00
Duncan P. N. Exon Smith
890324873f IR: Reduce boilerplate in DenseMapInfo overrides, NFC
Minimize the boilerplate required for the `MDNode` subclass
`DenseMapInfo<>` overrides in `LLVMContextImpl`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228212 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:08:30 +00:00
Duncan P. N. Exon Smith
89aee384c1 AsmParser: Move MDField details to source file, NFC
Move all the types of `MDField` to an anonymous namespace in the source
file.  This also eliminates the duplication of `ParseMDField()`
declarations in the header for each new field type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228211 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:05:21 +00:00
Duncan P. N. Exon Smith
99dc945c08 AsmParser: Simplify assertion, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228209 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:02:18 +00:00
Duncan P. N. Exon Smith
7ec73f04a8 AsmParser: Remove dead code, NFC
This condition is checked in the generic `ParseMDField()`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 22:00:59 +00:00
Duncan P. N. Exon Smith
321b43e7cc AsmParser: Simplify MDUnsignedField
We only need `uint64_t` for storage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228205 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 21:57:52 +00:00
Duncan P. N. Exon Smith
ab47b42e26 IR: Initialize MDNode abbreviations en masse, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 21:54:12 +00:00
Duncan P. N. Exon Smith
a196629a7c IR: Define MDNode uniquing sets automatically, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228200 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 21:46:12 +00:00
Rafael Espindola
e247dd2839 Don' try to make sections in comdats SHF_MERGE.
Parts of llvm were not expecting it and we wouldn't print
the entity size of the section.

Given what comdats are used for, having SHF_MERGE sections would be
just a small improvement, so just disable it for now.

Fixes pr22463.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228196 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 21:27:24 +00:00
Tom Stellard
89c96b1cd0 R600/SI: Expand misaligned 16-bit memory accesses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 20:49:52 +00:00
Tom Stellard
fd4c349de2 R600/SI: Make more store operations legal
v2i32, i32, trunc i32 to i16, and truc i32 to i8 stores are legal for
all address spaces.  We had marked them as custom in order to lower
them for the private address space, but this is no longer necessary.

This enables lowering of misaligned stores of these types in the
DAGLegalizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228189 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 20:49:51 +00:00
Tom Stellard
056a34916a R600: Don't promote i64 stores to v2i32 during DAG legalization
We take care of this during instruction selection now.  This
fixes a potential infinite loop when lowering misaligned stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228188 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 20:49:49 +00:00
Tom Stellard
f22ee14444 StructurizeCFG: Remove obsolete fix for loop backedge detection
This is no longer needed now that we are using a reverse post-order
traversal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 20:49:47 +00:00
Tom Stellard
7c038bc15f StructurizeCFG: Use a reverse post-order traversal
We were previously doing a post-order traversal and operating on the
list in reverse, however this would occasionaly cause backedges for
loops to be visited before some of the other blocks in the loop.

We know use a reverse post-order traversal, which avoids this issue.

The reverse post-order traversal is not completely ideal, so we need
to manually fixup the list to ensure that inner loop backedges are
visited before outer loop backedges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 20:49:44 +00:00
Colin LeMahieu
1d75b286e6 [Hexagon] Adding selection for GlobalAddress and converting [z/i]ext load patterns to make use of them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 20:38:01 +00:00
Duncan P. N. Exon Smith
a7a6be22eb Utils: Resolve cycles under distinct MDNodes
Track unresolved nodes under distinct `MDNode`s during `MapMetadata()`,
and resolve them at the end.  Previously, these cycles wouldn't get
resolved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 19:44:34 +00:00
Matthias Braun
a602c10686 MachineCSE: Clear dead-def flag on CSE.
In case CSE reuses a previoulsy unused register the dead-def flag has to
be cleared on the def operand, as exposed by the arm64-cse.ll test.

This fixes PR22439 and the corresponding rdar://19694987

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228178 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 19:35:16 +00:00
Reid Kleckner
7724d08fc6 Add range adapters predecessors() and successors() for BBs
Use them in two isolated transforms so we know they work and aren't dead
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228173 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 19:14:57 +00:00
Kostya Serebryany
eb884daa38 [fuzzer] make multi-process execution more verbose; fix mutation to actually respect mutation depth and to never produce empty units
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 19:10:20 +00:00
Colin LeMahieu
70e83e3a1c [Hexagon] Replacing some load patterns with cleaner versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 19:05:32 +00:00
Michael Kuperstein
8f260e3084 Fixes a bug in vector load legalization that confused bits and bytes.
Differential Revision: http://reviews.llvm.org/D7400

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 18:54:01 +00:00
Colin LeMahieu
b4ed3d0bd3 [Hexagon] Adding missing isCodeGenOnly = 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 18:11:32 +00:00
Colin LeMahieu
47d6e4d009 [Hexagon] Adding encoding information for absolute-reg mode stores. Xfailing a test until constant extenders are correctly put in the same packet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228158 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 17:52:06 +00:00
Alexey Samsonov
282314741d SpecialCaseList: Add support for parsing multiple input files.
Summary:
This change allows users to create SpecialCaseList objects from
multiple local files. This is needed to implement a proper support
for -fsanitize-blacklist flag (allow users to specify multiple blacklists,
in addition to default blacklist, see PR22431).

DFSan can also benefit from this change, as DFSan instrumentation pass now
accepts ABI-lists both from -fsanitize-blacklist= and -mllvm -dfsan-abilist flags.

Go bindings are fixed accordingly.

Test Plan: regression test suite

Reviewers: pcc

Subscribers: llvm-commits, axw, kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228155 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 17:39:48 +00:00
Colin LeMahieu
3d82dfa13b [Hexagon] Adding encoding information for absolute-set stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228154 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 17:24:04 +00:00
Colin LeMahieu
872b471e3f [Hexagon] Adding encoding bits for indirect long load instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228152 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 16:56:46 +00:00
Bradley Smith
960ce2aafa [ARM] Fix subtarget feature set truncation when using .cpu directive
This is a bug that was caused due to storing the feature bitset in a 32-bit
variable when it is a 64-bit mask, discarding the top half of the feature set.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 16:23:24 +00:00
Zoran Jovanovic
8dc0ae6606 [mips][microMIPS] Implement CodeGen support for SW16 and LW16 instructions
Differential Revision: http://reviews.llvm.org/D6581


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 15:43:17 +00:00
Daniel Sanders
372730d7ee [mips] Make MipsSubtarget::hasMips*() functions consistent. NFC.
Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228147 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 15:18:11 +00:00
Aaron Ballman
e818df583c Fixing a -Wsign-compare warning; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 14:01:08 +00:00
Renato Golin
0966a4e370 Adding support to LLVM for targeting Cortex-A72
Currently, Cortex-A72 is modelled as an Cortex-A57 except the fp
load balancing pass isn't enabled for Cortex-A72 as it's not
profitable to have it enabled for this core.

Patch by Ranjeet Singh.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228140 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 13:31:29 +00:00
Chandler Carruth
b0589710cc [x86] Give movss and movsd execution domains in the x86 backend.
This associates movss and movsd with the packed single and packed double
execution domains (resp.). While this is largely cosmetic, as we now
don't have weird ping-pong-ing between single and double precision, it
is also useful because it avoids the domain fixing algorithm from seeing
domain breaks that don't actually exist. It will also be much more
important if we have an execution domain default other than packed
single, as that would cause us to mix movss and movsd with integer
vector code on a regular basis, a very bad mixture.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228135 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 10:58:53 +00:00
Renato Golin
ff01f89466 Reverting VLD1/VST1 base-updating/post-incrementing combining
This reverts patches 223862, 224198, 224203, and 224754, which were all
related to the vector load/store combining and were reverted/reaplied
a few times due to the same alignment problems we're seeing now.

Further tests, mainly self-hosting Clang, will be needed to reapply this
patch in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228129 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 10:11:59 +00:00
Chandler Carruth
da681cc578 [x86] Start to introduce bit-masking based blend lowering.
This is the simplest form of bit-math based blending which only fires
when we are blending with zero and is relatively profitable. I've only
enabled this path on very specific lowering strategies. I'm planning to
widen its applicability in subsequent patches, but so far you'll notice
that even though we get fewer shufps instructions, we *still* do the bit
math in the FP execution port. I'm looking into why this is still
happening.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228124 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 09:06:05 +00:00
Chandler Carruth
5ad147196d [x86] Add missing patterns for andps, orps, xorps, and andnps.
Specifically, the existing patterns were scalar-only. These cover the
packed vector bitwise operations when specifically requested with pseudo
instructions. This is particularly important in SSE1 where we can't
actually emit a logical operation on a v2i64 as that isn't a legal type.

This will be tested in subsequent patches which form the floating point
and patterns in more places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228123 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 09:06:01 +00:00
Bill Schmidt
4351f76f81 Replace tabs with spaces from r228116. Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228117 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 06:14:38 +00:00
Bill Schmidt
89e8a17b4d [PowerPC] Handle 32-bit targets properly in PPCTLSDynamicCall.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228116 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 05:51:56 +00:00
Philip Reames
c27a1d9ccb Fix a warning in non-asserts builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228114 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 05:11:20 +00:00
Frederic Riss
1638ca5493 Fix some unnoticed/unwanted behavior change from r222319.
The ARM assembler allows register alias redefinitions as long as it
targets the same register. r222319 broke that. In the AArch64 case
it would just produce a new warning, but in the ARM case it would
error out on previously accepted assembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228109 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 03:10:03 +00:00
Kostya Serebryany
8fa9947e4d [fuzzer]: fix exit code, add more diagnostics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228103 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 01:22:57 +00:00
Kostya Serebryany
0013784dd3 [sanitizer] add another workaround for PR 17409: when over a threshold emit coverage instrumentation as calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228102 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 01:21:45 +00:00
Peter Collingbourne
5e51ed875d Misc documentation/comment fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228093 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 00:42:45 +00:00
Philip Reames
1efb1ce986 Clang format of a file introduced in 228090 (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228091 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 00:39:57 +00:00
Philip Reames
2e38beb32f Add a pass for inserting safepoints into (nearly) arbitrary IR
This pass is responsible for figuring out where to place call safepoints and safepoint polls. It doesn't actually make the relocations explicit; that's the job of the RewriteStatepointsForGC pass (http://reviews.llvm.org/D6975).

Note that this code is not yet finalized.  Its moving in tree for incremental development, but further cleanup is needed and will happen over the next few days.  It is not yet part of the standard pass order.  

Planned changes in the near future:
 - I plan on restructuring the statepoint rewrite to use the functions add to the IRBuilder a while back. 
 - In the current pass, the function "gc.safepoint_poll" is treated specially but is not an intrinsic. I plan to make identifying the poll function a property of the GCStrategy at some point in the near future.
 - As follow on patches, I will be separating a collection of test cases we have out of tree and submitting them upstream. 
 - It's not explicit in the code, but these two patches are introducing a new state for a statepoint which looks a lot like a patchpoint. There's no a transient form which doesn't yet have the relocations explicitly represented, but does prevent reordering of memory operations. Once this is in, I need to update actually make this explicit by reserving the 'unused' argument of the statepoint as a flag, updating the docs, and making the code explicitly check for such a thing. This wasn't really planned, but once I split the two passes - which was done for other reasons - the intermediate state fell out. Just reminds us once again that we need to merge statepoints and patchpoints at some point in the not that distant future.

Future directions planned:
 - Identifying more cases where a backedge safepoint isn't required to ensure timely execution of a safepoint poll.
 - Tweaking the insertion process to generate easier to optimize IR. (For example, investigating making SplitBackedge) the default.
 - Adding opt-in flags for a GCStrategy to use this pass. Once done, add this pass to the actual pass ordering.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228090 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 00:37:33 +00:00
Galina Kistanova
4a93232fd2 Added missing header for the explicit dependency on MDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228085 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 00:20:52 +00:00
Justin Bogner
3d4b2188af InstrProf: Use a stable sort when reading coverage regions
Keeping regions that start at the same location in insertion order
makes this logic easier to test / more deterministic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228083 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 00:12:18 +00:00
Colin LeMahieu
60705f77f6 [Hexagon] Revert change to isCodeGenOnly = 1 in r228080
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228082 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 00:09:23 +00:00
Colin LeMahieu
01ae000bf1 [Hexagon] Changing some isCodeGenOnly to isAsmParserOnly since we want them to asm parse but not cause decode conflicts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228080 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 00:07:26 +00:00
Owen Anderson
a657cab9ec Remove a gross usage of environment variables in MachineVerifier, replacing it with support for setting the -verify-machineinstrs flag via an environment variable in LIT.
This preserves the handy functionality of force-enabling the MachineVerifier, without the need to embed usage of environment variables in LLVM client applications.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228079 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-04 00:02:59 +00:00
Justin Bogner
bf67bfe6bb InstrProf: Make CounterMappingRegions less confusing to construct
Creating empty and expansion regions is awkward with the current API.
Expose static methods to make this simpler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228075 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 23:59:33 +00:00
Arnaud A. de Grandmaison
f041861302 [PBQP] Provide more information in the debug prints
Based on a patch by Jonas Paulsson

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228068 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 23:40:24 +00:00
Philip Reames
c81fa9543f Use ImmutableCallSite for statepoint verification.
Patch by: Igor Laevsky

"This change generalizes statepoint verification to use ImmutableCallSite instead of CallInst. This will allow to easily implement invoke statepoint verification (in a following change)."

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228064 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 23:18:47 +00:00
Adam Nemet
6daac09e80 [LV] Split off memcheck block really at the first check
I've noticed this while trying to move addRuntimeCheck to LoopAccessAnalysis.

I think that the intention was to early exit from the overflow checking before
the code for the memchecks.  This is the entire reason why we compute
FirstCheckInst but then we don't use that as the splitting instruction but the
final check.  Looks like an oversight.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228056 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 22:45:39 +00:00
Chandler Carruth
2e49ac01a6 [x86] Fix signed vs. unsigned comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228055 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 22:43:30 +00:00
Simon Pilgrim
ae43f39965 Fixed unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228054 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 22:39:28 +00:00
Colin LeMahieu
318defeca7 [Hexagon] Marking a bunch of non-encoded instructions with isCodeGenOnly = 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228050 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 22:09:51 +00:00
Simon Pilgrim
3d04e48cb6 [X86][SSE] psrl(w/d/q) and psll(w/d/q) bit shifts for SSE2
Patch to match cases where shuffle masks can be reduced to bit shifts. Similar to byte shift shuffle matching from D5699.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228047 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:58:29 +00:00
Bill Schmidt
8c775a4e7b [PowerPC] Implement the vpopcnt instructions for POWER8
Patch by Kit Barton.

Add the vector population count instructions for byte, halfword, word,
and doubleword sizes.  There are two major changes here:

    PPCISelLowering.cpp: Make CTPOP legal for vector types.
    PPCRegisterInfo.td: Added v2i64 to the VRRC register
      definition. This is needed for the doubleword variations of the
      integer ops that were added in P8. 

Test Plan

Test the instruction vpcnt* encoding/decoding in ppc64-encoding-vmx.s

Test the generation of the vpopcnt instructions for various vector
data types.  When adding the v2i64 type to the Vector Register set, I
also needed to add the appropriate bit conversion patterns between
v2i64 and the existing vector types.  Testing for these conversions
were also added in the test case by passing a different vector type as
a parameter into the test functions.  There is also a run step that
will ensure the vpopcnt instructions are generated when the vsx
feature is disabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228046 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:58:23 +00:00
Kostya Serebryany
04e540582b [fuzzer] Add proper dependensices to the fuzzer tests
Summary: Make sure that FileCheck is built when running check-fuzzer

Test Plan:
run on bot:
lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228045 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:57:32 +00:00
Duncan P. N. Exon Smith
1602e58745 AsmParser: Recognize DW_TAG_* constants
Recognize `DW_TAG_` constants in assembly, and output it by default for
`GenericDebugNode`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228042 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:56:01 +00:00
Duncan P. N. Exon Smith
6adbfa3815 IR: Assembly and bitcode for GenericDebugNode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228041 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:54:14 +00:00
Marek Olsak
f34625adbd R600/SI: Remove useless patterns in VALU which are already covered by SALU
Also remove hasPostISelHook=1 from V_LSHL_B32. It's defined by InstSI already.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228039 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:53:08 +00:00
Marek Olsak
f8cf57cb0c R600/SI: Rewrite VOP1InstSI to contain a pseudo and _si opcode
What this does is that if you accidentally select these instructions on VI,
the code generation will fail, because the pseudo -> _vi mapping will be
undefined.

The idea is to be able to catch possible future bugs easily.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228038 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:53:05 +00:00
Marek Olsak
e1a8ca95be R600/SI: Fix B64 VALU shifts on VI
SI only has standard versions. VI only has REV versions.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228037 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:53:01 +00:00
Justin Bogner
a378f917af InstrProf: Remove CoverageMapping::HasCodeBefore, it isn't used
It's not entirely clear to me what this field was meant for, but it's
always false. Remove it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228034 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:35:36 +00:00
Duncan P. N. Exon Smith
5ff000f15e Support: Add string => unsigned mapping for DW_TAG
Add `dwarf::getTag()` to translate from `StringRef` to `unsigned`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228031 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:16:49 +00:00
Duncan P. N. Exon Smith
b3d53c6065 Support: Re-implement dwarf::TagString() using a .def file, NFC
Also re-implements the `dwarf::Tag` enumerator.  I've moved the mock
tags into the enumerator since there's no other way to do this.  Really
they shouldn't be used at all (they're just a hack to identify
`MDNode`s, but we have a class hierarchy for that now).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228030 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:13:16 +00:00
Duncan P. N. Exon Smith
17e8d42c63 Support: Stop stringifying DW_TAG_{lo,hi}_user
`dwarf::TagString()` shouldn't stringify `DW_TAG_lo_user` or
`DW_TAG_hi_user`.  These aren't actual tags; they're markers for the
edge of vendor-specific tag regions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228029 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 21:08:33 +00:00
Simon Pilgrim
4855886269 Fixed signed/unsigned comparison warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228027 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 20:54:01 +00:00
Colin LeMahieu
3c159ed1a0 [Hexagon] Converting XTYPE/SHIFT intrinsics. Cleaning out old intrinsic patterns and updating tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228026 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 20:40:52 +00:00
Simon Pilgrim
b559573571 Fixed unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228025 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 20:38:52 +00:00
Daniel Berlin
403050abcc Allow PRE to insert no-cost phi nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228024 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 20:37:08 +00:00
Simon Pilgrim
646722d55f [X86][SSE] Added general integer shuffle matching for MOVQ instruction
This patch adds general shuffle pattern matching for the MOVQ zero-extend instruction (copy lower 64bits, zero upper) for all 128-bit integer vectors, it is added as a fallback test in lowerVectorShuffleAsZeroOrAnyExtend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228022 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 20:09:18 +00:00
Colin LeMahieu
861e105e61 [Hexagon] Updating XTYPE/PRED intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228019 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 19:43:59 +00:00
Kostya Serebryany
32a12b924e [fuzzer] update the include line to use the new header name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228018 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 19:42:05 +00:00
Jingyue Wu
2918efd551 Add straight-line strength reduction to LLVM
Summary:
Straight-line strength reduction (SLSR) is implemented in GCC but not yet in
LLVM. It has proven to effectively simplify statements derived from an unrolled
loop, and can potentially benefit many other cases too. For example,

LLVM unrolls

  #pragma unroll
  foo (int i = 0; i < 3; ++i) {
    sum += foo((b + i) * s);
  }

into

  sum += foo(b * s);
  sum += foo((b + 1) * s);
  sum += foo((b + 2) * s);

However, no optimizations yet reduce the internal redundancy of the three
expressions:

  b * s
  (b + 1) * s
  (b + 2) * s

With SLSR, LLVM can optimize these three expressions into:

  t1 = b * s
  t2 = t1 + s
  t3 = t2 + s

This commit is only an initial step towards implementing a series of such
optimizations. I will implement more (see TODO in the file commentary) in the
near future. This optimization is enabled for the NVPTX backend for now.
However, I am more than happy to push it to the standard optimization pipeline
after more thorough performance tests.

Test Plan: test/StraightLineStrengthReduce/slsr.ll

Reviewers: eliben, HaoLiu, meheff, hfinkel, jholewinski, atrick

Reviewed By: jholewinski, atrick

Subscribers: karthikthecool, jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228016 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 19:37:06 +00:00
Colin LeMahieu
30f48c7dc4 [Hexagon] Updating XTYPE/PERM intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228015 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 19:36:59 +00:00
Simon Pilgrim
71a4e9522e [X86][AVX2] Enabled shuffle matching for the AVX2 zero extension (128bit -> 256bit) vpmovzx* instructions.
Differential Revision: http://reviews.llvm.org/D7251

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228014 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 19:34:09 +00:00
Colin LeMahieu
6217146dce [Hexagon] Adding missing vector multiply instruction encodings. Converting multiply intrinsics and updating tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228010 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 19:15:11 +00:00
Sanjay Patel
9b4cc76745 Merge consecutive 16-byte loads into one 32-byte load (PR22329)
This patch detects consecutive vector loads using the existing 
EltsFromConsecutiveLoads() logic. This fixes:
http://llvm.org/bugs/show_bug.cgi?id=22329

This patch effectively reverts the tablegen additions of D6492 / 
http://reviews.llvm.org/rL224344 ...which in hindsight were a horrible hack.

The test cases that were added with that patch are simply modified to load
from varying offsets of a base pointer. These loads did not match the existing
tablegen patterns.

A happy side effect of doing this optimization earlier is that we can now fold
the load into a math op where possible; this is shown in some of the updated
checks in the test file.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228006 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 18:54:00 +00:00
Sanjay Patel
93e763c5cb remove variable names from comments; NFC
I didn't bother to fix the self-referential definitions and grammar
because my eyes started to bleed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 18:47:32 +00:00
Manman Ren
69e4dd1b12 [LTO API] split lto_codegen_compile to lto_codegen_optimize and
lto_codegen_compile_optimized. Also add lto_api_version.

Before this commit, we can only dump the optimized bitcode after running
lto_codegen_compile, but it includes some impacts of running codegen passes,
one example is StackProtector pass. We will get assertion failure when running
llc on the optimized bitcode, because StackProtector is effectively run twice.

After splitting lto_codegen_compile, the linker can choose to dump the bitcode
before running lto_codegen_compile_optimized.

lto_api_version is added so ld64 can check for runtime-availability of the new
API.

rdar://19565500


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 18:39:15 +00:00
Colin LeMahieu
936986d12d [Hexagon] Converting complex number intrinsics and adding tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227995 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 18:16:28 +00:00
Colin LeMahieu
a3a588d983 [Hexagon] Adding vector intrinsics for alu32/alu and xtype/alu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227993 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 18:01:45 +00:00
Adam Nemet
3fe93fe70a [LoopVectorize] Fix rebase glitch in r227751
LoopVectorizationLegality::{getNumLoads,getNumStores} should forward to
LoopAccessAnalysis now.

Thanks to Takumi for noticing this!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227992 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 17:59:53 +00:00
Jingyue Wu
ef46291cb3 Remove usernames from TODOs, NFC
making the style consistent with the rest


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227991 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 17:57:38 +00:00
Marek Olsak
a95296a86e R600/SI: Don't generate non-existent LSHL, LSHR, ASHR B32 variants on VI
This can happen when a REV instruction is commuted.

The trick is not to define the _vi versions of instructions, which has these
consequences:
- code generation will always fail if a pseudo cannot be lowered
  (very useful to catch bugs where an unsupported instruction somehow makes
   it to the printer)
- ability to query if a pseudo can be lowered, which is done in commuteOpcode
  to prevent REV from commuting to non-REV on VI

Tested-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227990 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 17:38:12 +00:00
Marek Olsak
2ea95bd471 R600/SI: Remove VOP2_REV definitions from target-specific instructions
The getCommute* functions are only used with pseudos, so this commit doesn't
change anything.

The issue with missing non-rev versions of shift instructions on VI will fixed
separately.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227989 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 17:38:05 +00:00
Marek Olsak
5e58a1bc29 R600/SI: Trivial instruction definition corrections for VI (v2)
- V_MAC_LEGACY_F32 exists on VI, but it's VOP3-only.

- Define CVT_PK opcodes which are different between SI and VI. These are
  unused. The idea is to define all chip differences.

v2: keep V_MUL_LO_U32

Tested-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227988 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 17:38:01 +00:00
Marek Olsak
f426f1db6e R600/SI: Determine target-specific encoding of READLANE and WRITELANE early v2
These are VOP2 on SI and VOP3 on VI, and their pseudos are neither, which can
be a problem. In order to make isVOP2 and isVOP3 queries behave as expected,
the encoding must be determined first.

This doesn't fix any known issue, but better safe than sorry.

v2: add and use getMCOpcodeFromPseudo

Tested-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227987 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 17:37:57 +00:00
Marek Olsak
b19dbd9eb3 R600/SI: Fix dependency between instruction writing M0 and S_SENDMSG on VI (v2)
This fixes a hang when using an empty geometry shader.

v2: - don't add s_nop when followed by s_waitcnt
    - comestic changes

Tested-by: Michel Dänzer <michel.daenzer@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227986 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 17:37:52 +00:00
Sanjay Patel
3cf9267d4e Fix program crashes due to alignment exceptions generated for SSE memop instructions (PR22371).
r224330 introduced a bug by misinterpreting the "FeatureVectorUAMem" bit.
The commit log says that change did not affect anything, but that's not correct.
That change allowed SSE instructions to have unaligned mem operands folded into
math ops, and that's not allowed in the default specification for any SSE variant. 

The bug is exposed when compiling for an AVX-capable CPU that had this feature
flag but without enabling AVX codegen. Another mistake in r224330 was not adding
the feature flag to all AVX CPUs; the AMD chips were excluded.

This is part of the fix for PR22371 ( http://llvm.org/bugs/show_bug.cgi?id=22371 ).

This feature bit is SSE-specific, so I've renamed it to "FeatureSSEUnalignedMem".
Changed the existing test case for the feature bit to reflect the new name and
renamed the test file itself to better reflect the feature.
Added runs to fold-vex.ll to check for the failing codegen.

Note that the feature bit is not set by default on any CPU because it may require a
configuration register setting to enable the enhanced unaligned behavior.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227983 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 17:13:04 +00:00
Bill Schmidt
1123a81009 [PowerPC] Yet another approach to __tls_get_addr
This patch is a third attempt to properly handle the local-dynamic and
global-dynamic TLS models.

In my original implementation, calls to __tls_get_addr were hidden
from view until the asm-printer phase, at which point the underlying
branch-and-link instruction was created with proper relocations.  This
mostly worked well, but I used some repellent techniques to ensure
that the TLS_GET_ADDR nodes at the SD and MI levels correctly received
input from GPR3 and produced output into GPR3.  This proved to work
badly in the presence of multiple TLS variable accesses, with the
copies to and from GPR3 being scheduled incorrectly and generally
creating havoc.

In r221703, I addressed that problem by representing the calls to
__tls_get_addr as true calls during instruction lowering.  This had
the advantage of removing all of the bad hacks and relying on the
existing call machinery to properly glue the copies in place. It
looked like this was going to be the right way to go.

However, as a side effect of the recent discovery of problems with
linker optimizations for TLS, we discovered cases of suboptimal code
generation with this strategy.  The problem comes when tls_get_addr is
called for the same address, and there is a resulting CSE
opportunity.  It turns out that in such cases MachineCSE will common
the addis/addi instructions that set up the input value to
tls_get_addr, but will not common the calls themselves.  MachineCSE
does not have any machinery to common idempotent calls.  This is
perfectly sensible, since presumably this would be done at the IR
level, and introducing calls in the back end isn't commonplace.  In
any case, we end up with two calls to __tls_get_addr when one would
suffice, and that isn't good.

I presumed that the original design would have allowed commoning of
the machine-specific nodes that hid the __tls_get_addr calls, so as
suggested by Ulrich Weigand, I went back to that design and cleaned it
up so that the copies were properly held together by glue
nodes.  However, it turned out that this didn't work either...the
presence of copies to physical registers kept the machine-specific
nodes from being commoned also.

All of which leads to the design presented here.  This is a return to
the original design, except that no attempt is made to introduce
copies to and from GPR3 during instruction lowering.  Virtual registers
are used until prior to register allocation.  At that point, a special
pass is run that identifies the machine-specific nodes that hide the
tls_get_addr calls and introduces the copies to and from GPR3 around
them.  The register allocator then coalesces these copies away.  With
this design, MachineCSE succeeds in commoning tls_get_addr calls where
possible, and we get nice optimal code generation (better than GCC at
the moment, which does not common these calls).

One additional problem must be dealt with:  After introducing the
mentions of the physical register GPR3, the aggressive anti-dependence
breaker sees opportunities to improve scheduling by selecting a
different register instead.  Flags must be used on the instruction
descriptions to tell the anti-dependence breaker to keep its hands in
its pockets.

One thing missing from the original design was recording a definition
of the link register on the GET_TLS_ADDR nodes.  Doing this was found
to be insufficient to force a stack frame to be created, which led to
looping behavior because two different LR values were stored at the
same address.  This appears to have been an oversight in
PPCFrameLowering::determineFrameLayout(), which is repaired here.

Because MustSaveLR() returns true for calls to builtin_return_address,
this changed the expected behavior of
test/CodeGen/PowerPC/retaddr2.ll, which now stacks a frame but
formerly did not.  I've fixed the test case to reflect this.

There are existing TLS tests to catch regressions; the checks in
test/CodeGen/PowerPC/tls-store2.ll proved to be too restrictive in the
face of instruction scheduling with these changes, so I fixed that
up.

I've added a new test case based on the PrettyStackTrace module that
demonstrated the original problem. This checks that we get correct
code generation and that CSE of the calls to __get_tls_addr has taken
place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227976 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 16:16:01 +00:00
Bruno Cardoso Lopes
7df357f552 [X86][MMX] Improve transfer from mmx to i32
Improve EXTRACT_VECTOR_ELT DAG combine to catch conversion patterns
between x86mmx and i32 with more layers of indirection.

Before:
  movq2dq %mm0, %xmm0
  movd %xmm0, %eax
After:
  movd %mm0, %eax

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227969 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 14:46:49 +00:00
Renato Golin
ba4bdb4b1b Adding AArch64 support to ASan instrumentation
For the time being, it is still hardcoded to support only the 39 VA bits
variant, I plan to work on supporting 42 and 48 VA bits variants, but I
don't have access to such hardware at the moment.

Patch by Chrystophe Lyon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227965 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 11:20:45 +00:00
Craig Topper
97494e9718 [X86] Make fxsave64/fxrstor64/xsave64/xsrstor64/xsaveopt64 parseable in AT&T syntax. Also make them the default output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227963 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 11:03:57 +00:00
Craig Topper
c7f2036c2b [X86] Add Requires[In64BitMode] around MOVSX64rr32/MOVSX64rm32. This makes it more strictly mutexed with the ARPL instruction 32-bit mode. Helps with some disassembler changes I'm experimenting with. Should be NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227962 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 11:03:43 +00:00
Eric Christopher
b3f0a42d00 Only access TLOF via the TargetMachine, not TargetLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227949 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 07:22:52 +00:00
Eric Christopher
482e090944 Define a runOnMachineFunction for the Hexagon AsmPrinter and
use it to initialize the subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227948 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 06:40:22 +00:00
Eric Christopher
4b4315d6f4 Migrate away from using a Subtarget except for the one place we want
to use it. Use the triple to determine OS format bits at the module
level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227947 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 06:40:19 +00:00
Lang Hames
d54450ef63 [PBQP Regalloc] Pre-spill vregs that have no legal physregs.
The PBQP::RegAlloc::MatrixMetadata class assumes that matrices have at least two
rows/columns (for the spill option plus at least one physreg). This patch
ensures that that invariant is met by pre-spilling vregs that have no physreg
options so that no node (and no corresponding edges) need be added to the PBQP
graph.

This fixes a bug in an out-of-tree target that was identified by Jonas Paulsson.
Thanks for tracking this down Jonas!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227942 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 06:14:06 +00:00
NAKAMURA Takumi
56756c43cd Resurrect initializers for NumLoads and NumStores in LoopVectorizationLegality to suppress undefined behavior.
FIXME: Shall they be managed in LAA?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227940 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 03:55:06 +00:00
Rafael Espindola
52288fa1e6 Propagate a better error message to the C api.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227934 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 01:53:03 +00:00
Rafael Espindola
d0d95dbf3c Use a non-fatal diag handler in the C API. FIxes PR22368.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227903 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 00:49:57 +00:00
Justin Bogner
68697579bf InstrProf: Simplify RawCoverageMappingReader's API slightly
This is still kind of a weird API, but dropping the (partial) update
of the passed in CoverageMappingRecord makes it a little easier to
understand and use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227900 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 00:20:11 +00:00
Justin Bogner
11f57c9068 InstrProf: Simplify some logic by using ArrayRef::slice (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227898 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-03 00:00:00 +00:00
Eric Christopher
82181dfe51 Migrate to using the subtarget on the machine function and update
all uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227891 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 23:03:45 +00:00
Eric Christopher
439705d6be Use the function template getSubtarget off of the machine function,
and use it in all locations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227890 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 23:03:43 +00:00
Eric Christopher
40445ad91f Use the cached subtarget on the MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227885 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:40:56 +00:00
Eric Christopher
c0663bab1a Remove dead header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227884 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:40:54 +00:00
Eric Christopher
dd0c5bb156 Remove dead code in the HexagonMCInst classes. This also fixes
a layering violation in the port and removes calls to getSubtargetImpl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227883 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:40:53 +00:00
Eric Christopher
5b75139406 80-col fixup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227882 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:40:51 +00:00
Eric Christopher
dd27f99713 Remove dead code in the HexagonMCInst classes. This also fixes
a layering violation in the port and removes calls to getSubtargetImpl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227880 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:28:48 +00:00
Eric Christopher
caf706bf9a 80-col fixup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227879 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:28:46 +00:00
Eric Christopher
07980e9ade Remove unused class variables and update all callers/uses from
the HexagonSplitTFRCondSet pass. Use the subtarget off the machine
function at the same time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227878 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:28:44 +00:00
Eric Christopher
7ee5bc454a Migrate the HexagonSplitConst32AndConst64 pass from TargetMachine
based getSubtarget to the one cached on the MachineFunction.
Remove unused class variables and update all callers/uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227874 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:11:43 +00:00
Eric Christopher
30803daf51 Remove #if'd code and update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227873 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:11:42 +00:00
Eric Christopher
b1427d95e2 Move HexagonMachineScheduler to use the subtarget off of the
MachineFunction and update all uses accordingly including
VLIWResourceModel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227872 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:11:40 +00:00
Eric Christopher
848278638c Cache and use the subtarget that owns the target lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227871 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 22:11:36 +00:00
Alexei Starovoitov
8ea8f377aa bpf: Use the getSubtarget call off of the MachineFunction rather than the TargetMachine
Summary:
Hi Eric,

this patch cleans up the layering violation that you're fixing across backends.
Anything else I need to fix on bpf backend side?

Thanks

Reviewers: echristo

Reviewed By: echristo

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227865 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 21:24:27 +00:00
Jingyue Wu
62d535ff3c Resurrect the assertion removed by r227717
Summary: MSVC can compile "LoopID->getOperand(0) == LoopID" when LoopID is MDNode*.

Test Plan: no regression

Reviewers: mkuper

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227853 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 20:41:11 +00:00
Duncan P. N. Exon Smith
48da191fb3 Fix the -Werror build, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227849 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 20:20:56 +00:00
Duncan P. N. Exon Smith
2a11d59014 IR: Allow GenericDebugNode construction from MDString
Allow `GenericDebugNode` construction directly from `MDString`, rather
than requiring `StringRef`s.  I've refactored the `StringRef`
constructors to use these.  There's no real functionality change here,
except for exposing the lower-level API.

The purpose of this is to simplify construction of string operands when
reading bitcode.  It's unnecessarily indirect to parse an `MDString` ID,
lookup the `MDString` in the bitcode reader list, get the `StringRef`
out of that, and then have `GenericDebugNode::getImpl()` use
`MDString::get()` to acquire the original `MDString`.  Instead, this
allows the bitcode reader to directly pass in the `MDString`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227848 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 20:01:03 +00:00
Duncan P. N. Exon Smith
265dc3e4c9 IR: Separate helpers for string operands, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227846 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 19:54:05 +00:00
Lang Hames
41367e252a [Orc] Make OrcMCJITReplacement::addObject calls transfer buffer ownership to the
ObjectLinkingLayer.

There are a two of overloads for addObject, one of which transfers ownership of
the underlying buffer to OrcMCJITReplacement. This commit makes the ownership
transfering version pass ownership down to the ObjectLinkingLayer in order to
prevent the issue described in r227778.

I think this commit will fix the sanitizer bot failures that necessitated the
removal of the load-object-a.ll regression test in r227785, so I'm reinstating
that test.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227845 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 19:51:18 +00:00
Rafael Espindola
d273a682a2 Move simple case earlier and use a continue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227841 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 19:22:51 +00:00
Eric Christopher
c3bbdbba2d Migrate HexagonISelDAGToDAG to setting a subtarget pointer during
runOnMachineFunction. Update all uses of the Subtarget accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227840 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 19:22:03 +00:00
Eric Christopher
7529bb6088 Use the getSubtarget call off of the MachineFunction rather than
the TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227839 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 19:22:01 +00:00
Eric Christopher
7698c02bab Remove unused class variables and update calls to get the subtarget
off of the machine function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227837 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 19:05:28 +00:00
Eric Christopher
e4100fc79e Sink queries into asserts since the variable is unused otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227836 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:58:24 +00:00
Duncan P. N. Exon Smith
ca8d3bf8af IR: Split out DebugInfoMetadata.h, NFC
Move debug-info-centred `Metadata` subclasses into their own
header/source file.  A couple of private template functions are needed
from both `Metadata.cpp` and `DebugInfoMetadata.cpp`, so I've moved them
to `lib/IR/MetadataImpl.h`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227835 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:53:21 +00:00
Eric Christopher
4502a3c3d2 Update CMake build for removed files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227834 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:52:49 +00:00
Eric Christopher
1438de8b6a Get TargetRegisterInfo and TargetInstrInfo off of the MachineFunction
and remove unnecessary class variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227832 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:46:31 +00:00
Eric Christopher
c70af25ea4 Use the function template getSubtarget to remove an explicit cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227831 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:46:29 +00:00
Eric Christopher
b06a938123 Grab TargetInstrInfo off of the MachineFunction and remove
unnecessary class variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:46:27 +00:00
Eric Christopher
1754d31c4b Remove unused files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227829 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:46:23 +00:00
Adrian Prantl
b265a82d58 Debug Info: Relax assertion in isUnsignedDIType() to allow floats to be
described by integer constants. This is a bit ugly, but if the source
language allows arbitrary type casting, the debug info must follow suit.

For example:
  void foo() {
    float a;
    *(int *)&a = 0;
  }
For the curious: SROA replaces the float alloca with an i32 alloca, which
is then optimized away and described via dbg.value(i32 0, ...).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227827 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:31:58 +00:00
Duncan P. N. Exon Smith
0784a4dabb Fix some file headers, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227826 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:20:15 +00:00
Tom Stellard
d73d1062fe R600/SI: 64-bit and larger memory access must be at least 4-byte aligned
This is true for SI only. CI+ supports unaligned memory accesses,
but this requires driver support, so for now we disallow unaligned
accesses for all GCN targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227822 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 18:02:28 +00:00
Ahmed Bougacha
0f1a21bcb8 [AArch64] Prefer DUP/MOV ("CPY") to INS for vector_extract.
This avoids a partial false dependency on the previous content of
the upper lanes of the destination vector register.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227820 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:55:57 +00:00
Eric Christopher
5fc4d409c6 Since TargetLowering is already subtarget dependent just pass
in the subtarget and stash it in the class so that lookups are
easier and safer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227819 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:52:27 +00:00
Eric Christopher
f49b8ab731 Use the function template getSubtarget on the MachineFunction
rather than a larger explicit cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227818 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:52:25 +00:00
Eric Christopher
62ba1b5ff1 Remove unused class variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227817 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:52:23 +00:00
Eric Christopher
dbb436ab54 Remove unused class variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227816 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:52:20 +00:00
Eric Christopher
8115b6b867 Reuse a bunch of cached subtargets and remove getSubtarget calls
without a Function argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227814 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:38:43 +00:00
Eric Christopher
eb2eaae1af Remove some unused forward declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227812 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 17:38:37 +00:00
Jan Wen Voung
1a63641597 Fix ARM peephole optimizeCompare to avoid optimizing unsigned cmp to 0.
Summary:
Previously it only avoided optimizing signed comparisons to 0.
Sometimes the DAGCombiner will optimize the unsigned comparisons
to 0 before it gets to the peephole pass, but sometimes it doesn't.

Fix for PR22373.

Test Plan: test/CodeGen/ARM/sub-cmp-peephole.ll

Reviewers: jfb, manmanren

Subscribers: aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227809 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 16:56:50 +00:00
Erik Eckstein
40d542097a Fix: SLPVectorizer crashes with assertion when vectorizing a cmp instruction.
The commit r225977 uncovered this bug. The problem was that the vectorizer tried to
read the second operand of an already deleted instruction.
The bug didn't show up before r225977 because the freed memory still contained a non-null pointer.
With r225977 deletion of instructions is delayed and the read operand pointer is always null.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227800 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 12:45:34 +00:00
Lang Hames
c0721c2172 [Orc] Remove the OwnedModules list from OrcMCJITReplacement and use
ExecutionEngine's Modules list instead.

This makes the owned modules visibile to ExecutionEngine. In particular,
it is required for ExecutionEngine::runStaticConstructorsAndDestructors to
work.

Regression tests for Orc (which test this issue) will be committed shortly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227779 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-02 04:34:02 +00:00
Hal Finkel
a5c1f106b1 [PowerPC] Put PPCEarlyReturn into its own source file
PPCInstrInfo.cpp has ended up containing several small MI-level passes, and
this is making the file harder to read than necessary. Split out
PPCEarlyReturn into its own source file. NFC.

Now that PPCInstrInfo.cpp does not also contain pass implementations, I hope
that it will be slightly less unwieldy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227775 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 22:58:46 +00:00
Hal Finkel
c4b84657f3 [PowerPC] Remove unnecessary include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227772 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 22:03:13 +00:00
Hal Finkel
2a9d9584b4 [PowerPC] Put PPCVSXCopy into its own source file
PPCInstrInfo.cpp has ended up containing several small MI-level passes, and
this is making the file harder to read than necessary. Split out
PPCVSXCopy into its own source file. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227771 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 22:01:29 +00:00
Hal Finkel
dad591a435 [PowerPC] Put PPCVSXFMAMutate into its own source file
PPCInstrInfo.cpp has ended up containing several small MI-level passes, and
this is making the file harder to read than necessary. Split out
PPCVSXFMAMutate into its own source file. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227770 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 21:51:22 +00:00
Hal Finkel
2767054823 [PowerPC] Remove the PPCVSXCopyCleanup pass
This MI-level pass was necessary when VSX support was first being developed,
specifically, before the ABI code had been updated to use VSX registers for
arguments (the register assignments did not change, in a physical sense, but
the VSX super-registers are now used). Unfortunately, I never went back and
removed this pass after that was done. I believe this code is now effectively
dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227767 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 21:20:58 +00:00
Benjamin Kramer
f9fd8193fb LoopVectorize: Remove initializer list that blocks MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227766 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 21:13:26 +00:00
Hal Finkel
604e1b770c [PowerPC] Add implicit ops to conditional returns in PPCEarlyReturn
When PPCEarlyReturn, it should really copy implicit ops from the old return
instruction to the new one. This currently does not matter much, because we run
PPCEarlyReturn very late in the pipeline (there is nothing to do DCE on
definitions of those registers). However, for completeness, we should do it
anyway.

Noticed by inspection (and there should be no functional change); thus, no
test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 20:16:10 +00:00
David Majnemer
9e8b7214ed ValueTracking: Make isSafeToSpeculativelyExecute a little cleaner
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227760 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 19:10:19 +00:00
Hal Finkel
3bafb64914 [PowerPC] VSX stores don't also read
The VSX store instructions were also picking up an implicit "may read" from the
default pattern, which was an intrinsic (and we don't currently have a way of
specifying write-only intrinsics).

This was causing MI verification to fail for VSX spill restores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227759 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 19:07:41 +00:00
Hal Finkel
ec716cecda [PowerPC] Better scheduling for isel on P7/P8
isel is actually a cracked instruction on the P7/P8, and must start a dispatch
group. The scheduling model should reflect this so that we don't bunch too many
of them together when possible.

Thanks to Bill Schmidt and Pat Haugen for helping to sort this out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227758 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 17:52:16 +00:00
Adam Nemet
2000a7c9b2 [LoopVectorize] Move LoopAccessAnalysis to its own module
Other than moving code and adding the boilerplate for the new files, the code
being moved is unchanged.

There are a few global functions that are shared with the rest of the
LoopVectorizer.  I moved these to the new module as well (emitLoopAnalysis,
stripIntegerCast, replaceSymbolicStrideSCEV) along with the Report class used
by emitLoopAnalysis.  There is probably room for further improvement in this
area.

I kept DEBUG_TYPE "loop-vectorize" because it's used as the PassName with
emitOptimizationRemarkAnalysis.  This will obviously have to change.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227756 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:15 +00:00
Adam Nemet
497c4df98a [LoopVectorize] Move RuntimePointerCheck under LoopAccessAnalysis
This class needs to remain public because it's used by
LoopVectorizationLegality::addRuntimeCheck.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227755 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:11 +00:00
Adam Nemet
4926cfb1da [LoopVectorize] Pass parameters explicitly to MemoryDepChecker
Rather than using globals use a structure to pass parameters from the
vectorizer.  This prepares the class to be moved outside the LoopVectorizer.

It's not great how all this is passed through in LoopAccessAnalysis but this
is all expected to change once the class start servicing the Loop Distribution
pass as well where some of these parameters make no sense.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227754 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:09 +00:00
Michael Kuperstein
acd5f13c88 [X86] Convert esp-relative movs of function arguments to pushes, step 2
This moves the transformation introduced in r223757 into a separate MI pass.
This allows it to cover many more cases (not only cases where there must be a 
reserved call frame), and perform rudimentary call folding. It still doesn't 
have a heuristic, so it is enabled only for optsize/minsize, with stack 
alignment <= 8, where it ought to be a fairly clear win.

(Re-commit of r227728)

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227752 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:04 +00:00
Adam Nemet
114a93ecd2 [LoopVectorize] Split out LoopAccessAnalysis from LoopVectorizationLegality
Move the canVectorizeMemory functionality from LoopVectorizationLegality to a
new class LoopAccessAnalysis and forward users.

Currently the collection of the symbolic stride information is kept with
LoopVectorizationLegality and it becomes an input to LoopAccessAnalysis.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:04 +00:00
Adam Nemet
bddcf8ba3a [LoopVectorize] Add accessors for Num{Stores,Loads,PredStores} in AccessAnalysis
These members are moving to LoopAccessAnalysis.  The accessors help to hide
this.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227750 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:02 +00:00
Adam Nemet
8a1d3fe962 [LoopVectorize] Rename the Report class to VectorizationReport
This class will become public in the new LoopAccessAnalysis header so the name
needs to be more global.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:56:00 +00:00
Adam Nemet
f986a7f39c [LoopVectorize] Factor out duplicated code into Report::emitAnalysis
The logic in emitAnalysis is duplicated across multiple functions.  This
splits it into a function.  Another use will be added by the patchset.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227748 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:55:58 +00:00
Adam Nemet
2659684fe3 [LoopVectorize] Split out RuntimePointerCheck from LoopVectorizationLegality
RuntimePointerCheck will be used through LoopAccessAnalysis in
LoopVectorizationLegality.  Later in the patchset it will become a local class
of LoopAccessAnalysis.

NFC.  This is part of the patchset that splits out the memory dependence logic
from LoopVectorizationLegality into a new class LoopAccessAnalysis.
LoopAccessAnalysis will be used by the new Loop Distribution pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227747 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:55:56 +00:00
Michael Kuperstein
5b61b8f53c Revert r227728 due to bad line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 16:15:07 +00:00
Hal Finkel
8f5c829c1e [PowerPC] Make r2 allocatable on PPC64/ELF for some leaf functions
The TOC base pointer is passed in r2, and we normally reserve this register so
that we can depend on it being there. However, for leaf functions, and
specifically those leaf functions that don't do any TOC access of their own
(which is generally due to accessing the constant pool, using TLS, etc.),
we can treat r2 as an ordinary callee-saved register (it must be callee-saved
because, for local direct calls, the linker will not insert any save/restore
code).

The allocation order has been changed slightly for PPC64/ELF systems to put r2
at the end of the list (while leaving it near the beginning for Darwin systems
to prevent unnecessary output changes). While r2 is allocatable, using it still
requires spill/restore traffic, and thus comes at the end of the list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 15:03:28 +00:00
Chandler Carruth
38a2e36ad9 [multiversion] Kill FunctionTargetTransformInfo, TTI itself is now
per-function and supports the exact desired interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227743 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 14:37:03 +00:00
Chandler Carruth
26bc071088 [multiversion] Remove the function parameter from the unrolling
preferences interface on TTI now that all of TTI is per-function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227741 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 14:31:23 +00:00
Chandler Carruth
b71d385494 [multiversion] Switch the TTI queries from TargetMachine to Subtarget
now that we have a correct and cached subtarget specific to the
function.

Also, finish providing a cached per-function subtarget in the core
LLVMTargetMachine -- that layer hadn't switched over yet.

The only use of the TargetMachine was to re-lookup a subtarget for
a particular function to work around the fact that TTI was immutable.
Now that it is per-function and we haved a cached subtarget, use it.

This still leaves a few interfaces with real warts on them where we were
passing Function objects through the TTI interface. I'll remove these
and clean their usage up in subsequent commits now that this isn't
necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227738 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 14:22:17 +00:00
Chandler Carruth
d0bfb83efb [multiversion] Remove the cached TargetMachine pointer from the
intermediate TTI implementation template and instead query up to the
derived class for both the TargetMachine and the TargetLowering.

Most of the derived types had a TLI cached already and there is no need
to store a less precisely typed target machine pointer.

This will in turn make it much cleaner to look up the TLI via
a per-function subtarget instead of the generic subtarget, and it will
pave the way toward pulling the subtarget used for unroll preferences
into the same form once we are *always* using the function to look up
the correct subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227737 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 14:01:15 +00:00
Chandler Carruth
6e89e1316a [multiversion] Switch all of the targets over to use the
TargetIRAnalysis access path directly rather than implementing getTTI.

This even removes getTTI from the interface. It's more efficient for
each target to just register a precise callback that creates their
specific TTI.

As part of this, all of the targets which are building their subtargets
individually per-function now build their TTI instance with the function
and thus look up the correct subtarget and cache it. NVPTX, R600, and
XCore currently don't leverage this functionality, but its trivial for
them to add it now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227735 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 13:20:00 +00:00
Chandler Carruth
d12af8754e [multiversion] Remove a false freedom to leave the TargetMachine pointer
null.

For some reason some of the original TTI code supported a null target
machine. This seems to have been legacy, and I made matters worse when
refactoring this code by spreading that pattern further through the
various targets.

The TargetMachine can't actually be null, and it doesn't make sense to
support that use case. I've now consistently removed it and removed all
of the code trying to cope with that situation. This is probably good,
as several targets *didn't* cope with it being null despite the null
default argument in their constructors. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227734 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 12:38:24 +00:00
Benjamin Kramer
5dffd27576 EarlyCSE: Replace custom hash mixing with Hashing.h
Brings it in line with the other hashes in EarlyCSE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227733 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 12:30:59 +00:00
Chandler Carruth
276f405407 [multiversion] Implement the old pass manager's TTI wrapper pass in
terms of the new pass manager's TargetIRAnalysis.

Yep, this is one of the nicer bits of the new pass manager's design.
Passes can in many cases operate in a vacuum and so we can just nest
things when convenient. This is particularly convenient here as I can
now consolidate all of the TargetMachine logic on this analysis.

The most important change here is that this pushes the function we need
TTI for all the way into the TargetMachine, and re-creates the TTI
object for each function rather than re-using it for each function.
We're now prepared to teach the targets to produce function-specific TTI
objects with specific subtargets cached, etc.

One piece of feedback I'd love here is whether its worth renaming any of
this stuff. None of the names really seem that awesome to me at this
point, but TargetTransformInfoWrapperPass is particularly ... odd.
TargetIRAnalysisWrapper might make more sense. I would want to do that
rename separately anyways, but let me know what you think.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227731 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 12:26:09 +00:00
Chandler Carruth
baceda736e [multiversion] Thread a function argument through all the callers of the
getTTI method used to get an actual TTI object.

No functionality changed. This just threads the argument and ensures
code like the inliner can correctly look up the callee's TTI rather than
using a fixed one.

The next change will use this to implement per-function subtarget usage
by TTI. The changes after that should eliminate the need for FTTI as that
will have become the default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227730 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 12:01:35 +00:00
Michael Kuperstein
59d9986259 [X86] Convert esp-relative movs of function arguments to pushes, step 2
This moves the transformation introduced in r223757 into a separate MI pass.
This allows it to cover many more cases (not only cases where there must be a 
reserved call frame), and perform rudimentary call folding. It still doesn't 
have a heuristic, so it is enabled only for optsize/minsize, with stack 
alignment <= 8, where it ought to be a fairly clear win.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227728 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 11:44:44 +00:00
Chandler Carruth
9a941b2028 [PM] Port SimplifyCFG to the new pass manager.
This should be sufficient to replace the initial (minor) function pass
pipeline in Clang with the new pass manager. I'll probably add an (off
by default) flag to do that just to ensure we can get extra testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227726 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 11:34:21 +00:00
Chandler Carruth
80c55f265d [PM] Port EarlyCSE to the new pass manager.
I've added RUN lines both to the basic test for EarlyCSE and the
target-specific test, as this serves as a nice test that the TTI layer
in the new pass manager is in fact working well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227725 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 10:51:23 +00:00
Chandler Carruth
7724e8efa2 [PM] Port TTI to the new pass manager, introducing a TargetIRAnalysis to
produce it.

This adds a function to the TargetMachine that produces this analysis
via a callback for each function. This in turn faves the way to produce
a *different* TTI per-function with the correct subtarget cached.

I've also done the necessary wiring in the opt tool to thread the target
machine down and make it available to the pass registry so that we can
construct this analysis from a target machine when available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227721 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 10:11:22 +00:00
Craig Topper
270f7a2669 [X86] Add a few target specific nodes to 'getTargetNodeName'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227720 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 10:00:37 +00:00
Michael Kuperstein
814d95b350 Removed assert that doesn't typecheck and breaks debug MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227717 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 08:46:20 +00:00
Jingyue Wu
29bd1dd972 [SeparateConstOffsetFromGEP] skip optnone functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 02:34:41 +00:00
Jingyue Wu
8a8ff726ba [SeparateConstOffsetFromGEP] set PreservesCFG flag
SeparateConstOffsetFromGEP does not change the shape of the control flow graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227704 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 02:33:02 +00:00
Jingyue Wu
f15b696b79 [NVPTX] Emit .pragma "nounroll" for loops marked with nounroll
Summary:
CUDA driver can unroll loops when jit-compiling PTX. To prevent CUDA
driver from unrolling a loop marked with llvm.loop.unroll.disable is not
unrolled by CUDA driver, we need to emit .pragma "nounroll" at the
header of that loop.

This patch also extracts getting unroll metadata from loop ID metadata
into a shared helper function.

Test Plan: test/CodeGen/NVPTX/nounroll.ll

Reviewers: eliben, meheff, jholewinski

Reviewed By: jholewinski

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227703 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 02:27:45 +00:00
Adrian Prantl
58e57f1604 Fix PR22393. When recursively replacing an aggregate with a smaller
aggregate or scalar, the debug info needs to refer to the absolute offset
(relative to the entire variable) instead of storing the offset inside
the smaller aggregate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227702 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 00:58:04 +00:00
NAKAMURA Takumi
39f22d96f5 [CMake] LLVMLTO requires Intrinsics.gen since r227685 introduced llvm/Analysis/TargetTransformInfo.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227700 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 00:55:43 +00:00
NAKAMURA Takumi
e4fc4731fd [CMake] LLVMTarget requires Intrinsics.gen since r227669 introduced llvm/Analysis/TargetTransformInfo.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227699 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 00:55:32 +00:00
Chandler Carruth
685c2add65 [PM] Remove a bunch of stale TTI creation method declarations. I nuked
their definitions, but forgot to clean up all the declarations which are
in different files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227698 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-01 00:22:15 +00:00
Matt Arsenault
ea3e75f4d4 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227697 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 23:37:27 +00:00
Matt Arsenault
9061eb6d2e R600/SI: Only select cvt_flr/cvt_rpi with no NaNs.
These have different behavior from cvt_i32_f32 on NaN.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227693 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 21:28:13 +00:00
Saleem Abdulrasool
7708f5b68a X86: silence a GCC warning
GCC 4.9 gives the following warning:
  warning: enumeral and non-enumeral type in conditional expression
Cast the enumeral value to an integer within the ternary operation.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 17:56:11 +00:00
Diego Novillo
96a563ccfa Remove unused variable.
Summary:
This variable is only used inside an assert. This breaks builds with
asserts disabled.

OK for trunk?

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227691 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 17:17:33 +00:00
Aaron Ballman
2376747a12 Removed a spurious semicolon; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227690 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 15:18:47 +00:00
Simon Pilgrim
4c91d590d5 Removed SSE lane blend findCommutedOpIndices overrides. NFCI.
The default op indices frmo TargetInstrInfo::findCommutedOpIndices are being commuted so we don't need to do this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227689 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 15:16:30 +00:00
Simon Pilgrim
982005c23e [X86][SSE] Shuffle mask decode support for zero extend, scalar float/double moves and integer load instructions
This patch adds shuffle mask decodes for integer zero extends (pmovzx** and movq xmm,xmm) and scalar float/double loads/moves (movss/movsd).

Also adds shuffle mask decodes for integer loads (movd/movq).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227688 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 14:09:36 +00:00
Chandler Carruth
1937233a22 [PM] Switch the TargetMachine interface from accepting a pass manager
base which it adds a single analysis pass to, to instead return the type
erased TargetTransformInfo object constructed for that TargetMachine.

This removes all of the pass variants for TTI. There is now a single TTI
*pass* in the Analysis layer. All of the Analysis <-> Target
communication is through the TTI's type erased interface itself. While
the diff is large here, it is nothing more that code motion to make
types available in a header file for use in a different source file
within each target.

I've tried to keep all the doxygen comments and file boilerplate in line
with this move, but let me know if I missed anything.

With this in place, the next step to making TTI work with the new pass
manager is to introduce a really simple new-style analysis that produces
a TTI object via a callback into this routine on the target machine.
Once we have that, we'll have the building blocks necessary to accept
a function argument as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227685 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 11:17:59 +00:00
Kumar Sukhani
2d94613ec1 [asan][mips] Fix MIPS64 Asan mapping
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227684 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 10:43:18 +00:00
Saleem Abdulrasool
02897142df ARM: make a table more readable (NFC)
This adds some comments and splits the flag calculation on type boundaries to
make the table more readable.  Addresses some post-commit review comments to SVN
r227603.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227670 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 04:12:06 +00:00
Chandler Carruth
a6a87b595d [PM] Change the core design of the TTI analysis to use a polymorphic
type erased interface and a single analysis pass rather than an
extremely complex analysis group.

The end result is that the TTI analysis can contain a type erased
implementation that supports the polymorphic TTI interface. We can build
one from a target-specific implementation or from a dummy one in the IR.

I've also factored all of the code into "mix-in"-able base classes,
including CRTP base classes to facilitate calling back up to the most
specialized form when delegating horizontally across the surface. These
aren't as clean as I would like and I'm planning to work on cleaning
some of this up, but I wanted to start by putting into the right form.

There are a number of reasons for this change, and this particular
design. The first and foremost reason is that an analysis group is
complete overkill, and the chaining delegation strategy was so opaque,
confusing, and high overhead that TTI was suffering greatly for it.
Several of the TTI functions had failed to be implemented in all places
because of the chaining-based delegation making there be no checking of
this. A few other functions were implemented with incorrect delegation.
The message to me was very clear working on this -- the delegation and
analysis group structure was too confusing to be useful here.

The other reason of course is that this is *much* more natural fit for
the new pass manager. This will lay the ground work for a type-erased
per-function info object that can look up the correct subtarget and even
cache it.

Yet another benefit is that this will significantly simplify the
interaction of the pass managers and the TargetMachine. See the future
work below.

The downside of this change is that it is very, very verbose. I'm going
to work to improve that, but it is somewhat an implementation necessity
in C++ to do type erasure. =/ I discussed this design really extensively
with Eric and Hal prior to going down this path, and afterward showed
them the result. No one was really thrilled with it, but there doesn't
seem to be a substantially better alternative. Using a base class and
virtual method dispatch would make the code much shorter, but as
discussed in the update to the programmer's manual and elsewhere,
a polymorphic interface feels like the more principled approach even if
this is perhaps the least compelling example of it. ;]

Ultimately, there is still a lot more to be done here, but this was the
huge chunk that I couldn't really split things out of because this was
the interface change to TTI. I've tried to minimize all the other parts
of this. The follow up work should include at least:

1) Improving the TargetMachine interface by having it directly return
   a TTI object. Because we have a non-pass object with value semantics
   and an internal type erasure mechanism, we can narrow the interface
   of the TargetMachine to *just* do what we need: build and return
   a TTI object that we can then insert into the pass pipeline.
2) Make the TTI object be fully specialized for a particular function.
   This will include splitting off a minimal form of it which is
   sufficient for the inliner and the old pass manager.
3) Add a new pass manager analysis which produces TTI objects from the
   target machine for each function. This may actually be done as part
   of #2 in order to use the new analysis to implement #2.
4) Work on narrowing the API between TTI and the targets so that it is
   easier to understand and less verbose to type erase.
5) Work on narrowing the API between TTI and its clients so that it is
   easier to understand and less verbose to forward.
6) Try to improve the CRTP-based delegation. I feel like this code is
   just a bit messy and exacerbating the complexity of implementing
   the TTI in each target.

Many thanks to Eric and Hal for their help here. I ended up blocked on
this somewhat more abruptly than I expected, and so I appreciate getting
it sorted out very quickly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 03:43:40 +00:00
Saleem Abdulrasool
81674807cc ARM: support stack probe size on Windows on ARM
Now that -mstack-probe-size is piped through to the backend via the function
attribute as on Windows x86, honour the value to permit handling of non-default
values for stack probes.  This is needed /Gs with the clang-cl driver or
-mstack-probe-size with the clang driver when targeting Windows on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227667 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 02:26:37 +00:00
Kostya Serebryany
a1667be228 [fuzzer] add flags to run fuzzer in multiple parallel processes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227664 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 01:14:40 +00:00
Eric Christopher
9003c8d02f Remove the last vestiges of resetOperationActions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227648 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 00:21:17 +00:00
Eric Christopher
10b963632c Reuse a bunch of cached subtargets and remove getSubtarget calls
without a Function argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227647 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-31 00:06:45 +00:00
Eric Christopher
bcc0fa6a64 Reuse a bunch of cached subtargets and remove getSubtarget calls
without a Function argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227644 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 23:46:43 +00:00
Eric Christopher
8e55a9e78d Avoid using the cast and use the templated accessor function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227643 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 23:46:40 +00:00
Philip Reames
936801f755 Factor out statepoint verification into separate function. (NFC)
Patch by: Igor Laevsky

"Simple refactoring. This is done in preparation to support verification of invokable statepoints."

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227640 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 23:28:05 +00:00
Kostya Serebryany
05efde62f5 [fuzzer] Add a gtest-style test
Summary: Add one gtest-style test.

Test Plan: run on bot

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227639 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 23:26:57 +00:00
Eric Christopher
0def30471a Reuse a bunch of cached subtargets and remove getSubtarget calls
without a Function argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227638 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 23:24:40 +00:00
David Blaikie
cbae08dc4d Add ARM test for r227489, but XFAIL because this is actually more work than it appeared to be.
Also revert r227489 since it didn't actually fix the thing I thought I
was fixing (since the test case was targeting the wrong architecture
initially). The change might be correct & demonstrated by other test
cases, but it's not a priority for me to find those test cases right
now.

Filed PR22417 for the failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227632 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 23:04:39 +00:00
Chris Bieneman
2048ee38ab NFC. Making printOptionValues an API on the parser class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227626 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 22:16:01 +00:00
Alexey Samsonov
d9b3a8244a Fix memory leak in WinEHPrepare introduced in r227405.
This leak was detected by ASan bootstrap of LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227625 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 22:07:05 +00:00
Eric Christopher
e4c7a8188f Remove unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 22:02:36 +00:00
Eric Christopher
bc08db4cba Remove extraneous forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227623 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 22:02:34 +00:00
Eric Christopher
5882e66f5b Use the cached subtargets and remove calls to getSubtarget/getSubtargetImpl
without a Function argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227622 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 22:02:31 +00:00
Colin LeMahieu
a032778dcf [Hexagon] Adding vector shift instructions and tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227619 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 21:58:46 +00:00
Tom Stellard
24b999d7d0 R600/SI: Handle SI_SPILL_V96_RESTORE in SIRegisterInfo::eliminateFrameIndex()
This fixes a crash in Unigine Heaven.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 21:51:51 +00:00
Reid Kleckner
2389dc9d26 Silence "not all paths return a value" warning in MSVC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227614 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 21:30:57 +00:00
Colin LeMahieu
35e1281ec7 [Hexagon] Adding vector predicate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227613 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 21:24:06 +00:00
Colin LeMahieu
f99ddd0125 [Hexagon] Adding vector permutation instructions and tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 21:14:00 +00:00
Reid Kleckner
e359929517 Win64: Put a REX_W prefix on all TAILJMP* instructions
MSDN's x64 software conventions page says that this is one of the fixed
list of legal epilogues:
https://msdn.microsoft.com/en-us/library/tawsa7cb.aspx

Presumably this is how the unwinder distinguishes epilogue jumps from
in-function control flow.

Also normalize the way we place "## TAILCALL" comments on such jumps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227611 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 21:03:31 +00:00
Colin LeMahieu
a6c6e1ec6c [Hexagon] Adding vector multiplies. Cleaning up tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227609 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 20:56:54 +00:00
Colin LeMahieu
e288ebf31b [Hexagon] Adding XTYPE/COMPLEX instructions and cleaning up tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227607 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 20:08:37 +00:00
Chad Rosier
cea6171bda [AArch64] Make AArch64A57FPLoadBalancing output stable.
Add tie breaker to colorChainSet() sort so that processing order doesn't
depend on std::set order, which depends on pointer order, which is
unstable from run to run.

No test case as this is nearly impossible to reproduce.

Phabricator Review: http://reviews.llvm.org/D7265
Patch by Geoff Berry <gberry@codeaurora.org>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227606 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 19:55:40 +00:00
Adrian Prantl
aeeb71e276 Remove a redundant dyn_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227605 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 19:42:59 +00:00
Adrian Prantl
88deac4007 Inliner: Use replaceDbgDeclareForAlloca() instead of splicing the
instruction and generalize it to optionally dereference the variable.
Follow-up to r227544.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227604 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 19:37:48 +00:00
Saleem Abdulrasool
7a3c3f3a96 ARM: further correct .fpu directive handling
If the original FPU specification involved a restricted VFP unit (d16), ensure
that we reset the functionality when we encounter a new FPU type.  In
particular, if the user specified vfpv3-d16, but switched to a VFPv3 (which has
32 double precision registers), we would fail to reset the D16 feature, and
treat it as being equivalent to vfpv3-d16.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 19:35:18 +00:00
Renato Golin
71b1347acb Revert "Revert "Matching ARM change for r227481: DebugInfo: Teach Fast ISel to respect the debug location of comparisons in jumps.""
This reverts commit r227600, since that reverted the wrong comit. Sorry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227601 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 19:25:20 +00:00
Renato Golin
d0a4d9037b Revert "Matching ARM change for r227481: DebugInfo: Teach Fast ISel to respect the debug location of comparisons in jumps."
This reverts commit r227488 as it was failing ARM bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227600 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 19:18:58 +00:00
Colin LeMahieu
587083e6a4 [Hexagon] Adding XTYPE/ALU vector instructions. Organizing test files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227598 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 19:13:26 +00:00
Saleem Abdulrasool
9492802a37 ARM: improve caret diagnostics for invalid FPU name
In the case of an invalid FPU name, place the caret at the name rather than FPU
directive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227595 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 18:42:10 +00:00
Filipe Cabecinhas
1897b5c08c Check bit widths before trying to get a type.
Added a test case for it.
Also added run lines for the test case in r227566.

Bugs found with afl-fuzz

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227589 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 18:13:50 +00:00
Colin LeMahieu
dd62b7ae96 [Hexagon] Adding a number of vector load variants and organizing tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227588 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 18:09:44 +00:00
Zachary Turner
50418a0ac4 Move DebugInfo to DebugInfo/DWARF.
In preparation for adding PDB support to LLVM, this moves the
DWARF parsing code to its own subdirectory under DebugInfo, and
renames LLVMDebugInfo to LLVMDebugInfoDWARF.

This is purely a mechanical / build system change.

Differential Revision: http://reviews.llvm.org/D7269
Reviewed by: Eric Christopher

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227586 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 18:07:45 +00:00
Saleem Abdulrasool
8baa31e81c ARM: correct handling of .fpu directive
The FPU directive permits the user to switch the target FPU, enabling
instructions that would be otherwise unavailable.  However, when configuring the
new subtarget features, we would not enable the implied functions for newer
FPUs.  This would result in invalid rejection of valid input.  Ensure that we
inherit the implied FPU functionality when enabling newer versions of the FPU.
Fortunately, these are mostly hierarchical, unlike the CPUs.

Addresses PR22395.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227584 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 17:58:25 +00:00
Sanjay Patel
3460950d15 tidy up; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227582 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 16:58:58 +00:00
Chandler Carruth
b4a44570f6 [PM] Sink the population of the pass manager with target-specific
analyses back into the LTO code generator.

The pass manager builder (and the transforms library in general)
shouldn't be referencing the target machine at all.

This makes the LTO population work like the others -- the data layout
and target transform info need to be pre-populated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227576 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 13:33:42 +00:00
Chandler Carruth
2ec788d43f Fix a warning introduced by r227557 due to a default label in a fully
covering switch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227575 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 13:30:43 +00:00
NAKAMURA Takumi
d379c6b491 [Cygming] Seek also chkstk_ms, or JIT fails with DLL builds. It is fixup for r227519.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227574 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 13:01:19 +00:00
Toma Tabacu
71dc8ece4f [mips] Manually replace JAL pseudo-instructions with their JALR equivalent, instead of using InstAlias.
Summary:
This is needed by the .cprestore assembler directive.

This directive needs to be able to insert an LW instruction after every JALR replacement of a JAL pseudo-instruction
(and never after a JALR which has NOT been a result of a pseudo-instruction replacement).

The problem with using InstAlias for these is that after it replaces the pseudo-instruction, we can't find out if the resulting JALR instruction
was generated by an InstAlias or not, so we don't know whether or not to insert our LW instruction.

By replacing it manually, we know when the pseudo-instruction replacement happens and we can insert the LW instruction correctly.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: emaste, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227568 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 11:18:50 +00:00
Filipe Cabecinhas
8cf149dbad [bitcode reader] Fix an assert on invalid type tables
Bug found with afl-fuzz

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227566 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 10:57:58 +00:00
Hao Liu
e7769db118 [LoopVectorize] Induction variables: support arbitrary constant step.
Previously, only -1 and +1 step values are supported for induction variables. This patch extends LV to support
arbitrary constant steps.
Initial patch by Alexey Volkov. Some bug fixes are added in the following version.

Differential Revision: http://reviews.llvm.org/D6051 and http://reviews.llvm.org/D7193


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227557 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 05:02:21 +00:00
Hao Liu
7d3a44a692 [AArch64]Fix PR21675, a bug about lowering llvm.ctpop.i32. We should noot use "DAG.getUNDEF(MVT::v8i8)" to get all zero vector.
Patch by Wei-cheng Wang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227550 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 02:13:53 +00:00
Eric Christopher
dd5e9f624b Use the cached subtarget in PPCFrameLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227548 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 02:11:26 +00:00
Eric Christopher
87dd120c6a Migrate some of PPC away from the use of bare getSubtarget/getSubtargetImpl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227547 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 02:11:24 +00:00
Eric Christopher
31f58f2c74 Migrage PPCRegisterInfo to use the cached subtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227546 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 02:11:21 +00:00
Adrian Prantl
e413c8afe0 Fix PR22386. The inliner moves static allocas to the entry basic block
so we need to move the dbg.declare intrinsics that describe them, too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227544 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:55:25 +00:00
Eric Christopher
99a3df3401 Migrate a bare getSubtarget call to query the MachineFunction
for the target dependent one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227542 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:50:09 +00:00
Eric Christopher
b42dc65111 Migrate NVPTXISelLowering to take the subtarget that it's dependent
upon as an argument and store/use that in the entire function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227541 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:50:07 +00:00
Eric Christopher
f66d626182 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:41:01 +00:00
Eric Christopher
7417d92e56 Migrate NVPTXISelDAGToDAG's getSubtarget to a runOnMachineFunction
version. Update NVPTXInstrInfo accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227538 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:40:59 +00:00
Eric Christopher
7c185f3674 Remove calls to bare getSubtarget and clean up the functions
accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227535 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:30:01 +00:00
Akira Hatanaka
6953381b0c [LTO] Scan all per-function subtargets when collecting runtime library names.
accumulateAndSortLibcalls in LTOCodeGenerator.cpp collects names of runtime
library functions which are used to identify user-defined functions that should
be protected. Previously, this function would only scan the TargetLowering
object belonging to the "main" subtarget for the library function names. This
commit changes it to scan all per-function subtargets.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227533 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:16:24 +00:00
Eric Christopher
1ed01c9439 Remove a few getSubtarget calls in AArch64 pass manager initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227531 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:10:26 +00:00
Eric Christopher
3b386bfcd2 Clean up some uses of getSubtarget in AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227530 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:10:24 +00:00
Eric Christopher
5e337ee512 This only needs TargetInstrInfo, not the specialized one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227529 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 01:10:18 +00:00
Chris Bieneman
39687b93fa iOS doesn't have crt_externs.h available, so we fall back to the posix method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227521 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 00:10:39 +00:00
Reid Kleckner
4c757e0907 x86: Remove unused variables not caught by MSVC =P
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227520 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30 00:05:39 +00:00
Reid Kleckner
c9fbc97e95 x86: Fix large model calls to __chkstk for dynamic allocas
In the large code model, we now put __chkstk in %r11 before calling it.

Refactor the code so that we only do this once. Simplify things by using
__chkstk_ms instead of __chkstk on cygming. We already use that symbol
in the prolog emission, and it simplifies our logic.

Second half of PR18582.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227519 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 23:58:04 +00:00
Eric Christopher
5d51c0ee04 Remove unnecessary calls to getSubtarget/getSubtargetImpl from the
MSP430 backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227517 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 23:46:42 +00:00
Eric Christopher
a5119bd010 Remove unused header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227516 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 23:46:39 +00:00
Sanjay Patel
65d9a05c76 Change SmallVector param to the more general ArrayRef; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227514 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 23:35:04 +00:00
Eric Christopher
ca6d2a825c Get rid of a few calls through the subtarget to get the ABI
that's actually sitting on the target machine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227513 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 23:27:45 +00:00
Eric Christopher
2d64c553b4 Remove most of the TargetMachine::getSubtarget/getSubtargetImpl
calls that don't take a Function argument from Mips. Notable
exceptions: the AsmPrinter and MipsTargetObjectFile. The
latter needs to be fixed, and the former will be fixed when the
general AsmPrinter changes happen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227512 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 23:27:36 +00:00
Reid Kleckner
850420cd14 x86: Remove the W64ALLOCA pseudo
This is just an alias for CALL64pcrel32, and we can just use that opcode
with explicit defs in the MI.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227508 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 23:09:37 +00:00
Kostya Serebryany
4ac4c33f2d [fuzzer] add -use_full_coverage_set=1 which solves FullCoverageSetTest. This does not scale very well yet, but might be a good start.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227507 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 23:01:07 +00:00
Chad Rosier
880af70fa1 [AArch64] Add INITIALIZE_PASS macros to AArch64A57FPLoadBalancing.
These are needed so this pass will produce output when
e.g. -print-after-all is used.

Phabricator Review: http://reviews.llvm.org/D7264
Patch by Geoff Berry <gberry@codeaurora.org>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227506 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 22:57:37 +00:00
Reid Kleckner
cb867e4ac4 Update comments to use unreachable instead of llvm.trap, as implemented now
win64: Call __chkstk through a register with the large code model

Fixes half of PR18582. True dynamic allocas will still have a
CALL64pcrel32 which will fail.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227503 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 22:33:00 +00:00
Reid Kleckner
23358b1d74 Update comments to use unreachable instead of llvm.trap, as implemented now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227502 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 22:32:26 +00:00
James Molloy
3eb64280e1 [LoopReroll] Alter the data structures used during reroll validation.
The validation algorithm used an incremental approach, building each
iteration's data structures temporarily, validating them, then
adding them to a global set.

This does not scale well to having multiple sets of Root nodes, as the
set of instructions used in each iteration is the union over all
the root nodes. Therefore, refactor the logic to create a single, simple
container to which later logic then refers. This makes it simpler
control-flow wise to make the creation of the container more complex with
the addition of multiple root sets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227499 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 21:52:03 +00:00
Colin LeMahieu
5a75088c2f [Hexagon] Organizing tests and adding a few missing jump instruction encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227498 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 21:47:15 +00:00
Colin LeMahieu
d6ce18cdf9 [Hexagon] Adding missing instruction encodings and tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227495 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 21:30:22 +00:00
Colin LeMahieu
d742d5db60 [Hexagon] Adding alu vector instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227493 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 21:09:30 +00:00
Sanjay Patel
26c81cc870 [GVN] don't propagate equality comparisons of FP zero (PR22376)
In http://reviews.llvm.org/D6911, we allowed GVN to propagate FP equalities
to allow some simple value range optimizations. But that introduced a bug
when comparing to -0.0 or 0.0: these compare equal even though they are not
bitwise identical.

This patch disallows propagating zero constants in equality comparisons. 
Fixes: http://llvm.org/bugs/show_bug.cgi?id=22376

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227491 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 20:51:49 +00:00
Aaron Ballman
1b7b2597d5 All signal handlers are required to have C language linkage in C++. This does not fix all signal handlers, but does fix the most recent one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227490 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 20:48:34 +00:00
David Blaikie
0cb00dbc56 Matching ARM change for r227481: DebugInfo: Teach Fast ISel to respect the debug location of comparisons in jumps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227488 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 20:23:47 +00:00
Matt Arsenault
fa711758df R600/SI: Implement enableAggressiveFMAFusion
Add tests for the various combines. This should
always be at least cycle neutral on all subtargets for f64,
and faster on some. For f32 we should prefer selecting
v_mad_f32 over v_fma_f32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227484 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 19:34:32 +00:00
Matt Arsenault
c416d94735 R600/SI: Add subtarget feature for if f32 fma is fast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227483 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 19:34:25 +00:00
Matt Arsenault
30a5d21457 R600/SI: Fix tonga's basic scheduling model
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227482 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 19:34:18 +00:00
David Blaikie
1ba26f8da1 DebugInfo: Teach Fast ISel to respect the debug location of comparisons in jumps
The use of the DbgLoc in FastISel is probably something we should fix.
It's prone to leaking the wrong location into instructions - we should
have a clear chain of custody from the debug location of an IR
Instruction to that of a MachineInstr to avoid such leakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227481 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 19:09:18 +00:00