OSDN Git Service

[instsimplify] consistently handle undef and out of bound indices for insertelement...
authorPhilip Reames <listmail@philipreames.com>
Sat, 30 Dec 2017 05:54:22 +0000 (05:54 +0000)
committerPhilip Reames <listmail@philipreames.com>
Sat, 30 Dec 2017 05:54:22 +0000 (05:54 +0000)
commit186bdd656a11d500fcd3b89b691156388370767b
treeb6b6ab2566ef493aac3b1b053143dd6fe8937b07
parente66588b3174ab8b5a010b58e046c36b3f3a5abdc
[instsimplify] consistently handle undef and out of bound indices for insertelement and extractelement

In one case, we were handling out of bounds, but not undef indices.  In the other, we were handling undef (with the comment making the analogy to out of bounds), but not out of bounds.  Be consistent and treat both undef and constant out of bounds indices as producing undefined results.

As a side effect, this also protects instcombine from having to handle large constant indices as we always simplify first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321575 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstCombine/extractelement.ll
test/Transforms/InstCombine/vec_demanded_elts.ll
test/Transforms/InstCombine/vector_insertelt_shuffle.ll
test/Transforms/InstSimplify/extract-element.ll
test/Transforms/InstSimplify/insertelement.ll