[PATCH] D43129: [Utils] Salvage debug info from dead 'or' instructions

Ismail Badawi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 10:43:47 PST 2018


ibadawi added inline comments.


================
Comment at: lib/Transforms/Utils/Local.cpp:1545
           for (auto *DII : DbgUsers)
-            applyOffset(DII, ConstInt->getSExtValue());
+            if (BI->getOpcode() == Instruction::Add)
+              applyOffset(DII, Val);
----------------
aprantl wrote:
> That codepath doesn't look like it's tested?
This is the original code path, covered by test/Transforms/InstCombine/debuginfo_add.ll.


================
Comment at: lib/Transforms/Utils/Local.cpp:1548
+            else if (BI->getOpcode() == Instruction::Or)
+              applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_or});
+        }
----------------
aprantl wrote:
> Could any of the other cases be refactored to make use of this new helper, too?
I considered also extracting the load case below, but it made things a bit messy since it's not a stack value, so I left it alone.


Repository:
  rL LLVM

https://reviews.llvm.org/D43129





More information about the llvm-commits mailing list