[Mlir-commits] [mlir] [MLIR][ROCDL] Convert `math::fpowi` to ROCDL call (PR #122640)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Jan 12 20:19:14 PST 2025


================
@@ -58,7 +59,8 @@ struct OpToFuncCallLowering : public ConvertOpToLLVMPattern<SourceOp> {
         "expected single result op");
 
     static_assert(std::is_base_of<OpTrait::SameOperandsAndResultType<SourceOp>,
-                                  SourceOp>::value,
+                                  SourceOp>::value ||
+                      std::is_same_v<SourceOp, math::FPowIOp>,
----------------
lialan wrote:

>  Maybe turn this into a runtime assertion and check that the first operand and have the same type

Yeah it looks like a hack, but honestly, isn't checking only the first operand relaxes even more of the static_assert checks? 

Well I cannot think of a better way to do it so I just went with your suggestion to check the first operand. 


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


More information about the Mlir-commits mailing list