[Mlir-commits] [flang] [mlir] [MLIR] Add ComplexTOROCDL pass (PR #144926)

Krzysztof Drewniak llvmlistbot at llvm.org
Thu Jun 19 16:12:41 PDT 2025


================
@@ -0,0 +1,94 @@
+//===-- ComplexToROCDL.cpp - conversion from Complex to ROCDL calls -------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Conversion/ComplexToROCDL/ComplexToROCDL.h"
+#include "mlir/Dialect/Complex/IR/Complex.h"
+#include "mlir/Dialect/Func/IR/FuncOps.h"
+#include "mlir/IR/PatternMatch.h"
+#include "mlir/Transforms/DialectConversion.h"
+#include <optional>
+
+namespace mlir {
+#define GEN_PASS_DEF_CONVERTCOMPLEXTOROCDL
+#include "mlir/Conversion/Passes.h.inc"
+} // namespace mlir
+
+using namespace mlir;
+
+namespace {
+struct FloatTypeResolver {
+  std::optional<bool> operator()(Type type) const {
----------------
krzysz00 wrote:

This is going to explode in fantastic fashion whenever there's f16 complex functions. Can we just explicitly test for `isa<F64Type>()` on doubles?

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


More information about the Mlir-commits mailing list