================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to