================
@@ -18,6 +18,90 @@
using namespace clang;
using namespace clang::CIRGen;
+using namespace cir;
+
+static mlir::Value emitBinaryExpMaybeConstrainedFPBuiltin(
+ CIRGenFunction &CGF, const CallExpr *E, llvm::StringRef IntrinsicName,
+ llvm::StringRef ConstrainedIntrinsicName) {
+ mlir::Value Src0 = CGF.emitScalarExpr(E->getArg(0));
+ mlir::Value Src1 = CGF.emitScalarExpr(E->getArg(1));
+
+ auto &Builder = CGF.getBuilder();
+
+ CIRGenFunction::CIRGenFPOptionsRAII FPOptsRAII(CGF, E);
+
+ if (Builder.getIsFPConstrained()) {
+ return cir::LLVMIntrinsicCallOp::create(
+ Builder, CGF.getLoc(E->getExprLoc()),
+ Builder.getStringAttr(ConstrainedIntrinsicName), Src0.getType(),
+ {Src0, Src1})
+ .getResult();
+ }
+
+ return cir::LLVMIntrinsicCallOp::create(Builder, CGF.getLoc(E->getExprLoc()),
+ Builder.getStringAttr(IntrinsicName),
+ Src0.getType(), {Src0, Src1})
+ .getResult();
+}
+
+static mlir::Value emitLogbBuiltin(CIRGenFunction &CGF, const CallExpr *E,
+ bool IsFloat) {
+ auto &Builder = CGF.getBuilder();
----------------
andykaylor wrote:
Don't use `auto` here. One way CIR doesn't follow MLIR style is in the
aggressive use of `auto`.
https://github.com/llvm/llvm-project/pull/191344
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits