summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AtomicExpandPass.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-01-22 03:32:36 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-01-22 03:32:36 +0000
commitbfdba5e4fc351d3de15d5536a1d4e04a16573ddf (patch)
tree0d1dff23cf739d81409b302850eea4d890fd16b9 /llvm/lib/CodeGen/AtomicExpandPass.cpp
parent1eaa04d682d684f7e83c263aa40e78ae8faab378 (diff)
downloadbcm5719-llvm-bfdba5e4fc351d3de15d5536a1d4e04a16573ddf.tar.gz
bcm5719-llvm-bfdba5e4fc351d3de15d5536a1d4e04a16573ddf.zip
IR: Add fp operations to atomicrmw
Add just fadd/fsub for now. llvm-svn: 351778
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