Devang Patel
2a60ff1aeb
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
Dale Johannesen
1d1d0e7735
Don't do SRA for unions with long double fields.
...
Fixes a SWB crash.
llvm-svn: 42422
2007-09-28 00:21:38 +00:00
Devang Patel
7bba386f72
Handle multiple induction variables.
...
This fixes PR714.
llvm-svn: 42309
2007-09-25 18:24:48 +00:00
Devang Patel
440d13b55b
Do not reserve DOM check for GetElementPtrInst.
...
llvm-svn: 42306
2007-09-25 17:55:50 +00:00
Devang Patel
5e1651d270
doh..
...
llvm-svn: 42300
2007-09-25 17:43:08 +00:00
Devang Patel
87d7e8ebcb
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
9e30e1a3be
Do not promote null values because it may be unsafe to do so.
...
llvm-svn: 42270
2007-09-24 20:02:42 +00:00
Dan Gohman
75470c3bf1
explicit keywords.
...
llvm-svn: 42262
2007-09-24 15:48:49 +00:00
Devang Patel
361e52f39c
Fix PR1692
...
llvm-svn: 42209
2007-09-21 21:18:19 +00:00
Owen Anderson
46da2a6262
Add partial caching of non-local memory dependence queries. This provides a modest
...
speedup for GVN.
llvm-svn: 42185
2007-09-21 03:53:52 +00:00
Devang Patel
83cc3f8f51
Update aux. info associated with an instruction before erasing instruction.
...
llvm-svn: 42180
2007-09-20 23:45:50 +00:00
Devang Patel
6117a3b696
Don't increment invalid iterator.
...
llvm-svn: 42178
2007-09-20 23:01:50 +00:00
Nick Lewycky
eae7e7d00b
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
464276f831
Avoid unsafe promotion.
...
llvm-svn: 42149
2007-09-19 20:18:51 +00:00
Duncan Sands
d31649bc59
Improve comment.
...
llvm-svn: 42132
2007-09-19 10:25:38 +00:00
Duncan Sands
56df7dec2b
A global variable with external weak linkage can be null, while
...
an alias could alias such a global variable.
llvm-svn: 42130
2007-09-19 10:10:31 +00:00
Devang Patel
69a55a38ed
Relax loop ExitCondition predicate restriction.
...
llvm-svn: 42122
2007-09-19 00:28:47 +00:00
Devang Patel
455a53b7db
Filter loops where split condition's false branch is not empty. For example
...
for (int i = 0; i < N; ++i) {
if (i == somevalue)
dosomething();
else
dosomethingelse();
}
llvm-svn: 42121
2007-09-19 00:15:16 +00:00
Devang Patel
4c238c451f
Bail out early, before modifying anything.
...
llvm-svn: 42120
2007-09-19 00:11:01 +00:00
Devang Patel
31f2c8592c
Work is incomplete. Loop is not modified at all right now.
...
llvm-svn: 42119
2007-09-19 00:08:13 +00:00
Devang Patel
fcda998ab2
Fix PR1657
...
llvm-svn: 42075
2007-09-18 01:54:42 +00:00
Devang Patel
267c07b51f
Do not eliminate loop when it is invalid to do so. For example,
...
for(int i = 0; i < N; i++) {
if ( i == XYZ) {
A;
else
B;
}
C;
D;
}
llvm-svn: 42058
2007-09-17 21:01:05 +00:00
Devang Patel
712dbe9d13
Skeleton for transformations to truncate loop's iteration space.
...
llvm-svn: 42054
2007-09-17 20:39:48 +00:00
Chris Lattner
0625bd6472
Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfo
...
Add a new DenseMapInfo::isEqual method to allow clients to redefine
the equality predicate used when probing the hash table.
llvm-svn: 42042
2007-09-17 18:34:04 +00:00
Dan Gohman
2ac2652779
Instcombine x-((x/y)*y) into a remainder operator.
...
llvm-svn: 42035
2007-09-17 17:31:57 +00:00
Duncan Sands
6d5da71288
Factor the trampoline transformation into a subroutine.
...
llvm-svn: 42021
2007-09-17 10:26:40 +00:00
Owen Anderson
4cd516b50b
Be more careful when constant-folding PHI nodes.
...
llvm-svn: 41998
2007-09-16 08:04:16 +00:00
Owen Anderson
8d0cb881e5
Remove RLE. It is subsumed by GVN.
...
llvm-svn: 41968
2007-09-14 22:33:52 +00:00
Dale Johannesen
98d3a08d8f
Remove the assumption that FP's are either float or
...
double from some of the many places in the optimizers
it appears, and do something reasonable with x86
long double.
Make APInt::dump() public, remove newline, use it to
dump ConstantSDNode's.
Allow APFloats in FoldingSet.
Expand X86 backend handling of long doubles (conversions
to/from int, mostly).
llvm-svn: 41967
2007-09-14 22:26:36 +00:00
Chris Lattner
d9111b88d1
silence a bogus gcc warning.
...
llvm-svn: 41949
2007-09-14 03:07:24 +00:00
Bill Wendling
264d4813c7
Temporary reverting r41817
...
(http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070910/053370.html ). It's
causing SPASS to fail.
llvm-svn: 41938
2007-09-14 01:13:55 +00:00
Chris Lattner
7b412cb823
Change llvm.gcroot to not init the root to null at runtime, this prevents
...
using it for live-in values etc.
llvm-svn: 41879
2007-09-12 17:53:10 +00:00
Duncan Sands
9204663bcb
Turn calls to trampolines into calls to the underlying
...
nested function.
llvm-svn: 41844
2007-09-11 14:35:41 +00:00
Devang Patel
7ed6eb8992
Avoid negative logic.
...
llvm-svn: 41829
2007-09-11 01:10:45 +00:00
Devang Patel
8c95373ced
Refactor code into a separate method.
...
llvm-svn: 41826
2007-09-11 00:42:56 +00:00
Devang Patel
d67479b6ee
Clear split info object.
...
llvm-svn: 41823
2007-09-11 00:23:56 +00:00
Devang Patel
a28a7f1b2d
Split condition does not have to be ICmpInst in all cases.
...
llvm-svn: 41822
2007-09-11 00:12:56 +00:00
Devang Patel
f4202e91f8
Check all terminators inside loop.
...
llvm-svn: 41821
2007-09-10 23:57:58 +00:00
Chris Lattner
e804567cd8
remove some dead code, this is handled by constant folding.
...
llvm-svn: 41819
2007-09-10 23:46:29 +00:00
Devang Patel
2181b8e86a
Swap exit condition operands if it works.
...
llvm-svn: 41817
2007-09-10 23:34:06 +00:00
Chris Lattner
c75cbe6473
Prevent tailcallelim from breaking "recursive" calls to builtins.
...
llvm-svn: 41804
2007-09-10 20:58:55 +00:00
Devang Patel
f8ab0a9acc
Filter exit conditions which are not yet handled.
...
llvm-svn: 41800
2007-09-10 18:33:42 +00:00
Devang Patel
d7409fdce5
Require SCEV before LCSSA.
...
llvm-svn: 41798
2007-09-10 18:08:23 +00:00
Chris Lattner
85a51e0060
Don't zap back to back volatile load/stores
...
llvm-svn: 41759
2007-09-07 05:33:03 +00:00
Dale Johannesen
bed9dc423c
Next round of APFloat changes.
...
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double. Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)
llvm-svn: 41747
2007-09-06 18:13:44 +00:00
Nick Lewycky
0c5c47944a
Use isTrueWhenEqual. Thanks Chris!
...
llvm-svn: 41741
2007-09-06 02:40:25 +00:00
Nick Lewycky
b0b066eaaa
When the two operands of an icmp are equal, there are five possible predicates
...
that would make the icmp true. Fixes PR1637.
llvm-svn: 41740
2007-09-06 01:10:22 +00:00
Chuck Rose III
2320323647
Forgot to obey 80 column rule. Fixing that.
...
llvm-svn: 41725
2007-09-05 20:36:41 +00:00
Chuck Rose III
e58572233d
Added default parameters to GetElementPtrInstr constructor call. Visual Studio 2k5 was getting confused and was unable to compile it. Suspected compiler error.
...
llvm-svn: 41721
2007-09-05 16:54:38 +00:00
David Greene
c656cbb8c2
Update GEP constructors to use an iterator interface to fix
...
GLIBCXX_DEBUG issues.
llvm-svn: 41697
2007-09-04 15:46:09 +00:00