[clang] Clang: Drop float support from __builtin_elementwise_max (PR #180885)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 11 00:52:08 PST 2026


================
@@ -4072,30 +4066,26 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
     Value *Op0 = EmitScalarExpr(E->getArg(0));
     Value *Op1 = EmitScalarExpr(E->getArg(1));
     Value *Result;
-    if (Op0->getType()->isIntOrIntVectorTy()) {
-      QualType Ty = E->getArg(0)->getType();
-      if (auto *VecTy = Ty->getAs<VectorType>())
-        Ty = VecTy->getElementType();
-      Result = Builder.CreateBinaryIntrinsic(
-          Ty->isSignedIntegerType() ? Intrinsic::smax : Intrinsic::umax, Op0,
-          Op1, nullptr, "elt.max");
-    } else
-      Result = Builder.CreateMaxNum(Op0, Op1, /*FMFSource=*/nullptr, "elt.max");
+    assert(Op0->getType()->isIntOrIntVectorTy());
----------------
nikic wrote:

There should also be a change somewhere else that makes this an error at the Sema level. This can't just assert if you try to use it with floats, it needs to error cleanly.

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


More information about the cfe-commits mailing list