[llvm] [RemoveDIs] Fix SimplifyCFG behaviour to match existing behaviour (PR #82981)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 02:56:30 PST 2024


================
@@ -3208,8 +3208,8 @@ bool SimplifyCFGOpt::SpeculativelyExecuteBB(BranchInst *BI,
   // end of this block.
   for (auto &It : make_range(ThenBB->begin(), ThenBB->end()))
     for (DbgRecord &DR : make_early_inc_range(It.getDbgValueRange()))
-      if (DPValue *DPV = dyn_cast<DPValue>(&DR); DPV && !DPV->isDbgAssign())
-        It.dropOneDbgValue(DPV);
+      if (DPValue *DPV = dyn_cast<DPValue>(&DR); !DPV || !DPV->isDbgAssign())
+        It.dropOneDbgValue(&DR);
----------------
OCHyams wrote:

> Is this condition going to become !isa<DbgAssign> in the future-class-refactor?

It may, I'm not sure we ever landed on a decision as to whether we should extract the 3 DPValue kinds into their own classes too. But yes I can add a comment, SGTM

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


More information about the llvm-commits mailing list