[SDAG] fold insert_vector_elt with undef index
authorSanjay Patel <spatel@rotateright.com>
Sun, 27 Oct 2019 19:26:46 +0000 (15:26 -0400)
committerSanjay Patel <spatel@rotateright.com>
Sun, 27 Oct 2019 19:28:43 +0000 (15:28 -0400)
commit85a2146c155953d5bdfb2e7e6ba9780fc2dab1b9
treea99b545fbb9f885d55335602e393a67f694c40df
parentf067dd839eca3103e8afc49c6e0a74d944f25fdd
[SDAG] fold insert_vector_elt with undef index

Similar to:
rG4c47617627fb

This makes the DAG behavior consistent with IR's insertelement.

https://bugs.llvm.org/show_bug.cgi?id=42689

I've tried to maintain test intent for AArch64 and WebAssembly
by replacing undef index operands with something else.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/AArch64/sched-past-vector-ldst.ll
llvm/test/CodeGen/WebAssembly/simd.ll
llvm/test/CodeGen/X86/insertelement-var-index.ll