summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-11-19 17:06:05 +0000
committerSanjay Patel <spatel@rotateright.com>2018-11-19 17:06:05 +0000
commitb25adf5edba0bfb487828600f4294702e695fdba (patch)
tree188a8c0e05583ccb9346be2ff843f8b97134629e /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent22a04efcb0cfac222abfaec381406eff7e157ec6 (diff)
downloadbcm5719-llvm-b25adf5edba0bfb487828600f4294702e695fdba.tar.gz
bcm5719-llvm-b25adf5edba0bfb487828600f4294702e695fdba.zip
[SelectionDAG] simplify vector select with undef operand(s)
llvm-svn: 347227
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 31589fe586b..5510d9a9dab 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -7816,9 +7816,8 @@ SDValue DAGCombiner::visitVSELECT(SDNode *N) {
SDValue N2 = N->getOperand(2);
SDLoc DL(N);
- // fold (vselect C, X, X) -> X
- if (N1 == N2)
- return N1;
+ if (SDValue V = DAG.simplifySelect(N0, N1, N2))
+ return V;
// Canonicalize integer abs.
// vselect (setg[te] X, 0), X, -X ->
OpenPOWER on IntegriCloud