aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorShilei Tian <i@tianshilei.me>2025-04-11 15:32:37 -0400
committerGitHub <noreply@github.com>2025-04-11 15:32:37 -0400
commita45b133d400b0e57ca1ba70d50a91fbdf11d3b93 (patch)
treee01ca56034a065d03ea33b352318ade8912efbcf /llvm/lib/IR/Verifier.cpp
parent32c39092eab3a401d9d028c21f4707102fd70e32 (diff)
downloadllvm-a45b133d400b0e57ca1ba70d50a91fbdf11d3b93.zip
llvm-a45b133d400b0e57ca1ba70d50a91fbdf11d3b93.tar.gz
llvm-a45b133d400b0e57ca1ba70d50a91fbdf11d3b93.tar.bz2
[AMDGPU][Verifier] Mark calls to entry functions as invalid in the IR verifier (#134910)
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 7d32bf2..e3f6c1a 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3596,14 +3596,9 @@ void Verifier::visitCallBase(CallBase &Call) {
Check(Callee->getValueType() == FTy,
"Intrinsic called with incompatible signature", Call);
- // Disallow calls to functions with the amdgpu_cs_chain[_preserve] calling
- // convention.
- auto CC = Call.getCallingConv();
- Check(CC != CallingConv::AMDGPU_CS_Chain &&
- CC != CallingConv::AMDGPU_CS_ChainPreserve,
- "Direct calls to amdgpu_cs_chain/amdgpu_cs_chain_preserve functions "
- "not allowed. Please use the @llvm.amdgpu.cs.chain intrinsic instead.",
- Call);
+ // Verify if the calling convention of the callee is callable.
+ Check(isCallableCC(Call.getCallingConv()),
+ "calling convention does not permit calls", Call);
// Disallow passing/returning values with alignment higher than we can
// represent.