[llvm] [AMDGPU][Verifier] Allow llvm.amdgcn.unreachable after cs.chain (PR #139494)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 00:14:41 PDT 2025


================
@@ -6417,7 +6417,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.getNextNode();
+    bool IsAMDUnreachable = isa<IntrinsicInst>(Next) &&
----------------
ro-i wrote:

while `isa<UnreachableInst>(Next)` below is guarded by a null-pointer check, I think the same would be required here? (or `isa_and_present`)

https://github.com/llvm/llvm-project/pull/139494


More information about the llvm-commits mailing list