[PATCH] D44249: [SelectionDAG] Handle big-endian target BITCAST in computeKnownBits()

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 12:27:54 PDT 2018


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2381
       for (unsigned i = 0; i != SubScale; ++i) {
         computeKnownBits(N0, Known2, SubDemandedElts.shl(i),
                          Depth + 1);
----------------
jonpa wrote:
> RKSimon wrote:
> > Will this be correct? Does it need to be reversed for BE?
> > ```
> > SubDemandedElts.shl(ISLE ? i : (SubScale - 1 - i))
> > ```
> PING!
> 
> (Personally I think this is correct - it seems to me to otherwise simply again disregard endianness. First the input is analyzed, then the bitcast is performed in the same way as if writing to memory and then loading back. Only in this second step should any reversal take place, or?)
> 
> 
It doesn't matter what order you analyze the sub-elements, as long as you map them correctly to the original element.


https://reviews.llvm.org/D44249





More information about the llvm-commits mailing list