Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4378,7 +4378,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
: llvm::Intrinsic::umax,
Op0, Op1, nullptr, "elt.max");
} else
Result = Builder.CreateMaxNum(Op0, Op1, "elt.max");
Result = Builder.CreateMaxNum(Op0, Op1, /*FMFSource=*/nullptr, "elt.max");
return RValue::get(Result);
}
case Builtin::BI__builtin_elementwise_min: {
Expand All @@ -4394,7 +4394,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
: llvm::Intrinsic::umin,
Op0, Op1, nullptr, "elt.min");
} else
Result = Builder.CreateMinNum(Op0, Op1, "elt.min");
Result = Builder.CreateMinNum(Op0, Op1, /*FMFSource=*/nullptr, "elt.min");
return RValue::get(Result);
}

Expand Down
16 changes: 10 additions & 6 deletions llvm/include/llvm/IR/IRBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -1005,23 +1005,27 @@ class IRBuilderBase {
const Twine &Name = "");

/// Create call to the minnum intrinsic.
Value *CreateMinNum(Value *LHS, Value *RHS, const Twine &Name = "") {
Value *CreateMinNum(Value *LHS, Value *RHS, FMFSource FMFSource = {},
const Twine &Name = "") {
if (IsFPConstrained) {
return CreateConstrainedFPUnroundedBinOp(
Intrinsic::experimental_constrained_minnum, LHS, RHS, nullptr, Name);
Intrinsic::experimental_constrained_minnum, LHS, RHS, FMFSource,
Name);
}

return CreateBinaryIntrinsic(Intrinsic::minnum, LHS, RHS, nullptr, Name);
return CreateBinaryIntrinsic(Intrinsic::minnum, LHS, RHS, FMFSource, Name);
}

/// Create call to the maxnum intrinsic.
Value *CreateMaxNum(Value *LHS, Value *RHS, const Twine &Name = "") {
Value *CreateMaxNum(Value *LHS, Value *RHS, FMFSource FMFSource = {},
const Twine &Name = "") {
if (IsFPConstrained) {
return CreateConstrainedFPUnroundedBinOp(
Intrinsic::experimental_constrained_maxnum, LHS, RHS, nullptr, Name);
Intrinsic::experimental_constrained_maxnum, LHS, RHS, FMFSource,
Name);
}

return CreateBinaryIntrinsic(Intrinsic::maxnum, LHS, RHS, nullptr, Name);
return CreateBinaryIntrinsic(Intrinsic::maxnum, LHS, RHS, FMFSource, Name);
}

/// Create call to the minimum intrinsic.
Expand Down
Loading