A call site's use of a Value might not correspond to an argument
operand but to a bundle operand.
This fixes PR25928.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256328
91177308-0d34-0410-b5e6-
96231b3b80d8
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
; 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
+}