Skip to content

Commit f45b759

Browse files
committed
[DAG] SimplifyDemandedBits - call demanded elts variant directly for SELECT/SELECT_CC nodes.
Don't rebuild the demanded elts mask every time.
1 parent 5b38ecf commit f45b759

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,11 +1645,11 @@ bool TargetLowering::SimplifyDemandedBits(
16451645
break;
16461646
}
16471647
case ISD::SELECT:
1648-
if (SimplifyDemandedBits(Op.getOperand(2), DemandedBits, Known, TLO,
1649-
Depth + 1))
1648+
if (SimplifyDemandedBits(Op.getOperand(2), DemandedBits, DemandedElts,
1649+
Known, TLO, Depth + 1))
16501650
return true;
1651-
if (SimplifyDemandedBits(Op.getOperand(1), DemandedBits, Known2, TLO,
1652-
Depth + 1))
1651+
if (SimplifyDemandedBits(Op.getOperand(1), DemandedBits, DemandedElts,
1652+
Known2, TLO, Depth + 1))
16531653
return true;
16541654
assert(!Known.hasConflict() && "Bits known to be one AND zero?");
16551655
assert(!Known2.hasConflict() && "Bits known to be one AND zero?");
@@ -1675,11 +1675,11 @@ bool TargetLowering::SimplifyDemandedBits(
16751675
Known = Known.intersectWith(Known2);
16761676
break;
16771677
case ISD::SELECT_CC:
1678-
if (SimplifyDemandedBits(Op.getOperand(3), DemandedBits, Known, TLO,
1679-
Depth + 1))
1678+
if (SimplifyDemandedBits(Op.getOperand(3), DemandedBits, DemandedElts,
1679+
Known, TLO, Depth + 1))
16801680
return true;
1681-
if (SimplifyDemandedBits(Op.getOperand(2), DemandedBits, Known2, TLO,
1682-
Depth + 1))
1681+
if (SimplifyDemandedBits(Op.getOperand(2), DemandedBits, DemandedElts,
1682+
Known2, TLO, Depth + 1))
16831683
return true;
16841684
assert(!Known.hasConflict() && "Bits known to be one AND zero?");
16851685
assert(!Known2.hasConflict() && "Bits known to be one AND zero?");

0 commit comments

Comments
 (0)