[llvm] [IR] Add CallBr intrinsics support (PR #133907)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 2 00:44:44 PDT 2025


================
@@ -3385,8 +3385,26 @@ void SelectionDAGBuilder::visitCallBr(const CallBrInst &I) {
              {LLVMContext::OB_deopt, LLVMContext::OB_funclet}) &&
          "Cannot lower callbrs with arbitrary operand bundles yet!");
 
-  assert(I.isInlineAsm() && "Only know how to handle inlineasm callbr");
-  visitInlineAsm(I);
+  if (I.isInlineAsm()) {
+    visitInlineAsm(I);
+  } else if (I.getIntrinsicID() != Intrinsic::not_intrinsic) {
+    switch (I.getIntrinsicID()) {
+    default:
+      report_fatal_error("Unsupported intrinsic for callbr");
+    case Intrinsic::amdgcn_kill:
+      if (I.getNumIndirectDests() != 1)
+        report_fatal_error(
+            "amdgcn.kill supportes exactly one indirect destination");
----------------
ro-i wrote:

ok, since I already have it implemented in the verifier, I just remove the check here

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


More information about the llvm-commits mailing list