[PATCH] D48331: [WIP][DebugInfo][InstCombine] Preserve DI after merging zext instructions

Anastasis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 06:08:03 PDT 2018


gramanas added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:1094
+            if (DIExp) {
+              return DIExpression::createFragmentExpression(
+                         DIExp, DestBitSize - SrcBitsKept,
----------------
vsk wrote:
> You mentioned offline that this causes a verifier failure. If we can't use fragments, consider using a simpler approach for scalars: using an empty expression. It won't work for vectors, but in the scalar case, the high bits should already be cleared. We can relax the check in https://reviews.llvm.org/D48408 to allow this.
If I use an empty DIExpression it doesn't change the fact that the dbg.value call points to a DILocalVariable that after instcombine has a different DIBasicType than what it used to.

Basiacly the dbg.value call says that the value was changed to an i32 but the it's type is still i8 in the debug info. If there is a way to explain this to the debugger using DIExpressions, I can't find it.


Repository:
  rL LLVM

https://reviews.llvm.org/D48331





More information about the llvm-commits mailing list