Commit Graph

4473 Commits

Author SHA1 Message Date
Nick Lewycky
c54c561c9f Add new SCEV, SCEVSMax. This allows LLVM to analyze do-while loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44319 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 22:41:31 +00:00
Chris Lattner
cfa597569d Implement PR1822
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44318 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 21:27:53 +00:00
Duncan Sands
827cde1c83 Fix PR1816. If a bitcast of a function only exists because of a
trivial difference in function attributes, allow calls to it to
be converted to direct calls.  Based on a patch by Török Edwin.
While there, move the various lists of mutually incompatible
parameters etc out of the verifier and into ParameterAttributes.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44315 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 14:10:56 +00:00
Chris Lattner
8a594489bf Fix a long standing deficiency in the X86 backend: we would
sometimes emit "zero" and "all one" vectors multiple times,
for example:

_test2:
	pcmpeqd	%mm0, %mm0
	movq	%mm0, _M1
	pcmpeqd	%mm0, %mm0
	movq	%mm0, _M2
	ret

instead of:

_test2:
	pcmpeqd	%mm0, %mm0
	movq	%mm0, _M1
	movq	%mm0, _M2
	ret

This patch fixes this by always arranging for zero/one vectors
to be defined as v4i32 or v2i32 (SSE/MMX) instead of letting them be
any random type.  This ensures they get trivially CSE'd on the dag.
This fix is also important for LegalizeDAGTypes, as it gets unhappy
when the x86 backend wants BUILD_VECTOR(i64 0) to be legal even when
'i64' isn't legal.

This patch makes the following changes:

1) X86TargetLowering::LowerBUILD_VECTOR now lowers 0/1 vectors into
   their canonical types.
2) The now-dead patterns are removed from the SSE/MMX .td files.
3) All the patterns in the .td file that referred to immAllOnesV or
   immAllZerosV in the wrong form now use *_bc to match them with a
   bitcast wrapped around them.
4) X86DAGToDAGISel::SelectScalarSSELoad is generalized to handle 
   bitcast'd zero vectors, which simplifies the code actually.
5) getShuffleVectorZeroOrUndef is updated to generate a shuffle that
   is legal, instead of generating one that is illegal and expecting
   a later legalize pass to clean it up.
6) isZeroShuffle is generalized to handle bitcast of zeros.
7) several other minor tweaks.

