LSR fix: "Special" users are just like "Basic" users but allow -1 scale.
authorAndrew Trick <atrick@apple.com>
Fri, 15 Jun 2012 20:07:26 +0000 (20:07 +0000)
committerAndrew Trick <atrick@apple.com>
Fri, 15 Jun 2012 20:07:26 +0000 (20:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158536 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index 94c229a8e2440da07c098ec18102cd6a1bd81b9e..963811ee2798a9cc0f7575752546b3f890c4ad84 100644 (file)
@@ -1308,8 +1308,8 @@ static bool isLegalUse(const TargetLowering::AddrMode &AM,
     return !AM.BaseGV && AM.Scale == 0 && AM.BaseOffs == 0;
 
   case LSRUse::Special:
-    // Only handle -1 scales, or no scale.
-    return AM.Scale == 0 || AM.Scale == -1;
+    // Special case Basic to handle -1 scales.
+    return !AM.BaseGV && (AM.Scale == 0 || AM.Scale == -1) && AM.BaseOffs == 0;
   }
 
   llvm_unreachable("Invalid LSRUse Kind!");