[PATCH] D39695: [IPO/LowerTypesTest] Skip blockaddress when replacing uses

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 15:57:54 PST 2017


davide added inline comments.


================
Comment at: lib/IR/Value.cpp:464
+    auto *Usr = dyn_cast<User>(U.getUser());
+    if (Usr && isa<BlockAddress>(Usr))
+      continue;
----------------
pcc wrote:
> Can this line just be
> `if (isa<BlockAddress>(U.getUser()))`
> ?
yes.


================
Comment at: test/Transforms/LowerTypeTests/blockaddress.ll:16
+; CHECK: p:
+; CHECK-NEXT:   call void @fq(i8* blockaddress(@fo.cfi, %p))
+; CHECK-NEXT:   ret void
----------------
pcc wrote:
> I think this test case is more complicated than it needs to be. This seems to be enough to trigger the bug:
> ```
> target triple = "x86_64-unknown-linux"
> 
> define void @f1() {
> entry:
>   %0 = call i1 @llvm.type.test(i8* bitcast (i8* ()* @f2 to i8*), metadata !"_ZTSFvP3bioE")
>   ret void
> }
> 
> declare i1 @llvm.type.test(i8*, metadata)
> 
> define i8* @f2() !type !5 {
>   br label %b
> 
> b:
>   ret i8* blockaddress(@f2, %b)
> }
> 
> !5 = !{i64 0, !"_ZTSFvP3bioE"}
> ```
> The only important part of the output is the body of `f2`, so I would only have `CHECK` lines for that.
yes, thanks for reducing further.


https://reviews.llvm.org/D39695





More information about the llvm-commits mailing list