[DAGCombiner] simplifyDivRem - add comment describing divide by undef/zero combine. NFC.

llvm-svn: 339561
This commit is contained in:
Simon Pilgrim 2018-08-13 13:12:25 +00:00
parent 0c23dc59fc
commit 26e3d3f1c8
1 changed files with 5 additions and 0 deletions

View File

@ -3076,6 +3076,11 @@ static SDValue simplifyDivRem(SDNode *N, SelectionDAG &DAG) {
EVT VT = N->getValueType(0);
SDLoc DL(N);
// X / undef -> undef
// X % undef -> undef
// X / 0 -> undef
// X % 0 -> undef
// NOTE: This includes vectors where any divisor element is zero/undef.
if (DAG.isUndef(N->getOpcode(), {N0, N1}))
return DAG.getUNDEF(VT);