Skip to content

Commit 1216e70

Browse files
committed
[DAG] getNode - add value type assertions for AVG nodes.
1 parent 35f9e5f commit 1216e70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6952,6 +6952,14 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
69526952
return getNode(ISD::AND, DL, VT, N1, getNOT(DL, N2, VT));
69536953
}
69546954
break;
6955+
case ISD::AVGFLOORS:
6956+
case ISD::AVGFLOORU:
6957+
case ISD::AVGCEILS:
6958+
case ISD::AVGCEILU:
6959+
assert(VT.isInteger() && "This operator does not apply to FP types!");
6960+
assert(N1.getValueType() == N2.getValueType() &&
6961+
N1.getValueType() == VT && "Binary operator types must match!");
6962+
break;
69556963
case ISD::ABDS:
69566964
case ISD::ABDU:
69576965
assert(VT.isInteger() && "This operator does not apply to FP types!");

0 commit comments

Comments
 (0)