[clang] [CIR] X86 vector fcmp-sse vector builtins (PR #167125)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 10 10:09:50 PST 2025
================
@@ -43,7 +43,56 @@ mlir::Value CIRGenFunction::emitX86BuiltinExpr(unsigned builtinID,
// Find out if any arguments are required to be integer constant expressions.
assert(!cir::MissingFeatures::handleBuiltinICEArguments());
- switch (builtinID) {
+ llvm::SmallVector<mlir::Value, 4> Ops;
+
+ // Find out if any arguments are required to be integer constant expressions.
+ unsigned ICEArguments = 0;
+ ASTContext::GetBuiltinTypeError Error;
+ getContext().GetBuiltinType(BuiltinID, Error, &ICEArguments);
+ assert(Error == ASTContext::GE_None && "Should not codegen an error");
+ for (unsigned i = 0, e = E->getNumArgs(); i != e; i++) {
+ Ops.push_back(emitScalarOrConstFoldImmArg(ICEArguments, i, E));
+ }
+
+ // OG has unordered comparison as a form of optimization in addition to
+ // ordered comparison, while CIR doesn't.
----------------
andykaylor wrote:
This is fine for the current PR, but we should really revisit this. Both the `llvm` and `arith` dialects have separate `icmp` and `fcmp` operations, each with their own set of predicates. We should follow that model.
https://github.com/llvm/llvm-project/pull/167125
More information about the cfe-commits
mailing list