OSDN Git Service

[SimplifyDemandedVec] Strengthen handling all undef lanes (particularly GEPs)
authorPhilip Reames <listmail@philipreames.com>
Fri, 15 Mar 2019 19:54:06 +0000 (19:54 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 15 Mar 2019 19:54:06 +0000 (19:54 +0000)
commit1c838a422561b91211afdc0fc3ca7976201e157b
tree93457519cdf49345afe344f5facbc008e5a21a25
parente767531b14930999fa85c0d524faaf5969d56a9c
[SimplifyDemandedVec] Strengthen handling all undef lanes (particularly GEPs)

A change of two parts:
1) A generic enhancement for all callers of SDVE to exploit the fact that if all lanes are undef, the result is undef.
2) A GEP specific piece to strengthen/fix the vector index undef element handling, and call into the generic infrastructure when visiting the GEP.

The result is that we replace a vector gep with at least one undef in each lane with a undef.  We can also do the same for vector intrinsics.  Once the masked.load patch (D57372) has landed, I'll update to include call tests as well.

Differential Revision: https://reviews.llvm.org/D57468

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356293 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp
lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
test/Transforms/InstCombine/vec_demanded_elts.ll