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

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 07:16:57 PST 2017


bjope added a comment.

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