121090 Commits

Author SHA1 Message Date
Justin Bogner
387ab5afe7 Revert "Constant propagation after hiting llvm.assume"
This was also failing bootstrap:

http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build

This reverts r245265.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-18 07:00:34 +00:00
Piotr Padlewski
5982c0a728 Constant propagation after hiting llvm.assume
After hitting @llvm.assume(X) we can:
- propagate equality that X == true
- if X is icmp/fcmp (with eq operation), and one of operand
  is constant we can change all variables with constants in the same BasicBlock

http://reviews.llvm.org/D11918

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245265 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-18 03:55:30 +00:00
Hans Wennborg
8d5e5d4170 Doxygen: add build option to use svg instead of png files for graphs
Differential Revision: http://reviews.llvm.org/D11994

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245256 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 23:24:17 +00:00
Eric Christopher
1084c3397c Add an exposed variable for which c++ compiler we're using for our
build.

Patch by Chris Bieneman!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245255 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 22:46:26 +00:00
Dan Gohman
440cf86615 [WebAssembly] Don't default to ELF in the triple.
WebAssembly doesn't yet have a specified binary format, and it may not
end up being ELF, so we don't want the Triple class defaulting to ELF
for it at this time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245254 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 22:37:56 +00:00
Guozhi Wei
c8cfff3bc8 Align SP adjustment in function getSPAdjust
This commit adds a new function TargetFrameLowering::alignSPAdjust
and calls it from TargetInstrInfo::getSPAdjust. It fixes PR24142.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245253 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 22:36:27 +00:00
Dan Gohman
f201263192 [WebAssembly] Make getArchTypePrefix return "wasm".
The arch prefix string isn't currently being used for anything on
WebAssembly, but if it were to be used, it makes sense to use the
same arch prefix string for wasm32 and wasm64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245252 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 22:35:40 +00:00
Alex Lorenz
fb764b70be MIR Serialization: Serialize the local offsets for the stack objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245249 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 22:17:42 +00:00
Alex Lorenz
e45daf6294 MIR Serialization: Serialize the memory operand's range metadata node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245247 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 22:09:52 +00:00
Alex Lorenz
971d8c0000 MIR Serialization: Serialize the memory operand's noalias metadata node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245246 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 22:08:02 +00:00
Alex Lorenz
ed8c969d30 MIR Serialization: Serialize the memory operand's alias scope metadata node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 22:06:40 +00:00
Alex Lorenz
d3ff211ac7 MIR Serialization: Serialize the memory operand's TBAA metadata node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 22:05:15 +00:00
David Majnemer
d8ea8746b1 [WinEHPrepare] Replace unreasonable funclet terminators with unreachable
It is possible to be in a situation where more than one funclet token is
a valid SSA value.  If we see a terminator which exits a funclet which
doesn't use the funclet's token, replace it with unreachable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 20:56:39 +00:00
Douglas Katzman
9db597ef19 [SPARC]: recognize '.' as the start of an assembler expression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245232 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 19:55:01 +00:00
James Molloy
9daba6f571 [ARM] Fix crash when targetting CPU without NEON
We emulate a scalar vmin/vmax with NEON instructions as they don't exist in the VFP ISA. So only mark these as legal when NEON is available.

Found here: https://code.google.com/p/chromium/issues/detail?id=521671

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245231 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 19:37:12 +00:00
Igor Laevsky
dcf748827b [ScalarEvolutionExpander] Reuse findExistingExpansion during expansion cost calculation for division
Primary purpose of this change is to reuse existing code inside findExistingExpansion. However it introduces very slight semantic change - findExistingExpansion now looks into exiting blocks instead of a loop latches. Originally heuristic was based on the fact that we want to look at the loop exit conditions. And since all exiting latches will be listed in the ExitingBlocks, heuristic stays roughly the same.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245227 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 16:37:04 +00:00
Silviu Baranga
1127a30ffe [CostModel][AArch64] Increase cost of vector insert element and add missing cast costs
Summary:
Increase the estimated costs for insert/extract element operations on
AArch64. This is motivated by results from benchmarking interleaved
accesses.

Add missing costs for zext/sext/trunc instructions and some integer to
floating point conversions. These costs were previously calculated
by scalarizing these operation and were affected by the cost increase of
the insert/extract element operations.

Reviewers: rengolin

Subscribers: mcrosier, aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245226 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 16:05:09 +00:00
Silviu Baranga
170aefe60c [CostModel][ARM] Increase cost of insert/extract operations
Summary:
This change limits the minimum cost of an insert/extract
element operation to 2 in cases where this would result
in mixing of NEON and VFP code.

Reviewers: rengolin

Subscribers: mssimpso, aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245225 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 15:57:05 +00:00
Igor Laevsky
d9a2fcb1eb [BasicAliasAnalysis] Do not check ModRef table for intrinsics
All possible ModRef behaviours can be completely represented using existing LLVM IR attributes.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245224 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 15:56:56 +00:00
Artur Pilipenko
f317669480 Take alignment into account in isSafeToSpeculativelyExecute and isSafeToLoadUnconditionally.
Reviewed By: hfinkel, sanjoy, MatzeB

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245223 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 15:54:26 +00:00
Benjamin Kramer
ac67f04f79 Extend MCAsmLexer so that it can peek forward several tokens
This commit adds a virtual `peekTokens()` function to `MCAsmLexer`
which can peek forward an arbitrary number of tokens.

