InstCombine is able to transform mem transfer instrinsic to alone store or store/load pair.
It might result in generation of unaligned atomic load/store which later in backend
will be transformed to libcall. It is not an evident gain and it is better to keep intrinsic as is
and handle it at backend.
Details
Diff Detail
Event Timeline
Code looks reasonable, but please see comment on testing strategy.
test/Transforms/InstCombine/element-atomic-memintrins.ll | ||
---|---|---|
15 | I think these changes break the spirit of the tests. I'd recommend just providing the required alignment information on the dest argument. And then add a separate test for the unaligned case. |
Philip, I'm not sure that I completely follow your comment about spirit of the tests but I've added a coverage for size/alignment.
I hope it will be enough.
LGTM
test/Transforms/InstCombine/element-atomic-memintrins.ll | ||
---|---|---|
15 | I was suggesting that you add an align(8) to the %dest argument. This would preserve the transform for the existing tests, and you could add a new test showing the inhibited transform w/o the alignment. Reviewing your tests, I think you do have the coverage, just not quite the way I was suggesting. So, consider this an optional comment. |
I think these changes break the spirit of the tests. I'd recommend just providing the required alignment information on the dest argument. And then add a separate test for the unaligned case.