[llvm-commits] [llvm] r66463 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Dan Gohman
gohman at apple.com
Mon Mar 9 14:04:19 PDT 2009
Author: djg
Date: Mon Mar 9 16:04:19 2009
New Revision: 66463
URL: http://llvm.org/viewvc/llvm-project?rev=66463&view=rev
Log:
Don't use an induction variable type as a memory access type.
Use VoidTy instead, to be properly conservative.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=66463&r1=66462&r2=66463&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Mar 9 16:04:19 2009
@@ -1774,7 +1774,7 @@
}
static bool IsImmFoldedIntoAddrMode(GlobalValue *GV, int64_t Offset,
- const Type *ReplacedTy,
+ const Type *AccessTy,
std::vector<BasedUser> &UsersToProcess,
const TargetLowering *TLI) {
SmallVector<Instruction*, 16> AddrModeInsts;
@@ -1783,7 +1783,7 @@
continue;
ExtAddrMode AddrMode =
AddressingModeMatcher::Match(UsersToProcess[i].OperandValToReplace,
- ReplacedTy, UsersToProcess[i].Inst,
+ AccessTy, UsersToProcess[i].Inst,
AddrModeInsts, *TLI);
if (GV && GV != AddrMode.BaseGV)
return false;
@@ -1858,7 +1858,9 @@
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Imm))
Offset = SC->getValue()->getSExtValue();
if (GV || Offset)
- DoSink = IsImmFoldedIntoAddrMode(GV, Offset, ReplacedTy,
+ // Pass VoidTy as the AccessTy to be conservative, because
+ // there could be multiple access types among all the uses.
+ DoSink = IsImmFoldedIntoAddrMode(GV, Offset, Type::VoidTy,
UsersToProcess, TLI);
if (DoSink) {
More information about the llvm-commits
mailing list