[llvm] 00f90d3 - Verifier: Reword range metadata error message (#102441)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 03:05:27 PDT 2024


Author: Matt Arsenault
Date: 2024-08-08T14:05:23+04:00
New Revision: 00f90d394ae42a490f87076c69f7c00f53f77fd7

URL: https://github.com/llvm/llvm-project/commit/00f90d394ae42a490f87076c69f7c00f53f77fd7
DIFF: https://github.com/llvm/llvm-project/commit/00f90d394ae42a490f87076c69f7c00f53f77fd7.diff

LOG: Verifier: Reword range metadata error message (#102441)

Added: 
    

Modified: 
    llvm/lib/IR/Verifier.cpp
    llvm/test/Verifier/absolute_symbol.ll
    llvm/test/Verifier/range-1.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 4bcd799718c4e5..402af376651eb6 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -4142,8 +4142,10 @@ void Verifier::verifyRangeMetadata(const Value &I, const MDNode *Range,
     ConstantInt *High =
         mdconst::dyn_extract<ConstantInt>(Range->getOperand(2 * i + 1));
     Check(High, "The upper limit must be an integer!", High);
-    Check(High->getType() == Low->getType() &&
-          High->getType() == Ty->getScalarType(),
+
+    Check(High->getType() == Low->getType(), "Range pair types must match!",
+          &I);
+    Check(High->getType() == Ty->getScalarType(),
           "Range types must match instruction type!", &I);
 
     APInt HighV = High->getValue();

diff  --git a/llvm/test/Verifier/absolute_symbol.ll b/llvm/test/Verifier/absolute_symbol.ll
index 631f35585f288b..df3da8e547cb37 100644
--- a/llvm/test/Verifier/absolute_symbol.ll
+++ b/llvm/test/Verifier/absolute_symbol.ll
@@ -58,11 +58,11 @@ define void @absolute_func_empty_arguments() !absolute_symbol !0 {
 ; CHECK-NEXT: ptr @absolute_two_arguments_wrong_width
 !4 = !{i32 256, i32 512}
 
-; CHECK-NEXT: Range types must match instruction type!
+; CHECK-NEXT: Range pair types must match!
 ; CHECK-NEXT: ptr @absolute_two_arguments_one_wrong_width0
 !5 = !{i32 256, i64 512}
 
-; CHECK-NEXT: Range types must match instruction type!
+; CHECK-NEXT: Range pair types must match!
 ; CHECK-NEXT: ptr @absolute_two_arguments_one_wrong_width1
 !6 = !{i64 256, i32 512}
 

diff  --git a/llvm/test/Verifier/range-1.ll b/llvm/test/Verifier/range-1.ll
index ed1b6dc60fa678..d81f3a430749ab 100644
--- a/llvm/test/Verifier/range-1.ll
+++ b/llvm/test/Verifier/range-1.ll
@@ -47,7 +47,7 @@ entry:
   ret i8 %y
 }
 !5 = !{i32 0, i8 0}
-; CHECK: Range types must match instruction type!
+; CHECK: Range pair types must match!
 ; CHECK:  %y = load
 
 define i8 @f7(ptr %x) {
@@ -56,7 +56,7 @@ entry:
   ret i8 %y
 }
 !6 = !{i8 0, i32 0}
-; CHECK: Range types must match instruction type!
+; CHECK: Range pair types must match!
 ; CHECK:  %y = load
 
 define i8 @f8(ptr %x) {


        


More information about the llvm-commits mailing list