[PATCH] D27861: [DAGCombiner] Match load by bytes idiom and fold it into a single load. Attempt #2.
Filipe Cabecinhas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 9 07:20:50 PST 2017
filcab added a comment.
One minor comment.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:4527
+ int64_t MemoryByteOffset =
+ DAG.getDataLayout().isBigEndian()
+ ? BigEndianByteAt(LoadByteWidth, P->ByteOffset)
----------------
RKSimon wrote:
> Loop invariant - pull this out to the top of the function:
> ```
> bool IsBigEndianTarget = DAG.getDataLayout().isBigEndian();
> ```
Might as well pull the `{Little,Big}EndianByteAt` from the loop too.
https://reviews.llvm.org/D27861
More information about the llvm-commits
mailing list