[PATCH] D26149: [DAGCombiner] Match load by bytes idiom and fold it into a single load

Filipe Cabecinhas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 10:00:57 PST 2016


filcab added a comment.

Thanks, the non-x86 tests look good.

In https://reviews.llvm.org/D26149#609005, @apilipenko wrote:

> We see load by bytes (with optional bswap) patterns in Java code originating from ByteBuffers from the standard library. This is the main motivator for the change. I don't have any numbers for C/C++ code but I expect it's not uncommon.


I'm sure we see it. I'm just curious about how frequently this shows up :-)

> As of matching patterns like rotate, we don't see it the the code we are interested about, so it's more like "this is where this code can evolve in the future".

If there's no actual planned usage of the "bit by bit" feature, I'd much rather have an implementation that tracks full bytes. Even if we wanted to track bit by bit, having byte-tracking will get us most of the way there, since you can only fetch memory byte by byte. If an edge case arised that forced us to track bits, then I'd be ok with it. But as it is, I don't see why we should pay that price.


https://reviews.llvm.org/D26149





More information about the llvm-commits mailing list