[llvm] Add code to handle llvm.dbg.values in SROA. (PR #94068)

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 09:10:23 PDT 2024


================
@@ -341,6 +341,13 @@ class DbgVariableIntrinsic : public DbgInfoIntrinsic {
     return getIntrinsicID() == Intrinsic::dbg_declare;
   }
 
+  /// Does this describe the value of a local variable. True for dbg.value,
+  /// but not dbg.declare, which describes its address, or dbg.assign, which
+  /// describes a combination of the variable's value and address.
+  bool isValueOfVariable() const {
+    return getIntrinsicID() == Intrinsic::dbg_value;
----------------
adrian-prantl wrote:

how is this condition true for a dbg.assign (as indicated in the comment), does it share the same intrinsic ID?

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


More information about the llvm-commits mailing list