diff options
author | Carl Ritson <carl.ritson@amd.com> | 2025-05-14 12:34:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-14 12:34:27 +0900 |
commit | 036d637a1dc7be4af6178d4a4df32adaffbd9015 (patch) | |
tree | 87bf68a28f92cd9bebed7e7eb5a5f40b21ee9361 /llvm/lib/IR/Verifier.cpp | |
parent | 62a6218adb42557099da06c57edca0713c0dd700 (diff) | |
download | llvm-036d637a1dc7be4af6178d4a4df32adaffbd9015.zip llvm-036d637a1dc7be4af6178d4a4df32adaffbd9015.tar.gz llvm-036d637a1dc7be4af6178d4a4df32adaffbd9015.tar.bz2 |
[AMDGPU][Verifier] Allow llvm.amdgcn.unreachable after cs.chain (#139494)
Unreachable is transformed to llvm.amdgcn.unreachable() during exit
unification. Make sure the verifier tolerates this.
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 81cf53f..7979e19 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -6418,7 +6418,12 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) { "SGPR arguments must have the `inreg` attribute", &Call); Check(!Call.paramHasAttr(3, Attribute::InReg), "VGPR arguments must not have the `inreg` attribute", &Call); - Check(isa_and_present<UnreachableInst>(Call.getNextNode()), + + auto *Next = Call.getNextNonDebugInstruction(); + bool IsAMDUnreachable = Next && isa<IntrinsicInst>(Next) && + cast<IntrinsicInst>(Next)->getIntrinsicID() == + Intrinsic::amdgcn_unreachable; + Check(Next && (isa<UnreachableInst>(Next) || IsAMDUnreachable), "llvm.amdgcn.cs.chain must be followed by unreachable", &Call); break; } |