[PATCH] D80683: [SelectionDAG] Fix up SimplifyDemandedBits for ppcf128

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 04:18:32 PDT 2020


nemanjai added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:852
+  if (VT == MVT::ppcf128 && TLO.DAG.getDataLayout().isLittleEndian())
+    DemandedBits = DemandedBits.rotl(64);
+
----------------
RKSimon wrote:
> Won't this rotate the bits every time you recursively call the function? You might need to limit this to Depth == 0 and then handle/bailout in the ISD::BITCAST case below.
Ah, this is a very good point. I think it would be very difficult to construct a test case where we traverse multiple nodes that produce a `ppcf128` value, but it should be possible in principle. Limiting it to `Depth == 0` would not achieve the desired result since we are likely entering the recursion from a different node (similarly to how we do so in the attached test case).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80683





More information about the llvm-commits mailing list