[PATCH] D85172: Teach SROA to handle allocas with more than one dbg.declare.

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 17:47:54 PDT 2020


compnerd accepted this revision.
compnerd added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:4534
+        if (OldDII->getVariable() == DbgDeclare->getVariable() &&
+            OldDII->getDebugLoc()->getInlinedAt() == InlinedAt)
+          OldDII->eraseFromParent();
----------------
I wonder if its better to define a helper equality check function:

```
auto IdenticalInlinedFragment = [](const DbgVariableInstric *LHS, const DbgVariableIntrinsic *RHS) -> Bool {
  return LHS->getVariable() == RHS->getVariable() &&
    LHS->getDebugLoc()->getInlinedAt() == RHS->getDebugLoc()->getInlinedAt();
}
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85172/new/

https://reviews.llvm.org/D85172



More information about the llvm-commits mailing list