OSDN Git Service

[SelectionDAG] Tidyup UDIV computeKnownBits implementation
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 28 Oct 2016 13:42:23 +0000 (13:42 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 28 Oct 2016 13:42:23 +0000 (13:42 +0000)
No need to clear KnownOne2/KnownZero2 bits as the next call to computeKnownBits will overwrite them anyway

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285398 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index f741c4b..e6b8d2f 100644 (file)
@@ -2102,8 +2102,6 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero,
     computeKnownBits(Op.getOperand(0), KnownZero2, KnownOne2, Depth+1);
     unsigned LeadZ = KnownZero2.countLeadingOnes();
 
-    KnownOne2.clearAllBits();
-    KnownZero2.clearAllBits();
     computeKnownBits(Op.getOperand(1), KnownZero2, KnownOne2, Depth+1);
     unsigned RHSUnknownLeadingOnes = KnownOne2.countLeadingZeros();
     if (RHSUnknownLeadingOnes != BitWidth)