================
@@ -507,20 +507,35 @@ static llvm::Value *EmitPostAtomicMinMax(CGBuilderTy
&Builder,
bool IsSigned,
llvm::Value *OldVal,
llvm::Value *RHS) {
+ llvm::Type *ValTy = OldVal->getType();
+
llvm::CmpInst::Predicate Pred;
+ bool IsFP = ValTy->isFloatingPointTy();
+
switch (Op) {
default:
llvm_unreachable("Unexpected min/max operation");
+
case AtomicExpr::AO__atomic_max_fetch:
case AtomicExpr::AO__scoped_atomic_max_fetch:
- Pred = IsSigned ? llvm::CmpInst::ICMP_SGT : llvm::CmpInst::ICMP_UGT;
+ Pred = IsFP
+ ? llvm::CmpInst::FCMP_OGT
----------------
Amichaxx wrote:
Hi, thank you for another review. I've since amended this.
https://github.com/llvm/llvm-project/pull/160330
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits