[Openmp-commits] [flang] [llvm] [mlir] [openmp] [MLIR][OpenMP] Add omp.fuse operation (PR #168898)

Michael Kruse via Openmp-commits openmp-commits at lists.llvm.org
Mon Feb 2 07:04:08 PST 2026


================
@@ -3435,6 +3435,20 @@ void NewCliOp::getAsmResultNames(OpAsmSetValueNameFn setNameFn) {
             .Case([&](UnrollHeuristicOp op) -> std::string {
               llvm_unreachable("heuristic unrolling does not generate a loop");
             })
+            .Case([&](FuseOp op) -> std::string {
+              unsigned int first = 0;
+              unsigned int count = 0;
+              if (op.getFirst() && op.getCount()) {
+                first = op.getFirst().getInt();
+                count = op.getCount().getInt();
+              }
+              unsigned opnum = generator->getOperandNumber();
+              if ((first != 0 && opnum <= first - 1) ||
+                  (count != 0 && opnum >= first + 1))
+                return "canonloop_fuse";
----------------
Meinersbur wrote:

IIUC, this check whether the operand number is within the permitted range for generated loops. This lambda should only ever be called on generated loops (which is which decides the register name). I.e. the situation should never happen and be unreachable. See the related `llvm_unreachable` for tile.

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


More information about the Openmp-commits mailing list