[PATCH] D75352: Add rsqrt op to Standard dialect and lower it to LLVM dialect.

Adrian Kuegel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 05:02:58 PST 2020


akuegel marked 2 inline comments as done.
akuegel added inline comments.


================
Comment at: mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp:1686
+        loc, typeConverter.convertType(operandType),
+        rewriter.getF32FloatAttr(1.0));
+    auto sqrt = rewriter.create<LLVM::SqrtOp>(loc, transformed.operand());
----------------
ftynse wrote:
> This may not necessarily work if the operand type is not float. Maybe you could dispatch to different attributes based on type?
I tried to fix this by using getFloatAttr(operandType, 1.0) instead. Not sure whether operandType is the actual type it expects here though. Now I get llvm.float / llvm.double as types for the constants, before it was f32.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75352/new/

https://reviews.llvm.org/D75352





More information about the llvm-commits mailing list