Nate Begeman
2a0ca3e937
Reapply this transformation now that it is passing the external test which it previously failed.
...
llvm-svn: 110987
2010-08-13 00:17:53 +00:00
Chris Lattner
363226dfe8
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.
llvm-svn: 110962
2010-08-12 22:25:23 +00:00
Eric Christopher
ac40d49c70
Temporarily revert 110737 and 110734, they were causing failures
...
in an external testsuite.
llvm-svn: 110905
2010-08-12 07:01:22 +00:00
Nate Begeman
265363061e
Add the minimal amount of smarts necessary to instcombine of shufflevectors to recognize
...
patterns generated by clang for transpose of a matrix in generic vectors. This is made
of two parts:
1) Propagating vector extracts of hi/lo half into their users
2) Recognizing an insertion of even elements followed by the odd elements as an unpack.
Testcase to come, but this shrinks the # of shuffle instructions generated on x86 from ~40 to the minimal 8.
llvm-svn: 110734
2010-08-10 21:38:12 +00:00
Nick Lewycky
f0067b668c
Fix a use after free error caught by the valgrind builders.
...
llvm-svn: 110601
2010-08-09 21:03:28 +00:00
Eli Friedman
f99e7e6643
PR7853: fix a silly mistake introduced in r101899, and add a test to make sure
...
it doesn't regress again.
llvm-svn: 110597
2010-08-09 20:49:43 +00:00
Nick Lewycky
fbd2757cde
Do more to modernize MergeFunctions. Refactor in response to Chris' code review.
...
llvm-svn: 110538
2010-08-08 05:04:23 +00:00
Owen Anderson
0398607714
Don't attempt the PRE inline asm calls, since we don't value number them yet. Fixes PR7835.
...
llvm-svn: 110489
2010-08-07 00:20:35 +00:00
Dan Gohman
0f7892b8ae
Eliminate PromoteMemoryToRegisterID; just use addPreserved("mem2reg")
...
instead, as an example of what this looks like.
llvm-svn: 110478
2010-08-06 21:48:06 +00:00
Owen Anderson
a7aed18624
Reapply r110396, with fixes to appease the Linux buildbot gods.
...
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Nick Lewycky
5a2849e166
Fix uninitialized variable warning.
...
Also move 'default' case next to a real case to help compiler optimize in
non-Debug builds.
No functionality change.
llvm-svn: 110435
2010-08-06 07:43:46 +00:00
Nick Lewycky
f216f69ad9
Work in progress, cleaning up MergeFuncs.
...
Further clean up the comparison function by removing overly generalized
"domains".
Remove all understanding of ELF aliases and simplify folding code and comments.
llvm-svn: 110434
2010-08-06 07:21:30 +00:00
Owen Anderson
bda59bd247
Revert r110396 to fix buildbots.
...
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
755aceb5d0
Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
...
ID member as the sole unique type identifier. Clean up APIs related to this change.
llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Owen Anderson
4674dd6cf5
Give JumpThreading+LVI a long-form cl::opt so that it's easier to toggle the default.
...
llvm-svn: 110384
2010-08-05 22:11:31 +00:00
Owen Anderson
9f2bca02d7
Experiments show that we can safely increase our unrolling threshold without unduly impacting code size, particularly
...
since unrolling is not enabled at -Os.
llvm-svn: 110233
2010-08-04 18:32:46 +00:00
Dan Gohman
ba81fc16a5
Fix whitespace.
...
llvm-svn: 110223
2010-08-04 17:43:57 +00:00
Dan Gohman
839c972102
Fix a comment.
...
llvm-svn: 110181
2010-08-04 01:16:35 +00:00
Dan Gohman
5442c71f2e
Thread const correctness through a bunch of AliasAnalysis interfaces and
...
eliminate several const_casts.
Make CallSite implicitly convertible to ImmutableCallSite.
Rename the getModRefBehavior for intrinsic IDs to
getIntrinsicModRefBehavior to avoid overload ambiguity with CallSite,
which happens to be implicitly convertible to bool.
llvm-svn: 110155
2010-08-03 21:48:53 +00:00
Dan Gohman
3619660529
Make instcombine set explicit alignments on load or store
...
instructions with alignment 0, so that subsequent passes don't
need to bother checking the TargetData ABI size manually.
llvm-svn: 110128
2010-08-03 18:20:32 +00:00
Peter Collingbourne
ddaaf40d24
Add an atomic lowering pass
...
llvm-svn: 110113
2010-08-03 16:19:16 +00:00
Dan Gohman
35e8a6209d
Use unary + instead of a separate local variable for working
...
around std::min vs static const friction.
llvm-svn: 110112
2010-08-03 16:15:50 +00:00
Owen Anderson
8f306a779b
Re-apply the infamous r108614, with a fix pointed out by Dirk Steinke.
...
llvm-svn: 110036
2010-08-02 09:32:13 +00:00
Oscar Fuentes
40b31ad3ee
Prefix `next' iterator operation with `llvm::'.
...
Fixes potential ambiguity problems on VS 2010.
Patch by nobled!
llvm-svn: 110029
2010-08-02 06:00:15 +00:00
Daniel Dunbar
c1b09c8644
Fix a -Wreorder warning.
...
llvm-svn: 110022
2010-08-02 05:43:46 +00:00
Nick Lewycky
f52bd9cc33
Work in progress.
...
Start cleaning up MergeFunctions to look more like the rest of LLVM. The
primary change here is to move the methods responsible for comparison into the
new FunctionComparator object. Some comments added. There's more to do.
llvm-svn: 110021
2010-08-02 05:23:03 +00:00
Daniel Dunbar
0b636a24c7
Speculatively revert r108614, "Another attempt at getting the clang self-host to
...
like my instcombine patch.", in an attempt to fix Clang i386 bootstrap.
- Also PR7719.
llvm-svn: 109953
2010-07-31 19:51:11 +00:00
Rafael Espindola
40f18838b7
The BlockExtractorPass() constructor was not reading the BlockFile and that was
...
exactly what bugpoint expected it to do.
There was also only one user of
BlockExtractorPass(const std::vector<BasicBlock*> &B), so just remove it and
make BlockExtractorPass read BlockFile.
This fixes bugpoint's block extraction.
Nick, please review.
llvm-svn: 109936
2010-07-31 00:32:17 +00:00
Dan Gohman
d566d2c7b5
Move MaximumAlignment to be a member of the Value class.
...
llvm-svn: 109891
2010-07-30 21:07:05 +00:00
Nick Lewycky
299c6dfcbf
Add missing newline to debug statement.
...
llvm-svn: 109886
2010-07-30 20:27:01 +00:00
Eli Friedman
0428a61e45
PR7750: !CExpr->isNullValue() only properly computes whether CExpr is nonnull
...
if CExpr is a ConstantInt.
llvm-svn: 109773
2010-07-29 18:03:33 +00:00
Gabor Greif
62f0aac99d
simplify by using CallSite constructors; virtually eliminates CallSite::get from the tree
...
llvm-svn: 109687
2010-07-28 22:50:26 +00:00
Dan Gohman
a7e5a24093
Define a maximum supported alignment value for load, store, and
...
alloca instructions (constrained by their internal encoding),
and add error checking for it. Fix an instcombine bug which
generated huge alignment values (null is infinitely aligned).
This fixes undefined behavior noticed by John Regehr.
llvm-svn: 109643
2010-07-28 20:12:04 +00:00
Dan Gohman
9cd20bf792
When user code intentionally dereferences null, the alignment of the
...
dereference is theoretically infinite. Put a cap on the computed
alignment to avoid overflow, noticed by John Regehr.
llvm-svn: 109596
2010-07-28 17:14:23 +00:00
Gabor Greif
f0084e1333
simplify
...
llvm-svn: 109589
2010-07-28 15:52:43 +00:00
Gabor Greif
0a970698da
use Value* constructor of CallSite to create potentially improper site, and test that
...
llvm-svn: 109581
2010-07-28 14:28:18 +00:00
Gabor Greif
f159085414
recommit simplification (r109502, backed out r109509); seems to innocent
...
llvm-svn: 109510
2010-07-27 16:44:23 +00:00
Gabor Greif
5f91b7cf3e
back out this too to restore the bots
...
llvm-svn: 109509
2010-07-27 15:56:07 +00:00
Gabor Greif
7b0a5fd2a5
simplify: CallSite::get --> CallSite constructor
...
llvm-svn: 109506
2010-07-27 15:02:37 +00:00
Gabor Greif
7527b2ed5c
simplify
...
llvm-svn: 109502
2010-07-27 13:31:22 +00:00
Owen Anderson
aa7f66ba67
Add an initial implementation of LazyValueInfo updating for JumpThreading. Disabled for now.
...
llvm-svn: 109424
2010-07-26 18:48:03 +00:00
Dan Gohman
0141c13b22
Remove LCSSA's bogus dependence on LoopSimplify and LoopSimplify's bogus
...
dependence on DominanceFrontier. Instead, add an explicit DominanceFrontier
pass in StandardPasses.h to ensure that it gets scheduled at the right
time.
Declare that loop unrolling preserves ScalarEvolution, and shuffle some
getAnalysisUsages.
This eliminates one LoopSimplify and one LCCSA run in the standard
compile opts sequence.
llvm-svn: 109413
2010-07-26 18:11:16 +00:00
Dan Gohman
a7908ae369
Preserve ScalarEvolution in the loop unroller.
...
llvm-svn: 109412
2010-07-26 18:02:06 +00:00
Dan Gohman
65b257c9d2
Use DominatorTree::properlyDominates instead of dominates with an
...
explicit inequality check.
llvm-svn: 109401
2010-07-26 17:37:36 +00:00
Dan Gohman
31f73ef210
A block dominates itself, by definition.
...
llvm-svn: 109400
2010-07-26 17:35:32 +00:00
Nick Lewycky
7bc0443f2b
Revert this because we can't clone cyclic MDNodes which are creating during a
...
build of llvm-gcc.
llvm-svn: 109355
2010-07-24 20:54:02 +00:00
Nick Lewycky
14b69d59dd
Whether function-local or not, a MDNode may reference a Function in which case
...
it needs to be mapped to refer to the function in the new module, not the old
one. Fixes PR7700.
llvm-svn: 109353
2010-07-24 19:43:25 +00:00
Devang Patel
5fa3813329
Speculatively revert 109117
...
llvm-svn: 109132
2010-07-22 18:44:00 +00:00
Gabor Greif
59f9970ba5
keep in 80 cols
...
llvm-svn: 109122
2010-07-22 17:18:03 +00:00
Devang Patel
fac440cfb6
Map MDNode correctly.
...
A non function local MDNode can have an operand which is cloned by MapValue().
llvm-svn: 109117
2010-07-22 16:35:00 +00:00