[SDAG] fold extract_vector_elt with undef index
authorSanjay Patel <spatel@rotateright.com>
Fri, 25 Oct 2019 23:21:44 +0000 (19:21 -0400)
committerSanjay Patel <spatel@rotateright.com>
Fri, 25 Oct 2019 23:27:26 +0000 (19:27 -0400)
commit4c47617627fbc88fe91195528408178b2dc0e4c9
tree4ec1153752bcfbc96445e1bef58028584db7a8bb
parentf3ad8ae7b73860ea34b7f6a7e86ab0f314ea3ce6
[SDAG] fold extract_vector_elt with undef index

This makes the DAG behavior consistent with IR's extractelement after:
rGb32e4664a715

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

I've tried to maintain test intent for WebAssembly.
The AMDGPU test is trying to test for crashing or other bad behavior,
but I'm not sure if that's possible after this change.
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/AMDGPU/indirect-addressing-si-noopt.ll
llvm/test/CodeGen/WebAssembly/simd.ll
llvm/test/CodeGen/X86/extractelement-index.ll