Duncan Sands
1b0feb42e2
Add some convenience methods for querying attributes, and
...
use them.
llvm-svn: 44403
2007-11-28 17:07:01 +00:00
Duncan Sands
3602011bec
Fix PR1146: parameter attributes are longer part of
...
the function type, instead they belong to functions
and function calls. This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully
a bitcode guru (who might that be? :) ) will fix it.
llvm-svn: 44359
2007-11-27 13:23:08 +00:00
Nick Lewycky
1536b3f230
Add new SCEV, SCEVSMax. This allows LLVM to analyze do-while loops.
...
llvm-svn: 44319
2007-11-25 22:41:31 +00:00
Chris Lattner
d1e03b5387
Implement PR1822
...
llvm-svn: 44318
2007-11-25 21:27:53 +00:00
Duncan Sands
114968a3e8
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.
llvm-svn: 44315
2007-11-25 14:10:56 +00:00
Chris Lattner
36854c740d
Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
...
llvm-svn: 44296
2007-11-23 22:42:31 +00:00
Duncan Sands
265752ae8f
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.
llvm-svn: 44288
2007-11-23 19:30:27 +00:00
Chris Lattner
ac2de0424b
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.
llvm-svn: 44286
2007-11-23 08:46:22 +00:00
Chris Lattner
bff48b8f0d
Fix PR1817.
...
llvm-svn: 44284
2007-11-22 23:47:13 +00:00
Duncan Sands
e79932aed4
Turn invokes of nounwind functions into ordinary calls.
...
llvm-svn: 44280
2007-11-22 22:24:59 +00:00
Duncan Sands
6ec98952e0
Readonly/readnone functions are allowed to throw
...
exceptions, so don't turn invokes of them into
calls.
llvm-svn: 44278
2007-11-22 21:40:06 +00:00
Chris Lattner
5574ba5ce6
Fix PR1800 by correcting mistaken logic.
...
llvm-svn: 44188
2007-11-16 06:04:17 +00:00
Chris Lattner
3b66875602
Implement PR1796 and Transforms/SimplifyCFG/noreturn-call.ll
...
by inserting unreachable after no-return calls.
llvm-svn: 44099
2007-11-14 06:19:25 +00:00
Chris Lattner
6c1a015f06
upgrade test
...
llvm-svn: 44067
2007-11-13 21:42:48 +00:00
Chris Lattner
2d15a52df0
Implement PR1786 by iterating between dead cycle elimination
...
and simplifycfg in the rare cases when it is needed.
llvm-svn: 44044
2007-11-13 07:32:38 +00:00
Chris Lattner
a82bbe25f4
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.
llvm-svn: 43949
2007-11-09 17:33:02 +00:00
Andrew Lenharth
83adca5075
Better check
...
llvm-svn: 43897
2007-11-08 18:45:15 +00:00
Andrew Lenharth
310a65171d
Fix PR1780
...
llvm-svn: 43893
2007-11-08 17:39:28 +00:00
Chris Lattner
907b9b92fe
Implement PR1777 by detecting dependent phis that
...
all compute the same value.
llvm-svn: 43777
2007-11-06 21:52:06 +00:00
Dan Gohman
adc21ed938
Fix an abort in instcombine when folding creates a vector rem instruction.
...
llvm-svn: 43743
2007-11-05 23:16:33 +00:00
Devang Patel
963e54c2cf
If a value is incoming from outside the loop then the value does not need remapping and the value is never tracked through LastValueMap.
...
llvm-svn: 43728
2007-11-05 19:32:30 +00:00
Duncan Sands
662fb070a7
Change uses of getTypeSize to getABITypeSize, getTypeStoreSize
...
or getTypeSizeInBits as appropriate in ScalarReplAggregates.
The right change to make was not always obvious, so it would
be good to have an sroa guru review this. While there I noticed
some bugs, and fixed them: (1) arrays of x86 long double have
holes due to alignment padding, but this wasn't being spotted
by HasStructPadding (renamed to HasPadding). The same goes
for arrays of oddly sized ints. Vectors also suffer from this,
in fact the problem for vectors is much worse because basic
vector assumptions seem to be broken by vectors of type with
alignment padding. I didn't try to fix any of these vector
problems. (2) The code for extracting smaller integers from
larger ones (in the "int union" case) was wrong on big-endian
machines for integers with size not a multiple of 8, like i1.
Probably this is impossible to hit via llvm-gcc, but I fixed
it anyway while there and added a testcase. I also got rid of
some trailing whitespace and changed a function name which
had an obvious typo in it.
llvm-svn: 43672
2007-11-04 14:43:57 +00:00
Owen Anderson
594b0fe9e2
Fix test/Transforms/DeadStoreElimination/PartialStore.ll, which had been
...
silently failing because of an incorrect run line for some time.
llvm-svn: 43605
2007-11-01 05:29:16 +00:00
Chris Lattner
38a21a25f2
Fix InstCombine/2007-10-31-StringCrash.ll by removing an obvious
...
(in hindsight) infinite recursion. Simplify the code.
llvm-svn: 43597
2007-11-01 02:30:35 +00:00
Chris Lattner
d29624e11a
Fix InstCombine/2007-10-31-RangeCrash.ll
...
llvm-svn: 43596
2007-11-01 02:18:41 +00:00
Dan Gohman
9365affecc
Add support for folding binary operators with vector zero operands.
...
llvm-svn: 43510
2007-10-30 19:00:49 +00:00
Chris Lattner
875ca50576
update testcase
...
llvm-svn: 43452
2007-10-29 17:06:35 +00:00
Chris Lattner
3d6151bcd1
Model stacksave and stackrestore as both writing memory, since we
...
don't model their dependences on allocas correctly. This fixes
PR1745.
llvm-svn: 43442
2007-10-29 05:47:52 +00:00
Chris Lattner
7e3a8a7604
Fix PR1749 and InstCombine/2007-10-28-EmptyField.ll by handling
...
zero-length fields better.
llvm-svn: 43427
2007-10-29 02:40:02 +00:00
Chris Lattner
891066cfff
Fix PR1752 and LoopSimplify/2007-10-28-InvokeCrash.ll: terminators
...
can have uses too. Wouldn't it be nice if invoke didn't exist? :)
llvm-svn: 43426
2007-10-29 02:30:37 +00:00
Chris Lattner
483c471daa
Implement a couple of foldings for ordered and unordered comparisons,
...
implementing cases related to PR1738.
llvm-svn: 43289
2007-10-24 05:38:08 +00:00
Bill Wendling
df262eb966
Don't branch fold inline asm statements.
...
llvm-svn: 43191
2007-10-19 21:09:55 +00:00
Devang Patel
d002595abf
This test now passes.
...
llvm-svn: 43183
2007-10-19 17:11:01 +00:00
Chris Lattner
efaf4ba65d
Fix PR1735 and Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll by
...
fixing some obviously broken code :(
llvm-svn: 43141
2007-10-18 18:49:29 +00:00
Devang Patel
13e0df71e0
XFAIL for now.
...
llvm-svn: 43111
2007-10-18 00:48:43 +00:00
Devang Patel
9cb3c09156
Do not raise free() call that is called through invoke instruction.
...
llvm-svn: 43083
2007-10-17 20:12:58 +00:00
Devang Patel
cf2f9d6daa
Apply "Instead of loading small c string constant, use integer constant directly" transformation while processing load instruction.
...
llvm-svn: 43070
2007-10-17 07:24:40 +00:00
Chris Lattner
3af877f26a
Fix a bug in my patch last night that broke InstCombine/2007-10-12-Crash.ll
...
llvm-svn: 42920
2007-10-12 18:05:47 +00:00
Chris Lattner
7489b40996
testcase for PR1728
...
llvm-svn: 42890
2007-10-12 05:29:53 +00:00
Devang Patel
15d6257fa8
Lower memcpy if it makes sense.
...
llvm-svn: 42864
2007-10-11 17:21:57 +00:00
Devang Patel
36b68478cb
Fix bug in updating dominance frontier after loop
...
unswitch when frontier includes basic blocks that
are not inside loop.
llvm-svn: 42654
2007-10-05 22:29:34 +00:00
Devang Patel
42f006a51a
Relax unsafe use check. If there is one unconditional use inside the loop then it is safe to promote value even if there is another conditional use inside the loop.
...
llvm-svn: 42493
2007-10-01 18:12:58 +00:00
Devang Patel
d98abb62ce
Handle multiple induction variables.
...
This fixes PR714.
llvm-svn: 42309
2007-09-25 18:24:48 +00:00
Devang Patel
de9d1c3654
Add transformation to update loop interation space. Now,
...
for (i=A; i<N; i++) {
if (i < X && i > Y)
do_something();
}
is transformed into
U=min(N,X); L=max(A,Y);
for (i=L;i<U;i++)
do_somethihg();
llvm-svn: 42299
2007-09-25 17:31:19 +00:00
Devang Patel
65f8d0c2d7
Do not promote null values because it may be unsafe to do so.
...
llvm-svn: 42270
2007-09-24 20:02:42 +00:00
Devang Patel
b741c56cfc
Fix PR1692
...
llvm-svn: 42209
2007-09-21 21:18:19 +00:00
Duncan Sands
425fe2a97b
Testcase for PR1678.
...
llvm-svn: 42171
2007-09-20 18:56:24 +00:00
Nick Lewycky
9edfec9b3c
Excuse me.
...
llvm-svn: 42158
2007-09-20 00:57:00 +00:00
Nick Lewycky
3baa4cde1c
Fix optimization. %x = sub %x, %y does not imply that %y is zero.
...
llvm-svn: 42157
2007-09-20 00:48:36 +00:00
Devang Patel
648d7a1074
Avoid unsafe promotion.
...
llvm-svn: 42149
2007-09-19 20:18:51 +00:00