Don't use an induction variable type as a memory access type.

Use VoidTy instead, to be properly conservative.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66463 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2009-03-09 21:04:19 +00:00
parent 21e7722868
commit 53f2ae268a

View File

@ -1774,7 +1774,7 @@ LoopStrengthReduce::PrepareToStrengthReduceFromSmallerStride(
} }
static bool IsImmFoldedIntoAddrMode(GlobalValue *GV, int64_t Offset, static bool IsImmFoldedIntoAddrMode(GlobalValue *GV, int64_t Offset,
const Type *ReplacedTy, const Type *AccessTy,
std::vector<BasedUser> &UsersToProcess, std::vector<BasedUser> &UsersToProcess,
const TargetLowering *TLI) { const TargetLowering *TLI) {
SmallVector<Instruction*, 16> AddrModeInsts; SmallVector<Instruction*, 16> AddrModeInsts;
@ -1783,7 +1783,7 @@ static bool IsImmFoldedIntoAddrMode(GlobalValue *GV, int64_t Offset,
continue; continue;
ExtAddrMode AddrMode = ExtAddrMode AddrMode =
AddressingModeMatcher::Match(UsersToProcess[i].OperandValToReplace, AddressingModeMatcher::Match(UsersToProcess[i].OperandValToReplace,
ReplacedTy, UsersToProcess[i].Inst, AccessTy, UsersToProcess[i].Inst,
AddrModeInsts, *TLI); AddrModeInsts, *TLI);
if (GV && GV != AddrMode.BaseGV) if (GV && GV != AddrMode.BaseGV)
return false; return false;
@ -1858,7 +1858,9 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Imm)) if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Imm))
Offset = SC->getValue()->getSExtValue(); Offset = SC->getValue()->getSExtValue();
if (GV || Offset) 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); UsersToProcess, TLI);
if (DoSink) { if (DoSink) {