diff options
author | Nikita Popov <npopov@redhat.com> | 2024-09-20 16:57:46 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2024-09-20 17:01:41 +0200 |
commit | 5bcc82d43388bb0daa122d5fe7ecda5eca27fc16 (patch) | |
tree | 416ab521c2ab07cab0804e8440496c61e53d05b3 /llvm/lib/Transforms/Utils/LoopPeel.cpp | |
parent | c498af71d73e96e95730f3b3caaea08d3edbe62c (diff) | |
download | llvm-5bcc82d43388bb0daa122d5fe7ecda5eca27fc16.zip llvm-5bcc82d43388bb0daa122d5fe7ecda5eca27fc16.tar.gz llvm-5bcc82d43388bb0daa122d5fe7ecda5eca27fc16.tar.bz2 |
[LoopPeel] Fix LCSSA phi node invalidation
In the test case, the BECount of the second loop uses %load,
but we only have an LCSSA phi node for %add, so that is what
gets invalidated. Use the forgetLcssaPhiWithNewPredecessor()
API instead, which will invalidate the roots of the expression
instead.
Fixes https://github.com/llvm/llvm-project/issues/109333.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopPeel.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopPeel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp index 5d7c0d9..760f161 100644 --- a/llvm/lib/Transforms/Utils/LoopPeel.cpp +++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp @@ -859,7 +859,7 @@ static void cloneLoopBlocks( if (LatchInst && L->contains(LatchInst)) LatchVal = VMap[LatchVal]; PHI.addIncoming(LatchVal, cast<BasicBlock>(VMap[Edge.first])); - SE.forgetValue(&PHI); + SE.forgetLcssaPhiWithNewPredecessor(L, &PHI); } // LastValueMap is updated with the values for the current loop |