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

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 07:06:04 PST 2017


anna added inline comments.


================
Comment at: lib/IR/IRBuilder.cpp:106
 
+CallInst *IRBuilderBase::CreateElementUnorderedAtomicMemSet(
+    Value *Ptr, unsigned PtrAlign, Value *Val, Value *Size,
----------------
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?


================
Comment at: lib/Transforms/Scalar/LoopIdiomRecognize.cpp:944
+    }
+    else
+      NewCall =
----------------
Stylistic comment: Could you switch around the if else so that smaller body is first?


================
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 {
----------------
where's this max element size of 0?


https://reviews.llvm.org/D40613





More information about the llvm-commits mailing list