Skip to content

Commit

Permalink
Make wrong preallocated arg count verifier error clearer
Browse files Browse the repository at this point in the history
Reviewers: rnk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79128
  • Loading branch information
aeubanks committed Apr 30, 2020
1 parent 7a80139 commit 52ec983
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/IR/Verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4507,8 +4507,9 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
}
Assert(NumArgs->equalsInt(NumPreallocatedArgs),
"llvm.call.preallocated.setup arg size must be equal to number "
"of arguments "
"at call site");
"of preallocated arguments "
"at call site",
Call, *UseCall);
// getOperandBundle() cannot be called if more than one of the operand
// bundle exists. There is already a check elsewhere for this, so skip
// here if we see more than one.
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Verifier/preallocated-invalid.ll
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ define void @preallocated_require_bundle() {
ret void
}

; CHECK: arg size must be equal to number of arguments
; CHECK: arg size must be equal to number of preallocated arguments
define void @preallocated_num_args() {
%cs = call token @llvm.call.preallocated.setup(i32 3)
%x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
Expand Down

0 comments on commit 52ec983

Please sign in to comment.