Skip to content

Commit 2107db2

Browse files
committed
remove non-elementwise
1 parent a74ef8f commit 2107db2

File tree

5 files changed

+56
-284
lines changed

5 files changed

+56
-284
lines changed

clang/include/clang/Basic/Builtins.td

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,6 @@ def FmaxF16F128 : Builtin, F16F128MathTemplate {
209209
let Prototype = "T(T, T)";
210210
}
211211

212-
def MinNum : Builtin {
213-
let Spellings = ["__builtin_minnum"];
214-
let Attributes = [FunctionWithBuiltinPrefix, NoThrow, Const, CustomTypeChecking, Constexpr];
215-
let Prototype = "void(...)";
216-
}
217-
218-
def MaxNum : Builtin {
219-
let Spellings = ["__builtin_maxnum"];
220-
let Attributes = [FunctionWithBuiltinPrefix, NoThrow, Const, CustomTypeChecking, Constexpr];
221-
let Prototype = "void(...)";
222-
}
223-
224212
def FminF16F128 : Builtin, F16F128MathTemplate {
225213
let Spellings = ["__builtin_fmin"];
226214
let Attributes = [FunctionWithBuiltinPrefix, NoThrow, Const, Constexpr];

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2569,7 +2569,6 @@ class Sema final : public SemaBase {
25692569
ExprResult AtomicOpsOverloaded(ExprResult TheCallResult,
25702570
AtomicExpr::AtomicOp Op);
25712571

2572-
bool BuiltinMaxNumMinNumMath(CallExpr *TheCall);
25732572
/// \param FPOnly restricts the arguments to floating-point types.
25742573
bool BuiltinElementwiseMath(CallExpr *TheCall, bool FPOnly = false);
25752574
bool PrepareBuiltinReduceMathOneArgCall(CallExpr *TheCall);

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3220,16 +3220,6 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
32203220
Intrinsic::minnum,
32213221
Intrinsic::experimental_constrained_minnum));
32223222

3223-
case Builtin::BI__builtin_maxnum:
3224-
return RValue::get(emitBinaryMaybeConstrainedFPBuiltin(
3225-
*this, E, Intrinsic::maxnum,
3226-
Intrinsic::experimental_constrained_maxnum));
3227-
3228-
case Builtin::BI__builtin_minnum:
3229-
return RValue::get(emitBinaryMaybeConstrainedFPBuiltin(
3230-
*this, E, Intrinsic::minnum,
3231-
Intrinsic::experimental_constrained_minnum));
3232-
32333223
case Builtin::BIfmaximum_num:
32343224
case Builtin::BIfmaximum_numf:
32353225
case Builtin::BIfmaximum_numl:

clang/lib/Sema/SemaChecking.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,13 +2753,6 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
27532753
break;
27542754
}
27552755

2756-
case Builtin::BI__builtin_minnum:
2757-
case Builtin::BI__builtin_maxnum: {
2758-
if (BuiltinMaxNumMinNumMath(TheCall))
2759-
return ExprError();
2760-
break;
2761-
}
2762-
27632756
// These builtins restrict the element type to floating point
27642757
// types only, and take in two arguments.
27652758
case Builtin::BI__builtin_elementwise_minnum:
@@ -15243,42 +15236,6 @@ bool Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) {
1524315236
return false;
1524415237
}
1524515238

15246-
bool Sema::BuiltinMaxNumMinNumMath(CallExpr *TheCall) {
15247-
if (checkArgCount(TheCall, 2))
15248-
return true;
15249-
15250-
ExprResult OrigArg0 = TheCall->getArg(0);
15251-
ExprResult OrigArg1 = TheCall->getArg(1);
15252-
15253-
// Do standard promotions between the two arguments, returning their common
15254-
// type.
15255-
QualType Res = UsualArithmeticConversions(
15256-
OrigArg0, OrigArg1, TheCall->getExprLoc(), ACK_Comparison);
15257-
if (OrigArg0.isInvalid() || OrigArg1.isInvalid())
15258-
return true;
15259-
15260-
// Make sure any conversions are pushed back into the call; this is
15261-
// type safe since unordered compare builtins are declared as "_Bool
15262-
// foo(...)".
15263-
TheCall->setArg(0, OrigArg0.get());
15264-
TheCall->setArg(1, OrigArg1.get());
15265-
15266-
if (!OrigArg0.get()->isTypeDependent() && OrigArg1.get()->isTypeDependent())
15267-
return true;
15268-
15269-
// If the common type isn't a real floating type, then the arguments were
15270-
// invalid for this operation.
15271-
if (Res.isNull() || !Res->isRealFloatingType())
15272-
return Diag(OrigArg0.get()->getBeginLoc(),
15273-
diag::err_typecheck_call_invalid_ordered_compare)
15274-
<< OrigArg0.get()->getType() << OrigArg1.get()->getType()
15275-
<< SourceRange(OrigArg0.get()->getBeginLoc(),
15276-
OrigArg1.get()->getEndLoc());
15277-
15278-
TheCall->setType(Res);
15279-
return false;
15280-
}
15281-
1528215239
bool Sema::BuiltinElementwiseMath(CallExpr *TheCall, bool FPOnly) {
1528315240
if (auto Res = BuiltinVectorMath(TheCall, FPOnly); Res.has_value()) {
1528415241
TheCall->setType(*Res);

0 commit comments

Comments
 (0)