[llvm] [RemoveDIs] Enable conversion from dbg.declare to DPValue (PR #74090)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 07:20:59 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Orlando Cazalet-Hyams (OCHyams)

<details>
<summary>Changes</summary>

The testing situation here is a little bit difficult. Most of the dbg.declare support patches depend on this patch to be able to test them. However, landing this patch first would result in ~10-15 test failures in tests that already `--try-experimental-debuginfo-iterators` that contain both dbg.values (already fully supported and being tested) and dbg.declares (support in flight: shouldn't really be tested yet - those updates would come as support is added to each pass etc, as we did with dbg.values, if that were possible).

Options:
1) Land this patch first. Remove `--try-experimental-debuginfo-iterators` from those failing tests in this patch, re-add as those passes get dbg.declare support/fixes.
2) Land this patch last. All the dbg.declare-support patches get test updates... but are rotten-green-tests until this patch lands (because the DPValue "declare" path isn't hit without this patch).
3) Squash all the dbg.declare support patches together.

Any strong opinions on the options above? I have listed them in order of personal preference (1 being most preferred), but am happy to go with any as they all have pros & cons.

---
Full diff: https://github.com/llvm/llvm-project/pull/74090.diff


1 Files Affected:

- (modified) llvm/lib/IR/BasicBlock.cpp (+4-1) 


``````````diff
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 0a8fddbe102538d..eefa46a581f6185 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -73,7 +73,10 @@ void BasicBlock::convertToNewDbgValues() {
   SmallVector<DPValue *, 4> DPVals;
   for (Instruction &I : make_early_inc_range(InstList)) {
     assert(!I.DbgMarker && "DbgMarker already set on old-format instrs?");
-    if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(&I)) {
+    if (DbgVariableIntrinsic *DVI = dyn_cast<DbgVariableIntrinsic>(&I)) {
+      if (isa<DbgAssignIntrinsic>(DVI))
+        continue;
+
       // Convert this dbg.value to a DPValue.
       DPValue *Value = new DPValue(DVI);
       DPVals.push_back(Value);

``````````

</details>


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


More information about the llvm-commits mailing list