summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-05-21 18:53:53 +0000
committerSanjay Patel <spatel@rotateright.com>2019-05-21 18:53:53 +0000
commit10f6b3989959978e41c2092251a4359fef30d99f (patch)
tree429046d5f78c1c9193c67818713bf9f8afcfd551 /llvm
parent76e5a1d3c3b107646d88cf91059972c2a2a5f163 (diff)
downloadbcm5719-llvm-10f6b3989959978e41c2092251a4359fef30d99f.tar.gz
bcm5719-llvm-10f6b3989959978e41c2092251a4359fef30d99f.zip
[SelectionDAG] fold insert subvector of undef into undef
DAGCombiner simplifies this more liberally as: // If inserting an UNDEF, just return the original vector. if (N1.isUndef()) return N0; So there's no way to make this visible in output AFAIK, but doing this at node creation time should be slightly more efficient. llvm-svn: 361287
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 0758a31ec99..366b404b304 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5367,6 +5367,9 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
break;
}
case ISD::INSERT_SUBVECTOR: {
+ // Inserting undef into undef is still undef.
+ if (N1.isUndef() && N2.isUndef())
+ return getUNDEF(VT);
SDValue Index = N3;
if (VT.isSimple() && N1.getValueType().isSimple()
&& N2.getValueType().isSimple()) {
OpenPOWER on IntegriCloud