Commit Graph

7034 Commits

Author SHA1 Message Date
Devang Patel
c2230821a6 Use MainCU if it is available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73457 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-16 02:09:30 +00:00
Dan Gohman
9a8c5807f8 Update this test to use fmul instead of mul.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 22:49:34 +00:00
Dan Gohman
6de29f8d96 Support vector casts in more places, fixing a variety of assertion
failures.

To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.

Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 22:12:54 +00:00
Devang Patel
11a407f43f Gracefully handle imbalanced inline function begin and end markers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 21:45:50 +00:00
Evan Cheng
2077e18caf ifcvt should ignore cfg where true and false successors are the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 21:24:34 +00:00
Dale Johannesen
c1f104054d Fix the crash in this test. This is basically the same
problem addressed in 31284, but the patch there only
addressed the case where an invoke is the first thing in
a block.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 20:59:27 +00:00
Bill Wendling
8c3befd76e This test is failing. Revert for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 19:10:56 +00:00
Bill Wendling
f88f21c5d4 Add another testcase for r71478.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73399 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 18:36:34 +00:00
Arnold Schwaighofer
5d2c01e48a CheckTailCallReturnConstraints is missing a check on the
incomming chain of the RETURN node. The incomming chain must
be the outgoing chain of the CALL node. This causes the
backend to identify tail calls that are not tail calls. This
patch fixes this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 14:43:36 +00:00
Evan Cheng
358dec5180 Part 1.
- Change register allocation hint to a pair of unsigned integers. The hint type is zero (which means prefer the register specified as second part of the pair) or entirely target dependent.
- Allow targets to specify alternative register allocation orders based on allocation hint.

Part 2.
- Use the register allocation hint system to implement more aggressive load / store multiple formation.
- Aggressively form LDRD / STRD. These are formed *before* register allocation. It has to be done this way to shorten live interval of base and offset registers. e.g.
v1025 = LDR v1024, 0
v1026 = LDR v1024, 0
=>
v1025,v1026 = LDRD v1024, 0

If this transformation isn't done before allocation, v1024 will overlap v1025 which means it more difficult to allocate a register pair.

- Even with the register allocation hint, it may not be possible to get the desired allocation. In that case, the post-allocation load / store multiple pass must fix the ldrd / strd instructions. They can either become ldm / stm instructions or back to a pair of ldr / str instructions.

This is work in progress, not yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 08:28:29 +00:00
Chris Lattner
d3b295c23f fix testcase to properly check for the patch in r73195.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 05:46:02 +00:00
Dan Gohman
bd59d7b603 Implement more aggressive folding of add operand lists when
they contain multiplications of constants with add operations.
This helps simplify several kinds of things; in particular it
helps simplify expressions like ((-1 * (%a + %b)) + %a) to %b,
as expressions like this often come up in loop trip count
computations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 22:58:51 +00:00
Duncan Sands
ec08da01fc Testcase for PR4332.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 22:22:42 +00:00
Dan Gohman
4d8414f420 Teach SCEVExpander's visitAddRecExpr to reuse an existing canonical
induction variable when the addrec to be expanded does not require
a wider type. This eliminates the need for IndVarSimplify to
micro-manage SCEV expansions, because SCEVExpander now
automatically expands them in the form that IndVarSimplify considers
to be canonical. (LSR still micro-manages its SCEV expansions,
because it's optimizing for the target, rather than for
other optimizations.)

Also, this uses the new getAnyExtendExpr, which has more clever
expression simplification logic than the IndVarSimplify code it
replaces, and this cleans up some ugly expansions in code such as
the included masked-iv.ll testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73294 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-13 16:25:49 +00:00
Evan Cheng
e7d6df7353 Add a ARM specific pre-allocation pass that re-schedule loads / stores from
consecutive addresses togther. This makes it easier for the post-allocation pass
to form ldm / stm.

This is step 1. We are still missing a lot of ldm / stm opportunities because
of register allocation are not done in the desired order. More enhancements
coming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73291 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-13 09:12:55 +00:00
Devang Patel
daf9e02893 llvm.dbg.region.end() intrinsic is not required to be in _last_ basic block in a function. If that happens then any basic block that follows (lexically) the block with regin.end will not have scope info available. LexicalScopeStack relies on processing basic block in CFG order, but this processing order is not guaranteed. Things get complicated when the optimizer gets a chance to optimizer IR with dbg intrinsics.
Apply defensive patch to preserve at least one lexical scope till the end of function.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-13 02:16:18 +00:00
Dan Gohman
0de1951a33 Adjust this test's regex strings so that they work regardless
of the target's pointer size. This avoids the need for -m32 on
the llvm-gcc command-line, which some targets may not support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 23:31:14 +00:00
Dan Gohman
f53e6b5c13 Add -m32 to llvm-gcc commands, so that this test behaves as expected
on systems which default to a 64-bit target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73265 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 23:02:02 +00:00
Evan Cheng
4a274e573d If killed register is defined by implicit_def, do not clear it since it's live range may overlap another def of same register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 21:34:26 +00:00
Evan Cheng
cd799b99cb Mark some pattern-less instructions as neverHasSideEffects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 20:46:18 +00:00
Devang Patel
9217f793bf Clear AbstractInstanceRootMap at the end of the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 19:24:05 +00:00
Dan Gohman
e54aba5fa9 Don't do (x - (y - z)) --> (x + (z - y)) on floating-point types, because
it may round differently. This fixes PR4374.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 19:23:25 +00:00
Dale Johannesen
5d0da6be21 Testcase for llvm-gcc patch 73238.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 18:41:53 +00:00
Arnold Schwaighofer
bbd8c33ee6 Fix Bug 4278: X86-64 with -tailcallopt calling convention
out of sync with regular cc.

The only difference between the tail call cc and the normal
cc was that one parameter register - R9 - was reserved for
calling functions through a function pointer. After time the
tail call cc has gotten out of sync with the regular cc. 

We can use R11 which is also caller saved but not used as
parameter register for potential function pointers and
remove the special tail call cc on x86-64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 16:26:57 +00:00
Nick Lewycky
8728d7a3ea Given two identical weak functions, produce one internal function and two weak
thunks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 15:56:56 +00:00
Nick Lewycky
f343b69f47 This test is wrong. If you have two weak functions F and G you can't make
either one call the other since either one can be replaced at link time, and
they need to be independent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 13:24:41 +00:00
Nick Lewycky
c55c27fa16 Fix regular expression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 05:39:02 +00:00
Nick Lewycky
f7e498138f Don't remove aggregate-typed module level constants before encoding functions
since functions may contain aggregate constants too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73220 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 05:20:12 +00:00
Nick Lewycky
084f7bf8a7 In an XFAIL line, treat "XFAIL: foo*bar" as a regular expression to be matched
against the target triple, instead of equivalent to "XFAIL: *".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73219 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 05:18:32 +00:00
Nick Lewycky
0b389b54c9 XFAIL this on PPC Linux. This keeps showing up in the buildbot and isn't easy to fix, and I'd like it to stop masking
real failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-11 23:43:02 +00:00
Dale Johannesen
7512beb751 Test for rev 73205 (PR 4349)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-11 20:48:09 +00:00
Chris Lattner
3590abfda0 Fix 4366: store to null in non-default addr space should not be
turned into unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-11 17:54:56 +00:00
Daniel Dunbar
7ba520bced Remove empty test (my DejaGNU doesn't like this)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73148 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-09 21:24:39 +00:00
Bill Wendling
68a9cb1226 Remove empty file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73140 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-09 18:55:39 +00:00
David Greene
ffc0ab6037 Revert 73074 and 73099 because Windows doesn't have POSIX
regular expressions.  We will add an OpenBSD implementation
and re-apply ASAP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-09 18:31:17 +00:00
David Greene
0d973999f3 Add a !patsubst operator. Use on string types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 23:05:37 +00:00
Anton Korobeynikov
f194b0edc9 Add testcase for register scanveger assertion fix in r72755
(double def due to livevars)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 22:54:15 +00:00
David Greene
5f323419f3 Add a more robust !if test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 22:34:57 +00:00
David Greene
d725189254 Fix DejaGNU run line to escape special characters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 22:20:58 +00:00
David Greene
e1b469170b Make IntInits and ListInits typed. This helps deduce types of !if and
other operators.  For the rare cases where a list type cannot be
deduced, provide a []<type> syntax, where <type> is the list element
type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 20:23:18 +00:00
David Greene
938c8ab0a0 Add a !regmatch operator to do pattern matching in TableGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73074 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-08 17:00:34 +00:00
Eli Friedman
faeedf1254 Fix the run-line for this test to work correctly outside of x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 09:44:19 +00:00
Eli Friedman
f10d3a7bcd Tweak the expansion code for BIT_CONVERT to generate better code
converting from an MMX vector to an i64.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 09:41:57 +00:00
Eli Friedman
7a5e55509b Slightly generalize the code that handles shuffles of consecutive loads
on x86 to handle more cases.  Fix a bug in said code that would cause it 
to read past the end of an object.  Rewrite the code in 
SelectionDAGLegalize::ExpandBUILD_VECTOR to be a bit more general. 
Remove PerformBuildVectorCombine, which is no longer necessary with 
these changes.  In addition to simplifying the code, with this change, 
we can now catch a few more cases of consecutive loads.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 06:52:44 +00:00
Eli Friedman
0da9975299 PR3628: Add patterns to match SHL/SRL/SRA to the corresponding Altivec
instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 01:07:55 +00:00
Eli Friedman
b9a4cacc91 PR4340: Run SimplifyDemandedVectorElts on insertelement instructions;
sometimes it can find simplifications that won't be found otherwise.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 20:08:03 +00:00
Eli Friedman
5257106c4d Fix the expansion for CONCAT_VECTORS so that it doesn't create illegal
types.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 07:08:26 +00:00
Eli Friedman
30e71eb61b Avoid crashing on a variable-index insertelement with element type i16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 06:32:50 +00:00
Eli Friedman
1041553424 Get rid of some bogus patterns for X86vzmovl. Don't create VZEXT_MOVL
nodes for vectors with an i16 element type.  Add an optimization for 
building a vector which is all zeros/undef except for the bottom 
element, where the bottom element is an i8 or i16.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72988 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 06:05:10 +00:00
Eli Friedman
9d47b8d8ea Fix an obvious typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 05:55:37 +00:00