[PATCH] D49677: [WIP][IC][DebugInfo] Preserve DI value when folding cast into phi

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 23 10:32:05 PDT 2018


vsk added a comment.

Thanks, a few comments inline --



================
Comment at: test/Transforms/InstCombine/phi_cast.ll:7
+
+define i32 @icmp_div(i16 %a, i16 %c) {
+entry:
----------------
Why not define in 'i1 %cond' etc. as function parameters? Then the `icmp` and `sdiv` become unnecessary.


================
Comment at: test/Transforms/InstCombine/phi_cast.ll:19
+;; CHECK-LABEL: exit:
+;; CHECK:         [[phi:%.*]] = phi i1 {{.*}}
+;; CHECK-NEXT:    call void @llvm.dbg.value(metadata i1 [[phi]], {{.*}}, metadata !DIExpression())
----------------
Hold on, if this is a `phi i1`, then doesn't that mean that 'foldOpIntoPhi' didn't trigger?


================
Comment at: test/Transforms/InstCombine/phi_cast.ll:24
+  %phi = phi i1 [ false, %entry ], [ %cmp, %then ]
+  call void asm sideeffect "", "i"(i1 %phi)
+  %zext = zext i1 %phi to i32
----------------
Doesn't "i" mean "An integer constant (of target-specific width)"? I'm not sure whether the instruction is well-formed without a constraint, but if it isn't, then the "r" (register) constraint seems like the appropriate one here.


Repository:
  rL LLVM

https://reviews.llvm.org/D49677





More information about the llvm-commits mailing list