summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AtomicExpandPass.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-01-22 18:18:02 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-01-22 18:18:02 +0000
commit39508331ef7e9417afc43f634c0ef23eb768d974 (patch)
tree37138807947246687637b0b5eccc66f6b5b9ed61 /llvm/lib/CodeGen/AtomicExpandPass.cpp
parent1c5d23f1405994da05697b3b66c9f5a32735fdc3 (diff)
downloadbcm5719-llvm-39508331ef7e9417afc43f634c0ef23eb768d974.tar.gz
bcm5719-llvm-39508331ef7e9417afc43f634c0ef23eb768d974.zip
Reapply "IR: Add fp operations to atomicrmw"
This reapplies commits r351778 and r351782 with RISCV test fixes. llvm-svn: 351850
Diffstat (limited to 'llvm/lib/CodeGen/AtomicExpandPass.cpp')
-rw-r--r--llvm/lib/CodeGen/AtomicExpandPass.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp
index bef9682fbd5..2d915945392 100644
--- a/llvm/lib/CodeGen/AtomicExpandPass.cpp
+++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp
@@ -549,6 +549,10 @@ static Value *performAtomicOp(AtomicRMWInst::BinOp Op, IRBuilder<> &Builder,
case AtomicRMWInst::UMin:
NewVal = Builder.CreateICmpULE(Loaded, Inc);
return Builder.CreateSelect(NewVal, Loaded, Inc, "new");
+ case AtomicRMWInst::FAdd:
+ return Builder.CreateFAdd(Loaded, Inc, "new");
+ case AtomicRMWInst::FSub:
+ return Builder.CreateFSub(Loaded, Inc, "new");
default:
llvm_unreachable("Unknown atomic op");
}
@@ -1547,6 +1551,8 @@ static ArrayRef<RTLIB::Libcall> GetRMWLibcall(AtomicRMWInst::BinOp Op) {
case AtomicRMWInst::Min:
case AtomicRMWInst::UMax:
case AtomicRMWInst::UMin:
+ case AtomicRMWInst::FAdd:
+ case AtomicRMWInst::FSub:
// No atomic libcalls are available for max/min/umax/umin.
return {};
}
OpenPOWER on IntegriCloud