This patch is definite goodness, but has the potential to cause random
code quality regressions.  Please be on the lookout for these and let 
me know if they happen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44310 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 00:24:49 +00:00
Chris Lattner
9a5bdad0cc upgrade this test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44298 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 05:39:29 +00:00
Chris Lattner
9e513acd31 Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44296 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 22:42:31 +00:00
Duncan Sands
e4dc717585 Ding dong, the DoesntAccessMemoryFns and
OnlyReadsMemoryFns tables are dead!  We
get more, and more accurate, information
from gcc via the readnone and readonly
function attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44288 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 19:30:27 +00:00
Chris Lattner
42b5e08e71 Fix a bug where we'd try to find a scev value for a bitcast operand,
even though the bitcast operand did not have integer type.  This fixes
PR1814.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44286 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 08:46:22 +00:00
Chris Lattner
eec8b9a7d6 Fix PR1817.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44284 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 23:47:13 +00:00
Duncan Sands
73d4bb6676 Turn invokes of nounwind functions into ordinary calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44280 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 22:24:59 +00:00
Duncan Sands
920653d41e Teach alias analysis about readnone/readonly functions.
Based on a patch by Török Edwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44279 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 21:43:27 +00:00
Duncan Sands
5ef7be79e0 Readonly/readnone functions are allowed to throw
exceptions, so don't turn invokes of them into
calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44278 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 21:40:06 +00:00
Nick Lewycky
4ac0e8da4a Create nodes for inline asm so that we don't crash looking for the node later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44267 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 03:07:37 +00:00
Duncan Sands
baccd5872e Fix a bug in which node A is replaced by node B, but later
node A gets back into the DAG again because it was hiding in
one of the node maps: make sure that node replacement happens
in those maps too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44263 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-21 16:43:19 +00:00
Nick Lewycky
cf96db2c1d Be more careful when transforming | to +. Patch from Wojciech Matyjewicz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44248 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20 08:24:44 +00:00
Chris Lattner
cec5f3003f Testcase for PR1811
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44244 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 21:43:22 +00:00
Dan Gohman
089617d9e3 Add support in SplitVectorOp for remainder operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 15:15:03 +00:00
Chris Lattner
ef6c875dfa fix bogus test that the more strict lexer is finding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44216 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-18 18:26:45 +00:00
Nate Begeman
b348d18caf Add support for vectors to int <-> float casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44204 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17 03:58:34 +00:00
Evan Cheng
6542481a6d Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44196 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-16 23:55:08 +00:00
Dale Johannesen
d81ae56fa2 Testcase from PR 1508 (although its's somewhat
orthogonal to the main problem there)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44194 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-16 23:16:35 +00:00
Chris Lattner
a7d1ab0ab3 Fix PR1800 by correcting mistaken logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44188 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-16 06:04:17 +00:00
Anton Korobeynikov
4e1a0e386c Reverted r44163 per request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 18:33:16 +00:00
Evan Cheng
5d446265c7 Fix a thinko in post-allocation coalescer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44166 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 08:13:29 +00:00
Nick Lewycky
65e2da3b4d Fix handling of overflow in loop calculation by adding new UDiv SCEV. This SCEV
is disabled in the sense that it will refuse to create one from a UDiv
instruction, until the code is better tested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44163 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 06:30:50 +00:00
Duncan Sands
7e9ab25a85 Un XFAIL these tests, now that Bill has backported
the fix from 4.2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44115 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 13:40:53 +00:00
Anton Korobeynikov
9de1934099 Fix PIC jump table codegen on x86-32/linux. In fact, such thing should be applied
to all targets uses GOT-relative offsets for PIC (Alpha?)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 09:18:41 +00:00
Duncan Sands
f9572a4c2b XFAIL these tests until the fix gets backported
from llvm-gcc-4.2 to 4.0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44103 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 07:42:50 +00:00
Chris Lattner
1b12d8855d Implement PR1796 and Transforms/SimplifyCFG/noreturn-call.ll
by inserting unreachable after no-return calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44099 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 06:19:25 +00:00
Chris Lattner
59ab338882 upgrade test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44067 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 21:42:48 +00:00
Chris Lattner
b42c8f7101 Implement PR1786 by iterating between dead cycle elimination
and simplifycfg in the rare cases when it is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44044 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 07:32:38 +00:00
Arnold Schwaighofer
38ada868f2 Update tailcall code to include inline attribute operand for memcpy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43978 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10 10:48:01 +00:00
Evan Cheng
9858c348d7 Fix tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43961 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 20:46:00 +00:00
Chris Lattner
7b52fe7272 Tighten up a check for folding away loads from (newly constant) globals. This
fixes a crash on Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll and 
rdar://5585488.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43949 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 17:33:02 +00:00
Duncan Sands
27b12384e6 Thanks to the XTARGET line, this test should still
be run on darwin, but I have no way of checking...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43945 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 13:50:25 +00:00
Duncan Sands
38c576c56e Check that the first and third characters, s and u,
are accessed with an alignment of 2 not 1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43932 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 07:47:29 +00:00
Duncan Sands
506f9089a4 Check that accesses to the second short, t, have
an alignment of 2 rather than 4.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43931 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 07:46:02 +00:00
Devang Patel
dbaf378350 Run this test only on darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43912 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 22:26:46 +00:00
Andrew Lenharth
b410df995c Better check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43897 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 18:45:15 +00:00
Andrew Lenharth
ab9338eb9f Fix PR1780
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43893 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 17:39:28 +00:00
Lauro Ramos Venancio
e0cb36b9fb [ARM] Implement __builtin_thread_pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43892 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 17:20:05 +00:00
Evan Cheng
4471194d69 If both parts of smul_lohi, etc. are used, don't simplify. If only one part is used, try simplify it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43888 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 09:25:29 +00:00
Bill Wendling
033903c37b Add testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43839 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07 19:36:26 +00:00
Tanya Lattner
a57506eea4 Implement the XTARGET feature for PR1778
This will mark a test as PASS for all targets specified. It will override whatever is in XFAIL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 22:32:17 +00:00
Chris Lattner
cf5008a792 Implement PR1777 by detecting dependent phis that
all compute the same value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43777 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 21:52:06 +00:00
Evan Cheng
1fd15ba961 Add pseudo dependency to force two-address instruction to be scheduled after
other uses. There was a overly restricted check that prevented some obvious
cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43762 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 08:44:59 +00:00
Chris Lattner
9907cb12ae Fix PR1774 and BasicAA/2007-11-05-SizeCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 05:58:42 +00:00
Dan Gohman
80176319f3 Add support for vector remainder operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43744 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 23:35:22 +00:00
Dan Gohman
cff550995b Fix an abort in instcombine when folding creates a vector rem instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43743 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 23:16:33 +00:00
Dale Johannesen
eb57ea7ea2 Make labels work in asm blocks; allow labels as
parameters.  Rename ValueRefList to ParamList
in AsmParser, since its only use is for parameters.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43734 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 21:20:28 +00:00