[PATCH] Add Load Combine Pass
atrick at apple.com
Wed May 7 11:04:19 PDT 2014
On May 7, 2014, at 9:21 AM, Hal Finkel <hfinkel at anl.gov> wrote:
> Two things:
> 1. In the regression test, the CHECK line should check the alignment of the generated load.
Right, good catch.
> 2. I had proposed that we only perform the transformation at all when TLI->allowsUnalignedMemoryAccesses returns true and sets *fast to true. When this function returns false, then SDAG will split the load (so Andy's experiment is possible). Also, I agree with Andy that if benchmark data shows the code quality from combining+SDAG-splitting to be better than that from doing nothing, then by all means do the former. Without benchmark data (from multiple platforms, preferably), showing that to be the case, I'd prefer the conservative approach I detailed.
Yes, the case I was concerned with is when unaligned access is supported but penalized. As long as we can conservatively disable the combining, I’m not concerned. The pass is still worthwhile because mainstream targets have fast unaligned loads. I’m slightly concerned that the target hook is incomplete. Unaligned loads may be fast, but unaligned stores may have a penalty. Since this patch only combines loads, it should happen to give the right answer.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits