[PATCH] D117104: [DAGCombine] Refactor DAGCombiner::ReduceLoadWidth. NFCI

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 15 14:17:28 PST 2022


bjope marked 4 inline comments as done.
bjope added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12271-12272
 
   // For big endian targets, we need to adjust the offset to the pointer to
   // load the correct bytes.
   if (DAG.getDataLayout().isBigEndian())
----------------
spatel wrote:
> spatel wrote:
> > This seems backwards. 
> > It's the little-endian target that needs to adjust the pointer. We're chopping off the LSB, so this is always converting ShAmt back to zero for big-endian?
> > fe17ce0fa6626f79be66
> To be clear, I think the code is correct. I just meant that the comment seems inverted for endian.
I relaxed the description a bit. We could end up adjusting the pointer both for big/little endian here. Such as only loading a single byte from the middle of an i64.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117104/new/

https://reviews.llvm.org/D117104



More information about the llvm-commits mailing list