[PATCH] D39289: [SelectionDAG] Support 'bit preserving' floating points bitcasts on computeKnownBits/ComputeNumSignBits

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 03:45:16 PDT 2017


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2233
+    if (!(SubVT.isInteger() ||
+          (SubVT.isFloatingPoint() && TLI->hasBitPreservingFPLogic(SubVT))))
       break;
----------------
efriedma wrote:
> Not sure why you're checking hasBitPreservingFPLogic; from its documentation, it specifically applies to the behavior of FABS/FNEG.  BITCAST should always preserve all bits.
@spatel might be able to give more details but I understood that hasBitPreservingFPLogic's scope was to cover all bit operations on floating point data? The FABS/FNEG are just explicitly mentioned as they're the typical uses of signbit masking/XORing.

I'm happy to simplify this if you think it safe.


Repository:
  rL LLVM

https://reviews.llvm.org/D39289





More information about the llvm-commits mailing list