aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2022-10-07 17:58:53 +0100
committerFlorian Hahn <flo@fhahn.com>2022-10-07 17:58:54 +0100
commit92f698f01fa0bb8967233a6391ada2d51849fa68 (patch)
tree865a18756ff683afb7ed6ed9424a2e2238bd9922 /llvm/lib/Transforms/Utils/LoopSimplify.cpp
parent70fb7bb561db39e648d1732c60190c8c09c5b1c5 (diff)
downloadllvm-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.cpp16
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