Dan Gohman
d9b9ed628f
Tell ScalarEvolution to forget a loop before starting to delete it.
...
This way ScalarEvolution can examine the loop to determine what state
it needs to update, if it chooses.
llvm-svn: 75029
2009-07-08 19:14:29 +00:00
Owen Anderson
332aae685b
Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
...
llvm-svn: 75025
2009-07-08 19:03:57 +00:00
Nick Lewycky
d46a7b2d22
Remove the vicmp and vfcmp instructions. Because we never had a release with
...
these instructions, no autoupgrade or backwards compatibility support is
provided.
llvm-svn: 74991
2009-07-08 03:04:38 +00:00
Owen Anderson
7a1f69e433
Push LLVMContext through GlobalVariables and IRBuilder.
...
llvm-svn: 74985
2009-07-08 01:26:06 +00:00
Dan Gohman
dd7f97c496
Change all SCEV* to SCEV *.
...
llvm-svn: 74918
2009-07-07 17:06:11 +00:00
Owen Anderson
121f736d9c
"LLVMContext* " --> "LLVMContext *"
...
llvm-svn: 74878
2009-07-06 23:00:19 +00:00
Owen Anderson
5f268720e9
Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's through the ValueTracking API.
...
llvm-svn: 74873
2009-07-06 22:37:39 +00:00
Owen Anderson
ad3229d281
Thread LLVMContext through the constant folding APIs, which touches a lot of files.
...
llvm-svn: 74844
2009-07-06 18:42:36 +00:00
Owen Anderson
4eb0f1a3bd
More LLVMContext-ification.
...
llvm-svn: 74811
2009-07-06 01:34:54 +00:00
Owen Anderson
977aa11bc6
More LLVMContext-ification.
...
llvm-svn: 74807
2009-07-05 22:41:43 +00:00
Mike Stump
78ecb66f56
Fix build.
...
llvm-svn: 74782
2009-07-03 22:11:58 +00:00
Owen Anderson
a8ce571a68
Even more passes being LLVMContext'd.
...
llvm-svn: 74781
2009-07-03 19:42:02 +00:00
Nick Lewycky
b01a2dc7ba
Add Static Single Information construction pass written by André Tavares!
...
Use it by requiring it through the pass manager, then calling its createSSI
method on the variables that you want in SSI form.
llvm-svn: 74780
2009-07-03 19:28:36 +00:00
Duncan Sands
1708a93077
Add newline at end of file.
...
llvm-svn: 74773
2009-07-03 15:30:58 +00:00
Owen Anderson
6795819c9e
Second batch of passes using LLVMContext.
...
llvm-svn: 74753
2009-07-03 00:54:20 +00:00
Owen Anderson
7fb95ff5dd
Convert the first batch of passes to use LLVMContext.
...
llvm-svn: 74748
2009-07-03 00:17:18 +00:00
Chris Lattner
3d8ec50f8a
fix inverted logic pointed out by John McCall, noticed by inspection.
...
This was considering vector intrinsics to have cost 2, but non-vector
intrinsics to have cost 1, which is backward.
llvm-svn: 74698
2009-07-02 15:39:39 +00:00
Dan Gohman
e89dc58a7e
Fix a bunch of other places that used operator[] to test whether
...
a key is present in a std::map or DenseMap to use find instead.
llvm-svn: 74676
2009-07-02 00:17:47 +00:00
Dan Gohman
499f79ba60
Request LCSSA after LoopSimplify. This fixes a problem in which the
...
PassManager was scheduling LCSSA before LoopSimplify, which does not
preserve LCSSA.
llvm-svn: 74661
2009-07-01 23:21:38 +00:00
Dan Gohman
e3b1f9e14b
Fix an instcombine abort on a scalar-to-vector bitcast. This fixes PR4487.
...
llvm-svn: 74646
2009-07-01 21:38:46 +00:00
Owen Anderson
81b8dabb53
Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
...
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.
Patches for Clang and LLVM-GCC to follow.
llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Chris Lattner
4bdaace06e
improve the APIs for creating struct and function types with no arguments/elements
...
to not have to create a temporary vector (in the API at least). Patch by Jay Foad!
llvm-svn: 74584
2009-07-01 04:13:31 +00:00
Dan Gohman
49c397bf4b
Minor code simplification.
...
llvm-svn: 74491
2009-06-30 01:24:43 +00:00
Dan Gohman
28702fab4e
Don't try to split a loop when the controlling icmp instruction
...
doesn't have an IV-based operand. This fixes PR4471.
llvm-svn: 74399
2009-06-27 22:58:27 +00:00
Dan Gohman
fcd5eedead
Remove the block from the LoopInfo, rather than just the Loop.
...
LoopInfo will handle removing it from the Loop, as well as updating
its own tables.
llvm-svn: 74398
2009-06-27 22:32:36 +00:00
Dan Gohman
8d2a45fadb
Teach LoopSimplify how to merge multiple loop exits into a single exit,
...
when one of them can be converted to a trivial icmp and conditional
branch.
This addresses what is essentially a phase ordering problem.
SimplifyCFG knows how to do this transformation, but it doesn't do so
if the primary block has any instructions in it other than an icmp and
a branch. In the given testcase, the block contains other instructions,
however they are loop-invariant and can be hoisted. SimplifyCFG doesn't
have LoopInfo though, so it can't hoist them. And, it's important that
the blocks be merged before LoopRotation, as it doesn't support
multiple-exit loops.
llvm-svn: 74396
2009-06-27 21:30:38 +00:00
Dan Gohman
a753bd44ff
More minor code simplifications.
...
llvm-svn: 74395
2009-06-27 21:23:40 +00:00
Dan Gohman
4acfd5098d
When a value is used multiple times within a single PHI, instructions
...
inserted to replace that value must dominate all of of the basic
blocks associated with the uses of the value in the PHI, not just
one of them.
llvm-svn: 74376
2009-06-27 05:16:57 +00:00
Dan Gohman
4f74e815f1
Incorporate the insertion point into the key of SCEVExpander's CSE map.
...
This helps it avoid reusing an instruction that doesn't dominate all
of the users, in cases where the original instruction was inserted
before all of the users were known. This may result in redundant
expansions of sub-expressions that depend on loop-unpredictable values
in some cases, however this isn't very common, and it primarily impacts
IndVarSimplify, so GVN can be expected to clean these up.
This eliminates the need for IndVarSimplify's FixUsesBeforeDefs,
which fixes several bugs.
llvm-svn: 74352
2009-06-26 22:53:46 +00:00
Devang Patel
4f5d296df0
Remove unused routines.
...
llvm-svn: 74351
2009-06-26 22:53:22 +00:00
Owen Anderson
2bcd131128
Constify this value.
...
llvm-svn: 74330
2009-06-26 21:39:56 +00:00
Douglas Gregor
6d9b0e8c19
Fix linking of llvm-ld and lli with CMake, from Xerxes Rånby
...
llvm-svn: 74285
2009-06-26 15:37:00 +00:00
Devang Patel
84a8914a4a
Remove debug info anchors - llvm.dbg.compile_units, llvm.dbg.subprograms
...
and llvm.dbg.global_variables.
llvm-svn: 74251
2009-06-26 01:49:18 +00:00
Dan Gohman
71b1c43d91
Change this code to a form about which VC++ reportedly isn't unhappy.
...
llvm-svn: 74243
2009-06-26 00:35:12 +00:00
Dan Gohman
ba8760719f
Fix LCSSA to avoid emitting a PHI node for the unwind destination of
...
an invoke instruction, since the value isn't really live across that
edge.
llvm-svn: 74242
2009-06-26 00:31:13 +00:00
Dan Gohman
3983d5070b
Minor code simplification.
...
llvm-svn: 74240
2009-06-26 00:26:03 +00:00
Dan Gohman
68902a1ad2
Reword a few comments.
...
llvm-svn: 74146
2009-06-25 00:22:44 +00:00
Dan Gohman
c2c1e1ff38
When inserting code into a loop preheader, insert it before the
...
terminator, instead of after the last phi. This fixes a bug
exposed by ScalarEvolution analyzing more kinds of loops.
This fixes PR4436.
llvm-svn: 74072
2009-06-24 14:31:06 +00:00
Dan Gohman
4f4bda36df
Extend ScalarEvolution's multiple-exit support to compute exact
...
trip counts in more cases.
Generalize ScalarEvolution's isLoopGuardedByCond code to recognize
And and Or conditions, splitting the code out into an
isNecessaryCond helper function so that it can evaluate Ands and Ors
recursively, and make SCEVExpander be much more aggressive about
hoisting instructions out of loops.
test/CodeGen/X86/pr3495.ll has an additional instruction now, but
it appears to be due to an arbitrary register allocation difference.
llvm-svn: 74048
2009-06-24 01:18:18 +00:00
Dan Gohman
1eb6954545
Don't emit a redundant BitCastInst if the value to be defined in the
...
preheader is already an instruction.
llvm-svn: 74031
2009-06-24 00:28:59 +00:00
Dan Gohman
b4f58ad636
Fix a few minor issues that were exposed by the removal of SCEVHandle.
...
llvm-svn: 73910
2009-06-22 22:08:45 +00:00
Owen Anderson
c023151c9f
SCEVHandle is no more!
...
llvm-svn: 73906
2009-06-22 21:39:50 +00:00
Dan Gohman
8426522d55
Fix this code to correctly handle loops with multiple exits. Until
...
now, this hasn't mattered, because ScalarEvolution hasn't been able
to compute trip counts for loops with multiple exits. But it will
soon.
llvm-svn: 73864
2009-06-22 00:15:15 +00:00
Dan Gohman
1a33c92bb2
Rename a variable for consistency with the ExitBlock vs ExitingBlock
...
terminology that LoopInfo uses.
llvm-svn: 73863
2009-06-21 23:48:38 +00:00
Dan Gohman
a81541945b
Fix a typo in a comment that Frits von Bommel noticed.
...
llvm-svn: 73796
2009-06-19 23:41:37 +00:00
Dan Gohman
651faa1905
Re-apply r73718, now that the fix in r73787 is in, and add a
...
hand-crafted testcase which demonstrates the bug that was exposed
in 254.gap.
llvm-svn: 73793
2009-06-19 23:23:27 +00:00
Dan Gohman
9bd151655f
Fix LSR's OptimizeSMax to ignore max operators with more than 2 operands,
...
which it isn't prepared to handle.
llvm-svn: 73787
2009-06-19 23:03:46 +00:00
Evan Cheng
b90241ac42
Revert 73718. It's breaking 254.gap.
...
llvm-svn: 73783
2009-06-19 21:15:06 +00:00
Chris Lattner
8f6f044afd
make jump threading handle lexically identical compare instructions
...
as if they were multiple uses of the same instruction. This interacts
well with the existing loadpre that j-t does to open up many new jump
threads earlier.
llvm-svn: 73768
2009-06-19 16:27:56 +00:00
Nick Lewycky
a5f89b09c6
Teach jump threading to look at comparisons between phi nodes and non-constants.
...
llvm-svn: 73755
2009-06-19 04:56:29 +00:00