llvm-project/llvm/lib/Transforms/Scalar
Dan Gohman eb6be650ce Teach IndVarSimplify to optimize code using the C "int" type for
loop induction on LP64 targets. When the induction variable is
used in addressing, IndVars now is usually able to inserst a
64-bit induction variable and eliminates the sign-extending cast.
This is also useful for code using C "short" types for
induction variables on targets with 32-bit addressing.

Inserting a wider induction variable is easy; the tricky part is
determining when trunc(sext(i)) expressions are no-ops. This
requires range analysis of the loop trip count. A common case is
when the original loop iteration starts at 0 and exits when the
induction variable is signed-less-than a fixed value; this case
is now handled.

This replaces IndVarSimplify's OptimizeCanonicalIVType. It was
doing the same optimization, but it was limited to loops with
constant trip counts, because it was running after the loop
rewrite, and the information about the original induction
variable is lost by that point.

Rename ScalarEvolution's executesAtLeastOnce to
isLoopGuardedByCond, generalize it to be able to test for
ICMP_NE conditions, and move it to be a public function so that
IndVars can use it.

llvm-svn: 64407
2009-02-12 22:19:27 +00:00
..
ADCE.cpp Let instcombiner remove redundant dbg intrinsics. 2008-11-19 18:59:41 +00:00
BasicBlockPlacement.cpp Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00
CMakeLists.txt CMake: updated list of source files. 2008-11-05 00:11:22 +00:00
CodeGenPrepare.cpp fix PR3537: if resetting bbi back to the start of a block, we need to 2009-02-12 06:56:08 +00:00
CondPropagate.cpp Insert space to avoid warning and make code more readable. 2009-02-07 03:36:02 +00:00
ConstantProp.cpp Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00
DCE.cpp simplify this logic. 2008-11-27 22:46:09 +00:00
DeadStoreElimination.cpp Rename getABITypeSize to getTypePaddedSize, as 2009-01-12 20:38:59 +00:00
GVN.cpp improve naming of values in GVN, patch by Jay Foad! 2009-02-12 07:00:35 +00:00
GVNPRE.cpp Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00
IndVarSimplify.cpp Teach IndVarSimplify to optimize code using the C "int" type for 2009-02-12 22:19:27 +00:00
InstructionCombining.cpp the two non-mask arguments to a shufflevector must be the same width, but they do not have to be the same 2009-02-11 22:36:25 +00:00
JumpThreading.cpp Fix PR3353, infinitely jump threading an infinite loop make from switches. 2009-01-19 21:20:34 +00:00
LICM.cpp This code doesn't actually use the ExitingBlocks list. 2009-02-12 16:36:26 +00:00
LoopDeletion.cpp Change create*Pass factory functions to return Pass* instead of 2008-10-22 23:32:42 +00:00
LoopIndexSplit.cpp Add a utility function to LoopInfo to return the exit block 2009-02-12 18:08:24 +00:00
LoopRotation.cpp Rename getAnalysisToUpdate to getAnalysisIfAvailable. 2009-01-28 13:14:17 +00:00
LoopStrengthReduce.cpp Fix PR 3471, and some cleanups. 2009-02-09 22:14:15 +00:00
LoopUnroll.cpp Rename getAnalysisToUpdate to getAnalysisIfAvailable. 2009-01-28 13:14:17 +00:00
LoopUnswitch.cpp If "optimize for size" attribute is set then block non-trivial loop unswitches but allow trivial loop unswitches. 2009-02-03 22:04:27 +00:00
Makefile Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
MemCpyOptimizer.cpp Rename getABITypeSize to getTypePaddedSize, as 2009-01-12 20:38:59 +00:00
PredicateSimplifier.cpp Silence unused variable warnings. 2008-11-21 20:00:59 +00:00
Reassociate.cpp Fix build failure. 2008-11-21 21:00:20 +00:00
Reg2Mem.cpp Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00
SCCP.cpp Add the private linkage. 2009-01-15 20:18:42 +00:00
Scalar.cpp C and Objective Caml bindings for mem2reg and reg2mem. 2008-03-20 17:16:03 +00:00
ScalarReplAggregates.cpp Use early exits. Reduce indentation. 2009-02-10 19:28:07 +00:00
SimplifyCFGPass.cpp Large mechanical patch. 2008-09-25 21:00:45 +00:00
SimplifyHalfPowrLibCalls.cpp eliminate warning when asserts disabled. 2008-12-14 21:36:23 +00:00
SimplifyLibCalls.cpp Don't mark all args to strtod and friends as nocapture. 2009-02-12 03:18:34 +00:00
TailDuplication.cpp simplify code. 2008-11-27 22:56:14 +00:00
TailRecursionElimination.cpp Tidy up several unbeseeming casts from pointer to intptr_t. 2008-09-04 17:05:41 +00:00