[PATCH] D40444: [DAGCombine] Handle big endian correctly in CombineConsecutiveLoads

Nirav Dave via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 08:30:43 PST 2017


niravd added a comment.

I've done a double check myself for all in-tree uses and all the uses of areNonVolatileConsecutiveLoads should be fine as well.

So modulo a test case this LGTM.

In https://reviews.llvm.org/D40444#935851, @bjope wrote:

> In https://reviews.llvm.org/D40444#935387, @niravd wrote:
>
> > This endianness problem is probably also latent where do load combination, but we should sink this check into areNonVolatileConsecutiveLoads and MatchLoadCombine.
>
>
> I've looked at MatchLoadCombine and it looks like it is trying to support both little and big endian. As well as combining the loads and doing a bswap if the ordering in memory does not match how the bytes are ordered after OR:ing the pieces together.
>
> And areNonVolatileConsecutiveLoads is working just as it is described. It checks if one load is "Bytes * Dist" bytes after another load. I think it depends on the use case how to use the result of areNonVolatileConsecutiveLoads, and making it aware of endianess only mess up such a low level function.





https://reviews.llvm.org/D40444





More information about the llvm-commits mailing list