diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-03-11 18:03:05 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-03-11 18:03:05 +0000 |
| commit | d61a6fd8ed3c2547ba6896881f6b681afa9276ff (patch) | |
| tree | 099b582942aca09e075ea3bf7831264b50315f55 /llvm/test | |
| parent | 81514e0660d19506db2bcc78eff670043be73d42 (diff) | |
| download | bcm5719-llvm-d61a6fd8ed3c2547ba6896881f6b681afa9276ff.tar.gz bcm5719-llvm-d61a6fd8ed3c2547ba6896881f6b681afa9276ff.zip | |
InstCombine: Don't fold call bitcast into args if callee is byval
This fixes a bug reported here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150309/265341.html
llvm-svn: 231948
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/call-cast-target.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/call-cast-target.ll b/llvm/test/Transforms/InstCombine/call-cast-target.ll index 4a5c94961e2..881e80762ea 100644 --- a/llvm/test/Transforms/InstCombine/call-cast-target.ll +++ b/llvm/test/Transforms/InstCombine/call-cast-target.ll @@ -72,3 +72,18 @@ entry: %call = tail call i32 bitcast (i32 (i32)* @fn4 to i32 (i32*)*)(i32* %a) ret i32 %call } + +declare i1 @fn5({ i32, i32 }* byval align 4 %r) + +define i1 @test5() { +; CHECK-LABEL: @test5 +; CHECK: %[[call:.*]] = call i1 bitcast (i1 ({ i32, i32 }*)* @fn5 to i1 (i32, i32)*)(i32 {{.*}}, i32 {{.*}}) +; CHECK-NEXT: ret i1 %[[call]] + %1 = alloca { i32, i32 }, align 4 + %2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 0 + %3 = load i32, i32* %2, align 4 + %4 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 1 + %5 = load i32, i32* %4, align 4 + %6 = call i1 bitcast (i1 ({ i32, i32 }*)* @fn5 to i1 (i32, i32)*)(i32 %3, i32 %5) + ret i1 %6 +} |

