summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-08-13 13:12:25 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-08-13 13:12:25 +0000
commit26e3d3f1c855bf56420916bbc7cec808eed5c6fe (patch)
tree5d961e091c89baa5bdd1348e297c58e0a84f8519 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent0c23dc59fcf55491063e94b2f474e55112876c8e (diff)
downloadbcm5719-llvm-26e3d3f1c855bf56420916bbc7cec808eed5c6fe.tar.gz
bcm5719-llvm-26e3d3f1c855bf56420916bbc7cec808eed5c6fe.zip
[DAGCombiner] simplifyDivRem - add comment describing divide by undef/zero combine. NFC.
llvm-svn: 339561
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index de3aefadb2b..aaff88ab5ea 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -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);
OpenPOWER on IntegriCloud