[llvm] 52ec983 - Make wrong preallocated arg count verifier error clearer

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 18:31:46 PDT 2020


Author: Arthur Eubanks
Date: 2020-04-29T18:31:30-07:00
New Revision: 52ec983895436089c5be0b0c4d967423db16045b

URL: https://github.com/llvm/llvm-project/commit/52ec983895436089c5be0b0c4d967423db16045b
DIFF: https://github.com/llvm/llvm-project/commit/52ec983895436089c5be0b0c4d967423db16045b.diff

LOG: Make wrong preallocated arg count verifier error clearer

Reviewers: rnk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79128

Added: 
    

Modified: 
    llvm/lib/IR/Verifier.cpp
    llvm/test/Verifier/preallocated-invalid.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 636849c3000f..77e005418dfa 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -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.

diff  --git a/llvm/test/Verifier/preallocated-invalid.ll b/llvm/test/Verifier/preallocated-invalid.ll
index 4b1b0f7b1e23..770199d653a2 100644
--- a/llvm/test/Verifier/preallocated-invalid.ll
+++ b/llvm/test/Verifier/preallocated-invalid.ll
@@ -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)


        


More information about the llvm-commits mailing list