[Mlir-commits] [mlir] [MLIR][LLVM] Support for indirectbr (PR #135092)

Tobias Gysi llvmlistbot at llvm.org
Sun Apr 13 10:16:41 PDT 2025


================
@@ -2306,19 +2306,31 @@ static LogicalResult verifyComdat(Operation *op,
 static LogicalResult verifyBlockTags(LLVMFuncOp funcOp) {
   llvm::DenseSet<BlockTagAttr> blockTags;
   BlockTagOp badBlockTagOp;
+  enum { DupTag, UnrecheableBlock } errorMsgType;
   if (funcOp
           .walk([&](BlockTagOp blockTagOp) {
+            mlir::Block *block = blockTagOp->getBlock();
+            if (!block->isEntryBlock() && block->use_empty()) {
+              badBlockTagOp = blockTagOp;
+              errorMsgType = UnrecheableBlock;
----------------
gysit wrote:

Can you put `blockTagOp.emitError() << ...` here and in the place where we detect the other error? Then `badBlockTagOp` and `errorMsgType` are probably not needed?

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


More information about the Mlir-commits mailing list