Commit Graph

40770 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
de78f05cf7 Partially revert r111155. It looks like MSVC is calling an operator<() that
clang says is unused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:24:54 +00:00
Jim Grosbach
63249347c2 track local frame size in MFI, not local to the pass, since PEI needs it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 18:06:15 +00:00
Jakob Stoklund Olesen
5ba3e4d75d Remove unused functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 17:18:20 +00:00
Jakob Stoklund Olesen
a649ab542d Remove unused functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 17:18:18 +00:00
Bob Wilson
45cdd7fd61 Remove unused code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 17:06:03 +00:00
Dan Gohman
1895991a08 To create a copy of a SmallVector with an element removed from the
middle, copy the elements in two groups, rather than copying all the
elements and then doing an erase on the middle of the result. These
are SmallVectors, so we shouldn't expect to hit dynamic allocation
in the common case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111151 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:57:24 +00:00
Chris Lattner
abf8f9cbb8 silence a vc2010 warning: " result of 32-bit shift implicitly converted to
64 bits (was 64-bit shift intended?)", pointed out by 'nobled' on llvmdev


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:35:20 +00:00
Dan Gohman
0c5e95df57 Tidy whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:34:09 +00:00
Dan Gohman
619d3324bd Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:31:39 +00:00
Dan Gohman
8d9c7a6701 Use const_iterator in a few places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:30:01 +00:00
Dan Gohman
2d16fc5ff0 Use iterators instead of indices in a few more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:27:53 +00:00
Dan Gohman
e28d7922f7 Micro-optimize SCEVConstant comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:25:35 +00:00
Dan Gohman
2f199f9952 Move SCEVNAryExpr's virtual member functions out of line, and convert
them to iterators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:21:27 +00:00
Dan Gohman
bb85409b51 Use iterators instead of indices in simple cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:16:11 +00:00
Dan Gohman
c4f77983d8 Avoid gratuitous inefficiency in ifndef NDEBUG code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:13:54 +00:00
Dan Gohman
d3f171d66f Make one getAddExpr call when analyzing a+b+c+d+e+... instead of one
for each add instruction. Ditto for Mul.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111136 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 16:03:49 +00:00
Dan Gohman
57560da3f5 Delete an unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 15:57:14 +00:00
Dan Gohman
3e22b7c916 Instead of having CollectSubexpr's categorize operands as interesting or
uninteresting, just put all the operands on one list and make
GenerateReassociations make the decision about what's interesting.
This is simpler, and it avoids an extra ScalarEvolution::getAddExpr call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 15:50:00 +00:00
Dan Gohman
4065f60912 Put add operands in ScalarEvolution-canonical order, when convenient.
This isn't necessary, because ScalarEvolution sorts them anyway,
but it's tidier this way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 15:39:27 +00:00
Dan Gohman
3063410e52 Add hooks to FoldingSetTrait to allow specializations to provide
implementations of equality comparison and hash computation. This
can be used to optimize node lookup by avoiding creating lots of
temporary ID values just for hashing and comparison purposes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 15:30:39 +00:00
Dan Gohman
6616f7e2f1 Reverse the order of GetNodeProfile's arguments, for consistency
with FoldingSetTrait::Profile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111127 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 14:53:42 +00:00
Dan Gohman
ebd9923bd8 Avoid #include <ScalarEvolution.h> in LoopSimplify.cpp, which doesn't
actually use ScalarEvolution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111124 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 14:44:03 +00:00
Dan Gohman
7a4994356b Instead, teach SimplifyCFG to trim non-address-taken blocks from
indirectbr destination lists.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 14:41:14 +00:00
Dan Gohman
9883b95a2b Revert r111058, the lint check for indirectbr successors that aren't
address-taken. This can occur normally, if the code which took the
address got DCEd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 14:39:19 +00:00
Argyrios Kyrtzidis
8c8b9ee8c8 Revert r111082. No warnings for this common pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 10:27:23 +00:00
Mikhail Glushenkov
b3d36293c2 llvmc: remove dynamic plugins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 07:07:12 +00:00
Eric Christopher
c0b2a2018a Rework how the non-sse2 memory barrier is lowered so that the
encoding is correct for the built-in assembler.

