[Mlir-commits] [mlir] [MLIR][NVVM] Add rsqrt Op (PR #195854)

Pradeep Kumar llvmlistbot at llvm.org
Tue May 5 22:22:19 PDT 2026


================
@@ -3515,6 +3515,25 @@ Ex2Op::getIntrinsicIDAndArgs(Operation &op, LLVM::ModuleTranslation &mt,
   return {id, {mt.lookupValue(thisOp.getSrc())}};
 }
 
+mlir::NVVM::IDArgPair
+RsqrtApproxOp::getIntrinsicIDAndArgs(Operation &op, LLVM::ModuleTranslation &mt,
+                                     llvm::IRBuilderBase &builder) {
+  auto thisOp = cast<NVVM::RsqrtApproxOp>(op);
+  Type t = thisOp.getRes().getType();
+  bool isFtz = thisOp.getFtz();
+
+  llvm::Intrinsic::ID id = [&] {
+    if (t.isF32())
+      return isFtz ? llvm::Intrinsic::nvvm_rsqrt_approx_ftz_f
----------------
schwarzschild-radius wrote:

But the region itself only has single statement, right? (https://llvm.org/docs/CodingStandards.html#id60)

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


More information about the Mlir-commits mailing list