implement Transforms/LoopStrengthReduce/invariant_value_first_arg.ll

llvm-svn: 20501
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 7ba4b81..d2cef4b 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -154,7 +154,7 @@
       inc_op_vector.push_back(ConstantInt::get(Ty, 1));
       indvar = op;
       break;
-    } else if (isa<Constant>(operand)) {
+    } else if (isa<Constant>(operand) || isa<Argument>(operand)) {
       pre_op_vector.push_back(operand);
     } else if (Instruction *inst = dyn_cast<Instruction>(operand)) {
       if (!DS->dominates(inst, Preheader->getTerminator()))