Based on a patch from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 21:51:50 +00:00
Argyrios Kyrtzidis
7268d97ae6 Add ATTRIBUTE_UNUSED to methods that are not supposed to be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 21:35:10 +00:00
Chris Lattner
132929aa9e improve indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 17:26:09 +00:00
Bob Wilson
136e491280 T2I_rbin_irs rr variant is for disassembly only, so don't provide a pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111068 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 03:18:29 +00:00
Ted Kremenek
865287de4a Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111063 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 01:55:09 +00:00
Dan Gohman
c2f40066bb LoopSimplify shouldn't split loop backedges that use indirectbr. PR7867.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 00:43:09 +00:00
Dan Gohman
e2c6d131d1 Teach SimplifyCFG how to simplify indirectbr instructions.
- Eliminate redundant successors.
 - Convert an indirectbr with one successor into a direct branch.

Also, generalize SimplifyCFG to be able to be run on a function entry block.
It knows quite a few simplifications which are applicable to the entry
block, and it only needs a few checks to avoid trouble with the entry block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111060 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 00:29:42 +00:00
Jim Grosbach
3d72367d30 Add a local stack object block allocation pass. This is still an
experimental pass that allocates locals relative to one another before
register allocation and then assigns them to actual stack slots as a block
later in PEI. This will eventually allow targets with limited index offset
range to allocate additional base registers (not just FP and SP) to
more efficiently reference locals, as well as handle situations where
locals cannot be referenced via SP or FP at all (dynamic stack realignment
together with variable sized objects, for example). It's currently
incomplete and almost certainly buggy. Work in progress.

Disabled by default and gated via the -enable-local-stack-alloc command
line option.

rdar://8277890



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 00:15:52 +00:00
Dan Gohman
61556e3a94 Add a lint check for an indirectbr destination which has not
had its address taken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 23:56:28 +00:00
Bob Wilson
20d8e4e7aa Add a Thumb2 t2RSBrr instruction for disassembly only.
This fixes another part of PR7792.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 23:24:25 +00:00
Jakob Stoklund Olesen
0a2b2a1497 Clean up the Spiller.h interface.
The earliestStart argument is entirely specific to linear scan allocation, and
can be easily calculated by RegAllocLinearScan.

Replace std::vector with SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111055 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 22:56:53 +00:00
Bob Wilson
703af3ab12 Temporarily disable tail calls on ARM to work around some linker problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 22:43:33 +00:00
Bob Wilson
38aa2871fc Move the Thumb2 SSAT and USAT optional shift operator out of the
instruction opcode.  This fixes part of PR7792.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 21:48:10 +00:00
Dan Gohman
0ad2c7ace8 Various optimizations. Don't compare two loops' depths
when they are the same loop. Don't compare two instructions'
loop depths when they are in the same block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 21:24:58 +00:00
Jakob Stoklund Olesen
fc412d85c4 Implement splitting inside a single block.
When a live range is contained a single block, we can split it around
instruction clusters. The current approach is very primitive, splitting before
and after the largest gap between uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 21:18:48 +00:00
Dan Gohman
e62d58884a Fix LSR's ExtractImmediate and ExtractSymbol to avoid calling
ScalarEvolution::getAddExpr, which can be pretty expensive, when nothing
has changed, which is pretty common.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 21:17:19 +00:00
Bruno Cardoso Lopes
30baa63474 Add comments to some pattern fragments in x86
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 20:39:01 +00:00
Dan Gohman
9cba97886c When testing whether one loop contains another, test this directly
rather than testing whether the loop contains the other's header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 20:23:25 +00:00
Dan Gohman
9f1fb42b7e Add a const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 20:17:27 +00:00
Dan Gohman
58a85b96b8 When creating a symmetric SCEV with a constant operand, put
the constant operand on the left, as that's where ScalarEvolution
will end up canonicalizing to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 20:17:14 +00:00
Dan Gohman
71c4144076 An add recurrence is loop-invariant in any loop inside of its
associated loop. This avoids potentially expensive traversals
of the add recurrence's operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 20:11:39 +00:00
Bob Wilson
6daf2a254b Refactor the code for disassembling Thumb2 saturate instructions along the
same lines as the change I made for ARM saturate instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 19:04:21 +00:00
Dale Johannesen
1b4051095d Revert 110491. While not wrong, it was based on a
misanalysis and is undesirable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 18:43:45 +00:00
Bruno Cardoso Lopes
bb0a9489e0 Fix comment to reflect code, and remove an unused argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 17:50:47 +00:00
Bruno Cardoso Lopes
bbadd39bbb Improve comment to make explicit why not to touch this could before JIT goes MC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 17:44:10 +00:00
Jim Grosbach
c92bb50a0c tidy up whitespace a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 16:55:08 +00:00
Eric Christopher
63f02ac349 Revert last patch and r110954 as I meant to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111001 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 02:37:50 +00:00
Eric Christopher
4404c00db6 Revert r110954 for now, pseudo instructions can't make it through to the JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 02:30:00 +00:00
Jakob Stoklund Olesen
2780d3ca81 Let LiveInterval::addRange extend existing ranges, it will verify that value
numbers match. The old check could accidentally leave holes in openli.

