[PATCH] D40613: [LoopIdiom] Recognize unordered atomic memset

Daniel Neilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 07:40:42 PST 2017


dneilson added inline comments.


================
Comment at: lib/IR/IRBuilder.cpp:106
 
+CallInst *IRBuilderBase::CreateElementUnorderedAtomicMemSet(
+    Value *Ptr, unsigned PtrAlign, Value *Val, Value *Size,
----------------
anna wrote:
> Given there's some constraints for unordered memset, does it make sense to add the constraints as asserts here (ptrAlign relation to `ElementSize`)?
> 
> Any other constraints?
Easy enough. Good point.


================
Comment at: test/Transforms/LoopIdiom/unordered-atomic-memset-noarch.ll:5
+;; memset.atomic formation (atomic store) -- element size 2
+;;  Will not create call due to a max element size of 0
+define void @test1(i64 %Size) nounwind ssp {
----------------
anna wrote:
> where's this max element size of 0?
I should clarify this better in the test comment... This is a noarch test, so a call to TTI->getAtomicMemIntrinsicMaxElementSize() will return 0, thus preventing the transform.


https://reviews.llvm.org/D40613





More information about the llvm-commits mailing list