[PATCH] D86939: [LSR] Canonicalize a formula before insert it into the list
Mindong Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 1 07:15:15 PDT 2020
mdchen created this revision.
mdchen added reviewers: qcolombet, mkazantsev, amehsan.
mdchen added a project: LLVM.
Herald added subscribers: llvm-commits, hiraditya.
mdchen requested review of this revision.
In GenerateConstantOffsetsImpl, we may generate non canonical
Formula if BaseRegs of that Formula is updated and includes a
recurrent expr reg related with current loop while its ScaledReg
is not.
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=47329
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D86939
Files:
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -3836,8 +3836,12 @@
return;
if (IsScaledReg)
F.ScaledReg = G;
- else
+ else {
F.BaseRegs[Idx] = G;
+ // We may generate non canonical Formula if G is a recurrent expr reg
+ // related with current loop while F.ScaledReg is not.
+ F.canonicalize(*L);
+ }
(void)InsertFormula(LU, LUIdx, F);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86939.289160.patch
Type: text/x-patch
Size: 563 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200901/dc2780d9/attachment.bin>
More information about the llvm-commits
mailing list