Also let useIntv add all ranges for the phi-def value inserted by
enterIntvAtEnd. This works as long at the value mapping is established in
enterIntvAtEnd.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 01:05:26 +00:00
Jakob Stoklund Olesen
00667a54f2 Remember to actually update SplitAnalysis statistics now that we have a fancy
function to do it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 01:05:23 +00:00
Nate Begeman
7f1f4089a1 Reapply this transformation now that it is passing the external test which it previously failed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 00:17:53 +00:00
Nate Begeman
a966af2f4c Move some code from Verifier into SVI::isValidOperands. This allows us to catch bad shufflevector operations when they are created, rather than waiting for someone to notice later on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 00:16:46 +00:00
Dan Gohman
ca2835411f Trim #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110983 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 23:56:03 +00:00
Dan Gohman
95df619a40 Tidy up whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 23:50:08 +00:00
Dan Gohman
9e2f6284bc Use .empty() instead of .size().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 23:46:28 +00:00
Jakob Stoklund Olesen
09c45d2fe8 Handle an empty dupli.
This can happen if the original interval has been broken into two disconnected
parts. Ideally, we should be able to detect when the graph is disconnected and
create separate intervals, but that code is not implemented yet.

Example:

Two basic blocks are both branching to a loop header. Our interval is defined in
both basic blocks, and live into the loop along both edges.

We decide to split the interval around the loop. The interval is split into an
inside part and an outside part. The outside part now has two disconnected
segments, one in each basic block.

If we later decide to split the outside interval into single blocks, we get one
interval per basic block and an empty dupli for the remainder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110976 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 23:02:57 +00:00
Jakob Stoklund Olesen
2dee7a527b Update the SplitAnalysis statistics as uses are moved from curli to the new
split intervals. THis means the analysis can be used for multiple splits as long
as curli doesn't shrink.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 23:02:55 +00:00
Chris Lattner
1522ce9770 fix PR7876: If ipsccp decides that a function's address is taken
before it rewrites the code, we need to use that in the post-rewrite pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 22:25:23 +00:00
Bruno Cardoso Lopes
64baddc0f2 Some small clean-up: use of pseudo instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:55:18 +00:00
Johnny Chen
1adc40cac3 Cleaned up the for-disassembly-only entries in the arm instruction table so that
the memory barrier variants (other than 'SY' full system domain read and write)
are treated as one instruction with option operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110951 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:46:17 +00:00
Jakob Stoklund Olesen
fff2c4726b Also recompute HasPHIKill flags in LiveInterval::RenumberValues.
If a phi-def value were removed from the interval, the phi-kill flags are no
longer valid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:38:03 +00:00
Evan Cheng
719510a178 Make sure ARM constant island pass does not break up an IT block. If the split point is in the middle of an IT block, it should move it up to just above the IT instruction. rdar://8302637
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:30:05 +00:00
Bruno Cardoso Lopes
642eb02045 - Teach SSEDomainFix to switch between different levels of AVX instructions. Here we guess that AVX will have domain issues, so just implement them for consistency and in the future we remove if it's unnecessary.
- Make foldMemoryOperandImpl aware of 256-bit zero vectors folding and support the 128-bit counterparts of AVX too.
- Make sure MOV[AU]PS instructions are only selected when SSE1 is enabled, and duplicate the patterns to match AVX.
- Add a testcase for a simple 128-bit zero vector creation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:20:53 +00:00
Jakob Stoklund Olesen
1b2932024f Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110944 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:01:23 +00:00
Jakob Stoklund Olesen
e1f543fbb3 Clean up debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110940 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 18:50:55 +00:00
Bruno Cardoso Lopes
6da9cee0f1 Define AVX 128-bit pattern versions of SET0PS/PD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110937 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 18:20:59 +00:00
Jakob Stoklund Olesen
f1b05f2b0e Implement single block splitting.
Before spilling a live range, we split it into a separate range for each basic
block where it is used. That way we only get one reload per basic block if the
new smaller ranges can allocate to a register.

