Skip to content

Commit fd67e95

Browse files
committed
[DAG] Remove non-canonical AVG case.
This removes a condition in the detection of AVG nodes, where we needn't be checking the LHS of an add node as any const will be canonicalized to the RHS.
1 parent b76f40c commit fd67e95

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -947,13 +947,6 @@ static SDValue combineShiftToAVG(SDValue Op, SelectionDAG &DAG,
947947
SDValue Add2;
948948
auto MatchOperands = [&](SDValue Op1, SDValue Op2, SDValue Op3, SDValue A) {
949949
ConstantSDNode *ConstOp;
950-
if ((ConstOp = isConstOrConstSplat(Op1, DemandedElts)) &&
951-
ConstOp->isOne()) {
952-
ExtOpA = Op2;
953-
ExtOpB = Op3;
954-
Add2 = A;
955-
return true;
956-
}
957950
if ((ConstOp = isConstOrConstSplat(Op2, DemandedElts)) &&
958951
ConstOp->isOne()) {
959952
ExtOpA = Op1;

0 commit comments

Comments
 (0)