diff options
author | Florian Hahn <flo@fhahn.com> | 2022-10-07 17:58:53 +0100 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2022-10-07 17:58:54 +0100 |
commit | 92f698f01fa0bb8967233a6391ada2d51849fa68 (patch) | |
tree | 865a18756ff683afb7ed6ed9424a2e2238bd9922 /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
parent | 70fb7bb561db39e648d1732c60190c8c09c5b1c5 (diff) | |
download | llvm-92f698f01fa0bb8967233a6391ada2d51849fa68.zip llvm-92f698f01fa0bb8967233a6391ada2d51849fa68.tar.gz llvm-92f698f01fa0bb8967233a6391ada2d51849fa68.tar.bz2 |
Revert "[SCEV] Support clearing Block/LoopDispositions for a single value."
This reverts commit 9e931439ddb9b6b8f655940b9d8ed6db50c2a7e2.
This commit causes a crash when TSan, e.g. with
https://lab.llvm.org/buildbot/#/builders/70/builds/28309/steps/10/logs/stdio
Reverting while I extract a reproducer and submit a fix.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index f247a7e..16085f4 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -647,22 +647,20 @@ ReprocessLoop: Instruction *Inst = &*I++; if (Inst == CI) continue; - bool InstInvariant = false; if (!L->makeLoopInvariant( - Inst, InstInvariant, + Inst, AnyInvariant, Preheader ? Preheader->getTerminator() : nullptr, MSSAU)) { AllInvariant = false; break; } - if (InstInvariant && SE) { - // The loop disposition of all SCEV expressions that depend on any - // hoisted values have also changed. - SE->forgetBlockAndLoopDispositions(Inst); - } - AnyInvariant |= InstInvariant; } - if (AnyInvariant) + if (AnyInvariant) { Changed = true; + // The loop disposition of all SCEV expressions that depend on any + // hoisted values have also changed. + if (SE) + SE->forgetLoopDispositions(); + } if (!AllInvariant) continue; // The block has now been cleared of all instructions except for |