summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGAtomic.cpp
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2025-10-13 13:23:20 -0700
committerFlorian Mayer <fmayer@google.com>2025-10-13 13:23:20 -0700
commitccc6fad8951b12dbe5fde7d8d00b9c959e36fa00 (patch)
treeb17aad8d549af17c7f8411ecd5ccc6ecfd4b1499 /clang/lib/CodeGen/CGAtomic.cpp
parent82a427702eb2c83ff571670a73071420f0b31546 (diff)
parent55d4e92c8821d5543469118a76fe38db866377b7 (diff)
[𝘀𝗽𝗿] changes introduced through rebaseusers/fmayer/spr/main.flowsensitive-statusor-2n-add-minimal-model
Created using spr 1.3.4 [skip ci]
Diffstat (limited to 'clang/lib/CodeGen/CGAtomic.cpp')
-rw-r--r--clang/lib/CodeGen/CGAtomic.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGAtomic.cpp b/clang/lib/CodeGen/CGAtomic.cpp
index 4a3446abcc78..d95dab3a19fe 100644
--- a/clang/lib/CodeGen/CGAtomic.cpp
+++ b/clang/lib/CodeGen/CGAtomic.cpp
@@ -507,6 +507,18 @@ static llvm::Value *EmitPostAtomicMinMax(CGBuilderTy &Builder,
bool IsSigned,
llvm::Value *OldVal,
llvm::Value *RHS) {
+ const bool IsFP = OldVal->getType()->isFloatingPointTy();
+
+ if (IsFP) {
+ llvm::Intrinsic::ID IID = (Op == AtomicExpr::AO__atomic_max_fetch ||
+ Op == AtomicExpr::AO__scoped_atomic_max_fetch)
+ ? llvm::Intrinsic::maxnum
+ : llvm::Intrinsic::minnum;
+
+ return Builder.CreateBinaryIntrinsic(IID, OldVal, RHS, llvm::FMFSource(),
+ "newval");
+ }
+
llvm::CmpInst::Predicate Pred;
switch (Op) {
default: