From 8868faec63ce47d47b5b4c8e4414a8ca6c3d5833 Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Mon, 26 Sep 2011 23:35:25 +0000 Subject: [PATCH] LSR, one of the new Cost::isLoser() checks did not get merged in the previous checkin. llvm-svn: 140583 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 1e5b56bc4e28..0ad9fc384110 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -745,9 +745,13 @@ void Cost::RateRegister(const SCEV *Reg, // Add the step value register, if it needs one. // TODO: The non-affine case isn't precisely modeled here. - if (!AR->isAffine() || !isa(AR->getOperand(1))) - if (!Regs.count(AR->getOperand(1))) + if (!AR->isAffine() || !isa(AR->getOperand(1))) { + if (!Regs.count(AR->getOperand(1))) { RateRegister(AR->getOperand(1), Regs, L, SE, DT); + if (isLoser()) + return; + } + } } ++NumRegs;