Fix a few more places where induction variable types were used
authorDan Gohman <gohman@apple.com>
Mon, 9 Mar 2009 21:22:12 +0000 (21:22 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 9 Mar 2009 21:22:12 +0000 (21:22 +0000)
where memory access types are needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66470 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index acd253185ffded24c5bc818967664c1bdebaa1c0..859da1aaca4fa95f8e5c825437175d040eea42dd 100644 (file)
@@ -1834,7 +1834,7 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
   if (TLI && HaveCommonExprs && AllUsesAreAddresses) {
     SCEVHandle NewCommon = CommonExprs;
     SCEVHandle Imm = SE->getIntegerSCEV(0, ReplacedTy);
-    MoveImmediateValues(TLI, ReplacedTy, NewCommon, Imm, true, L, SE);
+    MoveImmediateValues(TLI, Type::VoidTy, NewCommon, Imm, true, L, SE);
     if (!Imm->isZero()) {
       bool DoSink = true;
 
@@ -1933,7 +1933,7 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
     // this by forcing a BitCast (noop cast) to be inserted into the preheader 
     // in this case.
     if (Constant *C = dyn_cast<Constant>(BaseV)) {
-      if (!C->isNullValue() && !fitsInAddressMode(Base, ReplacedTy, 
+      if (!C->isNullValue() && !fitsInAddressMode(Base, getAccessType(Inst),
                                                  TLI, false)) {
         // We want this constant emitted into the preheader! This is just
         // using cast as a copy so BitCast (no-op cast) is appropriate