From: Jonas Paulsson Date: Wed, 9 Aug 2017 11:27:46 +0000 (+0000) Subject: [LoopStrengthReduce] Don't neglect the Fixup.Offset in isAMCompletelyFolded(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae207e1d7d472b18279c096e4b6bfd3c75fd1171;p=llvm [LoopStrengthReduce] Don't neglect the Fixup.Offset in isAMCompletelyFolded(). In the recursive call to isAMCompletelyFolded(), the passed offset should be the sum of F.BaseOffset and Fixup.Offset. Review: Quentin Colombet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310462 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 44911983435..fb0d2b3de48 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -1657,8 +1657,8 @@ static bool isAMCompletelyFolded(const TargetTransformInfo &TTI, if (LU.Kind == LSRUse::Address && TTI.LSRWithInstrQueries()) { for (const LSRFixup &Fixup : LU.Fixups) if (!isAMCompletelyFolded(TTI, LSRUse::Address, LU.AccessTy, F.BaseGV, - F.BaseOffset, F.HasBaseReg, F.Scale, - Fixup.UserInst)) + (F.BaseOffset + Fixup.Offset), F.HasBaseReg, + F.Scale, Fixup.UserInst)) return false; return true; }