This type of splitting is already present in the standard spiller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 17:07:14 +00:00
Dan Gohman
727356fc7d Optimize ScalarEvolution::getAddExpr's operand factoring code by
having it finish processing all of the muliply operands before
starting the whole getAddExpr process over again, instead of
immediately after the first simplification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 15:00:23 +00:00
Dan Gohman
918e76b8b5 Hoist some loop-invariant code out of a hot loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110915 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 14:52:55 +00:00
Dan Gohman
dc7692b1ad Optimize ScalarEvolution::getAddExpr's duplicate operand detection
by having it finish processing the whole operand list before
starting the whole getAddExpr process over again, instead of
immediately after the first duplicate is found.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 14:46:54 +00:00
Duncan Sands
335db22392 Add a 'normalize' method to the Triple class, which takes a mucked up
target triple and straightens it out.  This does less than gcc's script
config.sub, for example it turns i386-mingw32 into i386--mingw32 not
i386-pc-mingw32, but it does a decent job of turning funky triples into
something that the rest of the Triple class can understand.  The plan
is to use this to canonicalize triple's when they are first provided
by users, and have the rest of LLVM only deal with canonical triples.
Once this is done the special case workarounds in the Triple constructor
can be removed, making the class more regular and easier to use.  The
comments and unittests for the Triple class are already adjusted in this
patch appropriately for this brave new world of increased uniformity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 11:31:39 +00:00
Eric Christopher
7486278900 Temporarily revert 110737 and 110734, they were causing failures
in an external testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 07:01:22 +00:00
Bruno Cardoso Lopes
4d04362813 Fix comment order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 02:08:52 +00:00
Bruno Cardoso Lopes
8c05a850f4 Begin to support some vector operations for AVX 256-bit intructions. The long
term goal here is to be able to match enough of vector_shuffle and build_vector
so all avx intrinsics which aren't mapped to their own built-ins but to
shufflevector calls can be codegen'd. This is the first (baby) step, support
building zeroed vectors.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110897 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 02:06:36 +00:00
Johnny Chen
270159fcc2 The autogened decoder was confusing the ARM STRBT for ARM USAT, because the .td
entry for ARM STRBT is actually a super-instruction for A8.6.199 STRBT A1 & A2.
Recover by looking for ARM:USAT encoding pattern before delegating to the auto-
gened decoder.

Added a "usat" test case to arm-tests.txt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 01:40:54 +00:00
Daniel Dunbar
09062b1672 MC/X86/AsmParser: Give an explicit error message when we reject an instruction
because it could have an ambiguous suffix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 00:55:42 +00:00
Daniel Dunbar
f1e29d4c21 MC/AsmParser: Push the burdon of emitting diagnostics about unmatched
instructions onto the target specific parser, which can do a better job.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 00:55:38 +00:00
Daniel Dunbar
4f98f83459 tblgen/AsmMatcher: Always emit the match function as 'MatchInstructionImpl',
target specific parsers can adapt the TargetAsmParser to this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 00:55:32 +00:00
Johnny Chen
7def14f40f Changed the format of DMBsy, DSBsy, and friends from Pseudo to MiscFrm.
Added two test cases to arm-tests.txt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 23:35:12 +00:00
Devang Patel
ebd53742c6 Even if a variable has constant value all the time, it is still a variable in gdb's eyes.
Tested by scope.exp in gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 23:17:54 +00:00
Bob Wilson
eaf1c98a7c Move the ARM SSAT and USAT optional shift amount operand out of the
instruction opcode.  This also fixes part of PR7792.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 23:10:46 +00:00
Jakob Stoklund Olesen
d29583bd32 Fix <rdar://problem/8282498> even if it doesn't reproduce on trunk.
When a register is defined by a partial load:

  %reg1234:sub_32 = MOV32mr <fi#-1>; GR64:%reg1234

