[llvm] [JumpThreading] Invalidate LVI after `combineMetadataForCSE`. (PR #65219)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 3 02:21:15 PDT 2023


================
@@ -1269,6 +1269,7 @@ bool JumpThreadingPass::simplifyPartiallyRedundantLoad(LoadInst *LoadI) {
     if (IsLoadCSE) {
       LoadInst *NLoadI = cast<LoadInst>(AvailableVal);
       combineMetadataForCSE(NLoadI, LoadI, false);
+      LVI->eraseBlock(NLoadI->getParent());
----------------
nikic wrote:

It's not necessary to erase the whole block here. Just eraseValue() on the load should be enough, though you may need to publicly expose the API first (it's usually automatically called via ValueHandle).

https://github.com/llvm/llvm-project/pull/65219


More information about the llvm-commits mailing list