[llvm] [GVN] Invalidate ICF cache when clearing the instructions (PR #68145)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 11:52:56 PDT 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
<details>
<summary>Changes</summary>
This fixes #<!-- -->48805
/home/user/llvm-project/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp:93: void llvm::InstructionPrecedenceTracking::validate(const llvm::BasicBlock *) const: Assertion `It->second == &Insn && "Cached first special instruction is wrong!"' failed.
---
Full diff: https://github.com/llvm/llvm-project/pull/68145.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/Scalar/GVN.cpp (+1)
``````````diff
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index bc54846ccf0ad2d..f7a905c2e13c4d4 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -2799,6 +2799,7 @@ bool GVNPass::processBlock(BasicBlock *BB) {
salvageDebugInfo(*I);
removeInstruction(I);
}
+ ICF->clear();
InstrsToErase.clear();
if (AtStart)
``````````
</details>
https://github.com/llvm/llvm-project/pull/68145
More information about the llvm-commits
mailing list