[PATCH] D22933: DAG: avoid truncating a sign extended operand when test equality against zero

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 12:11:50 PDT 2016


eli.friedman added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:956
@@ -955,3 +955,3 @@
         OpR->getOpcode() == ISD::AssertSext &&
         cast<VTSDNode>(OpR->getOperand(1))->getVT() == NewRHS.getValueType()) {
       NewLHS = OpL;
----------------
weimingz wrote:
> eli.friedman wrote:
> > This check is now unnecessary.
> Yes. I was thinking the same. But my concern is  computeNumSignBits only gives its best knowledge by looking into no more than 6 steps. Will it miss some cases?
It definitely won't miss this case, which doesn't require any recursion at all.  When  computeNumSignBits hits the recursion limit, it doesn't completely abandon the computation; it just treats the SDValue at the recursion limit as an opaque value.


Repository:
  rL LLVM

https://reviews.llvm.org/D22933





More information about the llvm-commits mailing list