1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00

[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 2b765f36a3
commit 240a19ccac

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);