This expands the loop idiom recognition pass to recognize the unordered
atomic memset pattern. This pattern is the same pattern as a regular memset
except that the stores are unordered atomic, and limited to register size.
Details
- Reviewers
anna skatkov apilipenko
Diff Detail
- Build Status
Buildable 12595 Build 12595: arc lint + arc unit
Event Timeline
lib/IR/IRBuilder.cpp | ||
---|---|---|
106 | 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? | |
lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
944 | Stylistic comment: Could you switch around the if else so that smaller body is first? | |
test/Transforms/LoopIdiom/unordered-atomic-memset-noarch.ll | ||
5 | where's this max element size of 0? |
lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
---|---|---|
947 | Why do we not check that the "ordinary memset" was substituting a store? This is the behaviour before your change as well (we dont check for store), but somehow it struck me as weird. |
lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
---|---|---|
947 | processLoopStridedStore() kind of has two modes of operation.
I made the atomic case explicitly check for a store instruction here because the "loop of atomic memsets" hasn't been implemented yet. |
LGTM
lib/Transforms/Scalar/LoopIdiomRecognize.cpp | ||
---|---|---|
947 | makes sense. thanks for the clarification. |
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?