[PATCH] D16187: [SROA] Also insert a bit piece expression if only one piece is needed

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 09:18:21 PST 2016


aprantl added inline comments.

================
Comment at: test/Transforms/SROA/dbg-single-piece.ll:12
@@ +11,3 @@
+  %retval = alloca %foo, align 8
+  call void @llvm.dbg.declare(metadata %foo* %retval, metadata !1, metadata !7), !dbg !8
+; CHECK: call void @llvm.dbg.value(metadata %foo* undef, i64 0, metadata !1, metadata ![[BIT_PIECE:[0-9]+]]), !dbg !8
----------------
loladiro wrote:
> aprantl wrote:
> > I think we should also check for the sroa'd alloca and verify that its size matches the size of the OP_bit_piece.
> The problem is that it gets mem2reged so won't be in the final IR.
I see. Maybe add CHECK-NOT: dbg.value before and after to ensure we actually hit the case where there is only one alloca?

================
Comment at: test/Transforms/SROA/dbg-single-piece.ll:14
@@ +13,3 @@
+; CHECK: call void @llvm.dbg.value(metadata %foo* undef, i64 0, metadata !1, metadata ![[BIT_PIECE:[0-9]+]]), !dbg !8
+; CHECK: ![[BIT_PIECE]] = !DIExpression(DW_OP_bit_piece, 64, 64)
+  %0 = bitcast %foo* %retval to i8*
----------------
loladiro wrote:
> aprantl wrote:
> > Comment?
> > ; If SROA creates only one piece (e.g. because the other is not needed), it still needs to create a bit_piece expression if that bit piece is smaller than the original size of the alloca.
> > 
> I have a comment at the very top. Do you want me to move it here?
My bad! I didn't see it. That said, moving it closer to the CHECK might be a good idea.


Repository:
  rL LLVM

http://reviews.llvm.org/D16187





More information about the llvm-commits mailing list