[PATCH] D60679: [LowerAtomic] Lower fadd and fsub atomicrmw instructions
Josh Berdine via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 15 03:03:09 PDT 2019
jberdine created this revision.
Herald added subscribers: llvm-commits, jfb.
Herald added a project: LLVM.
FAdd and FSub have recently (r351850) been added as atomicrmw
operations. This diff adds lowering cases for them to the LowerAtomic
transform.
Repository:
rL LLVM
https://reviews.llvm.org/D60679
Files:
lib/Transforms/Scalar/LowerAtomic.cpp
Index: lib/Transforms/Scalar/LowerAtomic.cpp
===================================================================
--- lib/Transforms/Scalar/LowerAtomic.cpp
+++ lib/Transforms/Scalar/LowerAtomic.cpp
@@ -86,6 +86,12 @@
Res = Builder.CreateSelect(Builder.CreateICmpULT(Orig, Val),
Orig, Val);
break;
+ case AtomicRMWInst::FAdd:
+ Res = Builder.CreateFAdd(Orig, Val);
+ break;
+ case AtomicRMWInst::FSub:
+ Res = Builder.CreateFSub(Orig, Val);
+ break;
}
Builder.CreateStore(Res, Ptr);
RMWI->replaceAllUsesWith(Orig);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60679.195115.patch
Type: text/x-patch
Size: 578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190415/79f56469/attachment.bin>
More information about the llvm-commits
mailing list