That load cannot be folded into an instruction using the full 64-bit register.
It would become a 64-bit load.

This is related to the recent change to have isLoadFromStackSlot return false on
a sub-register load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110874 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 23:08:22 +00:00
Owen Anderson
cf6abd2486 Fix a subtle use-after-free issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110863 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 22:36:04 +00:00
Nick Lewycky
7f9ef4bb51 Clean up ConstantRange a bit:
- remove ashr which never worked.
 - fix lshr and shl and add tests.
 - remove dead function "intersect1Wrapped".
 - add a new sub method to subtract ranges, with test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 22:04:36 +00:00
Dan Gohman
bd4d66d56a Make LoopPass::getContainedPass return a LoopPass* instead of a Pass*
and remove casts from all its callers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 20:34:43 +00:00
Dan Gohman
fa5c2a67c3 Remove BasicBlockPass::runOnFunction, which was unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 20:28:16 +00:00
Dan Gohman
1f9a1608a6 Delete FunctionPass::run, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 19:11:05 +00:00
Dan Gohman
73e8800229 Delete FunctionPass::runOnModule, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 19:05:53 +00:00
Dan Gohman
b68f274b6d Don't use unsigned char for alignments in TargetData. There aren't
that many of these things, so the memory savings isn't significant,
and there are now situations where there can be alignments greater
than 128.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 18:15:01 +00:00
Dan Gohman
d881627d33 Use ISD::ADD instead of ISD::SUB with a negated constant. This
avoids trouble if the return type of TD->getPointerSize() is
changed to something which doesn't promote to a signed type,
and is simpler anyway.

Also, use getCopyFromReg instead of getRegister to read a
physical register's value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110835 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 18:14:00 +00:00
Jakob Stoklund Olesen
dfa28b157d Fix a FIXME. The SlotIndex::Slot enum should be private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 16:50:17 +00:00
Jim Grosbach
fcba5e6b64 cortex m4 has floating point support, but only single precision.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110810 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 15:44:15 +00:00
Bill Wendling
de2b151dbf Consider this code snippet:
float t1(int argc) {
  return (argc == 1123) ? 1.234f : 2.38213f;
}

We would generate truly awful code on ARM (those with a weak stomach should look
away):

_t1:
  movw   r1, #1123
  movs   r2, #1
  movs   r3, #0
  cmp    r0, r1
  mov.w  r0, #0
  it     eq
  moveq  r0, r2
  movs   r1, #4
  cmp    r0, #0
  it     ne
  movne  r3, r1
  adr    r0, #LCPI1_0
  ldr    r0, [r0, r3]
  bx     lr

The problem was that legalization was creating a cascade of SELECT_CC nodes, for
for the comparison of "argc == 1123" which was fed into a SELECT node for the ?:
statement which was itself converted to a SELECT_CC node. This is because the
ARM back-end doesn't have custom lowering for SELECT nodes, so it used the
default "Expand".

I added a fairly simple "LowerSELECT" to the ARM back-end. It takes care of this
testcase, but can obviously be expanded to include more cases.

Now we generate this, which looks optimal to me:

_t1:
  movw   r1, #1123
  movs   r2, #0
  cmp    r0, r1
  adr    r0, #LCPI0_0
  it     eq
  moveq  r2, #4
  ldr    r0, [r0, r2]
  bx     lr
  .align  2
LCPI0_0:
  .long   1075344593  @ float 2.382130e+00
  .long   1067316150  @ float 1.234000e+00



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110799 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 08:43:16 +00:00
Evan Cheng
7b4d31176e Report error if codegen tries to instantiate a ARM target when the cpu does support it. e.g. cortex-m* processors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 07:17:46 +00:00