It also makes the `peekTok()` method call `peekTokens()` method, but
only requesting one token.

The idea is to better support targets which more more ambiguous
assembly syntaxes.

Patch by Dylan McKay!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245221 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 14:35:25 +00:00
Aaron Ballman
df09c6b4bf Correcting a -Woverflow warning where 0xFFFF was overflowing an implicit constant conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245220 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 14:25:57 +00:00
Joseph Tremoulet
08b10aaafe [WinEHPrepare] Fix catchret successor phi demotion
Summary:
When demoting an SSA value that has a use on a phi and one of the phi's
predecessors terminates with catchret, the edge needs to be split and the
load inserted in the new block, else we'll still have a cross-funclet SSA
value.

Add a test for this, and for the similar case where a def to be spilled is
on and invoke and a critical edge, which was already implemented but
missing a test.

Reviewers: majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245218 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 13:51:37 +00:00
Tobias Grosser
378e97e50c Revert "Disable targetdatalayoutcheck"
I committed by accident a local hack that should not have made it upstream.
Sorry for the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245212 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 10:58:03 +00:00
Tobias Grosser
79224a7c6f Disable targetdatalayoutcheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 10:56:35 +00:00
Daniel Sanders
07c9aff210 [mips] [IAS] Add support for the DLA pseudo-instruction and fix problems with DLI
Summary: It is the same as LA, except that it can also load 64-bit addresses and it only works on 64-bit MIPS architectures.

Reviewers: tomatabacu, seanbruno, vkalintiris

Subscribers: brooks, seanbruno, emaste, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 10:11:55 +00:00
Michael Kuperstein
426b44f1fa [GMR] isNonEscapingGlobalNoAlias() should look through Bitcasts/GEPs when looking at loads.
This fixes yet another case from PR24288.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245207 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 10:06:08 +00:00
James Molloy
4c1b80c626 Remove hand-rolled matching for fmin and fmax.
SDAGBuilder now does this all for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245198 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 07:13:20 +00:00
James Molloy
2fbab98a00 Rip out hand-rolled matching code for VMIN, VMAX, VMINNM and VMAXNM
This is no longer needed - SDAGBuilder will do this for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245197 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 07:13:15 +00:00
James Molloy
54a2f7b9c7 Generate FMINNAN/FMINNUM/FMAXNAN/FMAXNUM from SDAGBuilder.
These only get generated if the target supports them. If one of the variants is not legal and the other is, and it is safe to do so, the other variant will be emitted.

For example on AArch32 (V8), we have scalar fminnm but not fmin.

Fix up a couple of tests while we're here - one now produces better code, and the other was just plain wrong to start with.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245196 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 07:13:10 +00:00
Karthik Bhat
75f2d37686 Fix PR24469 resulting from r245025 and re-enable dead store elimination across basicblocks.
PR24469 resulted because DeleteDeadInstruction in handleNonLocalStoreDeletion was
deleting the next basic block iterator. Fixed the same by resetting the basic block iterator
post call to DeleteDeadInstruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245195 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 05:51:39 +00:00
David Majnemer
a3711bed81 Revert "[InstCombinePHI] Partial simplification of identity operations."
This reverts commit r244887, it caused PR24470.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245194 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 03:11:26 +00:00
Chandler Carruth
bfe1f1c5a3 [PM] Port ScalarEvolution to the new pass manager.
This change makes ScalarEvolution a stand-alone object and just produces
one from a pass as needed. Making this work well requires making the
object movable, using references instead of overwritten pointers in
a number of places, and other refactorings.

I've also wired it up to the new pass manager and added a RUN line to
a test to exercise it under the new pass manager. This includes basic
printing support much like with other analyses.

But there is a big and somewhat scary change here. Prior to this patch
ScalarEvolution was never *actually* invalidated!!! Re-running the pass
just re-wired up the various other analyses and didn't remove any of the
existing entries in the SCEV caches or clear out anything at all. This
might seem OK as everything in SCEV that can uses ValueHandles to track
updates to the values that serve as SCEV keys. However, this still means
that as we ran SCEV over each function in the module, we kept
accumulating more and more SCEVs into the cache. At the end, we would
have a SCEV cache with every value that we ever needed a SCEV for in the
entire module!!! Yowzers. The releaseMemory routine would dump all of
this, but that isn't realy called during normal runs of the pipeline as
far as I can see.

To make matters worse, there *is* actually a key that we don't update
with value handles -- there is a map keyed off of Loop*s. Because
LoopInfo *does* release its memory from run to run, it is entirely
possible to run SCEV over one function, then over another function, and
then lookup a Loop* from the second function but find an entry inserted
for the first function! Ouch.

