1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[OperandBundles] Have TailCallElim play nice with operand bundles

A call site's use of a Value might not correspond to an argument
operand but to a bundle operand.

This fixes PR25928.

llvm-svn: 256328
This commit is contained in:
David Majnemer 2015-12-23 09:58:43 +00:00
parent d697901638
commit 86245dd102
2 changed files with 12 additions and 2 deletions

View File

@ -197,8 +197,8 @@ struct AllocaDerivedValueTracker {
case Instruction::Call:
case Instruction::Invoke: {
CallSite CS(I);
bool IsNocapture = !CS.isCallee(U) &&
CS.doesNotCapture(CS.getArgumentNo(U));
bool IsNocapture =
CS.isDataOperand(U) && CS.doesNotCapture(CS.getDataOperandNo(U));
callUsesLocalStack(CS, IsNocapture);
if (IsNocapture) {
// If the alloca-derived argument is passed in as nocapture, then it

View File

@ -188,3 +188,13 @@ define void @test11() {
; CHECK: call void @test11_helper2
ret void
}
; PR25928
define void @test12() {
entry:
; CHECK-LABEL: @test12
; CHECK: {{^ *}} call void undef(i8* undef) [ "foo"(i8* %e) ]
%e = alloca i8
call void undef(i8* undef) [ "foo"(i8* %e) ]
unreachable
}