diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 41d2134488da..9143f56d4d7c 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -690,6 +690,7 @@ RemoveCommonExpressionsFromUseBases(std::vector &Uses) { Uses[i].Base = Zero; else Uses[i].Base = SCEVAddExpr::get(SubExprs); + SubExprs.clear(); } return Result;