To make matters still worse, there are plenty of updates that *don't*
trip a value handle. It seems incredibly unlikely that today GVN or
another pass that invalidates SCEV can update values in *just* such
a way that a subsequent run of SCEV will incorrectly find lookups in
a cache, but it is theoretically possible and would be a nightmare to
debug.

With this refactoring, I've fixed all this by actually destroying and
recreating the ScalarEvolution object from run to run. Technically, this
could increase the amount of malloc traffic we see, but then again it is
also technically correct. ;] I don't actually think we're suffering from
tons of malloc traffic from SCEV because if we were, the fact that we
never clear the memory would seem more likely to have come up as an
actual problem before now. So, I've made the simple fix here. If in fact
there are serious issues with too much allocation and deallocation,
I can work on a clever fix that preserves the allocations (while
clearing the data) between each run, but I'd prefer to do that kind of
optimization with a test case / benchmark that shows why we need such
cleverness (and that can test that we actually make it faster). It's
possible that this will make some things faster by making the SCEV
caches have higher locality (due to being significantly smaller) so
until there is a clear benchmark, I think the simple change is best.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245193 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 02:08:17 +00:00
Chandler Carruth
df8fbfc774 [ADT] Teach FoldingSet to be movable.
This is a very minimal move support - it leaves the moved-from object in
a zombie state that is only valid for destruction and move assignment.
This seems fine to me, and leaving it in the default constructed state
would require adding more state to the object and potentially allocating
memory (!!!) and so seems like a Bad Idea.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 23:17:27 +00:00
Craig Topper
28d23b88be [TableGen] Use range-based for loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245191 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 21:27:10 +00:00
Craig Topper
c18d928f5d [TableGen] Move the ConversionRow vector into the ConversionTable instead of copying.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 21:27:08 +00:00
Benjamin Kramer
21b0266600 [SimplifyLibCalls] Drop default template args. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245189 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 21:16:37 +00:00
Benjamin Kramer
282ee13246 [IR] Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245188 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 21:16:26 +00:00
Sanjay Patel
69ab373dfe transform fmin/fmax calls when possible (PR24314)
If we can ignore NaNs, fmin/fmax libcalls can become compare and select
(this is what we turn std::min / std::max into).

This IR should then be optimized in the backend to whatever is best for
any given target. Eg, x86 can use minss/maxss instructions.

This should solve PR24314:
https://llvm.org/bugs/show_bug.cgi?id=24314

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 20:18:19 +00:00
Sanjoy Das
334643759f [LSR][NFC] Don’t duplicate entity name at the beginning of the comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245183 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 18:22:46 +00:00
Sanjoy Das
8c359c53f7 [LSR][NFC] Use camelCase for method names in Formula and RegUseTracker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245182 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 18:22:43 +00:00
Sanjay Patel
8ddc374aa4 use SDValue bool operator; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 17:54:28 +00:00
Yaron Keren
332b3b1013 Add missing include guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245173 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 07:55:08 +00:00
David Majnemer
a0a7755665 Revert "Add support for cross block dse. This patch enables dead stroe elimination across basicblocks."
This reverts commit r245025, it caused PR24469.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245172 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 07:11:59 +00:00
David Majnemer
2363b41211 [InstCombine] Replace an and+icmp with a trunc+icmp
Bitwise arithmetic can obscure a simple sign-test.  If replacing the
mask with a truncate is preferable if the type is legal because it
permits us to rephrase the comparison more explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 07:09:17 +00:00
Chandler Carruth
5df1207c2c Revert r244127: [PM] Remove a failed attempt to port the CallGraph
analysis ...

It turns out that we *do* need the old CallGraph ported to the new pass
manager. There are times where this model of a call graph is really
superior to the one provided by the LazyCallGraph. For example,
GlobalsModRef very specifically needs the model provided by CallGraph.

While here, I've tried to make the move semantics actually work. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 06:35:19 +00:00
David Majnemer
7e9986fa34 [X86] Widen the 'AND' mask if doing so shrinks the encoding size
We can set additional bits in a mask given that we know the other
operand of an AND already has some bits set to zero.  This can be more
efficient if doing so allows us to use an instruction which implicitly
sign extends the immediate.

This fixes PR24085.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 04:52:11 +00:00
NAKAMURA Takumi
00225dcc22 MergeFunc: Quick fix for r245140, Ignore second, aka Function*, in sorting.
Don't assume second would be ordered in the module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-16 02:41:23 +00:00
Yaron Keren
c118a5970b Try to appease VS 2015 warnings from http://reviews.llvm.org/D11890
ByteSize and BitSize should not be size_t but unsigned, considering

1) They are at most 2^16 and 2^19, respectively.
2) BitSize is an argument to Type::getIntNTy which takes unsigned.

Also, use the correct utostr instead itostr and cache the string result.

Thanks to James Touton for reporting this!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245167 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-15 19:06:14 +00:00
Sanjay Patel
8e0b9c201b [x86] enable machine combiner reassociations for scalar single-precision minimums
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245166 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-15 17:01:54 +00:00