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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 3 03:32:25 PDT 2023

@@ -1969,6 +1973,11 @@ void LazyValueInfo::threadEdge(BasicBlock *PredBB, BasicBlock *OldSucc,
+void LazyValueInfo::eraseValue(Value *V, const Module *M) {
+  if (PImpl)
+    getImpl(PImpl, AC, M).eraseValue(V);
nikic wrote:

This is a bit awkward, because we only really need getImpl() if PImpl is not initialed yet, which it already is here. This results in the unnecessary Module argument. Can we just directly do the static_cast here? Or add a getImpl() variant that only returns LazyValueInfoImpl* if it is already initialized (and null otherwise)?


More information about the llvm-commits mailing list