aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-06-24 11:11:52 +0900
committerGitHub <noreply@github.com>2025-06-24 11:11:52 +0900
commitf0d898f36bceff94d40e2022814978fa5fd0cc8f (patch)
tree513168356923fe1d8ce431534bb4d8397250bef6 /llvm/lib/IR/Verifier.cpp
parent90a6819cfe08da0dd9f2a06958933b07ca11ff75 (diff)
downloadllvm-f0d898f36bceff94d40e2022814978fa5fd0cc8f.zip
llvm-f0d898f36bceff94d40e2022814978fa5fd0cc8f.tar.gz
llvm-f0d898f36bceff94d40e2022814978fa5fd0cc8f.tar.bz2
DAG: Move get_dynamic_area_offset type check to IR verifier (#145268)
Also fix the LangRef to match the implementation. This was checking against the alloca address space size rather than the default address space. The check was also more permissive than the LangRef. The error check permitted any size less than the pointer size; follow the stricter wording of the LangRef.
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index f0a4d7b..7126134 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -6061,6 +6061,15 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
"va_start called in a non-varargs function");
break;
}
+ case Intrinsic::get_dynamic_area_offset: {
+ auto *IntTy = dyn_cast<IntegerType>(Call.getType());
+ Check(IntTy && DL.getPointerSizeInBits(DL.getAllocaAddrSpace()) ==
+ IntTy->getBitWidth(),
+ "get_dynamic_area_offset result type must be scalar integer matching "
+ "alloca address space width",
+ Call);
+ break;
+ }
case Intrinsic::vector_reduce_and:
case Intrinsic::vector_reduce_or:
case Intrinsic::vector_reduce_xor: