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

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 09:14:02 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;
----------------
SLTozer wrote:

I read this as being that it describes dbg.value, but not (dbg.declare or dbg.assign).

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


More information about the llvm-commits mailing list