OSDN Git Service

InstructionSimplify: Relanding r301766
authorZvi Rackover <zvi.rackover@intel.com>
Sun, 7 May 2017 18:16:37 +0000 (18:16 +0000)
committerZvi Rackover <zvi.rackover@intel.com>
Sun, 7 May 2017 18:16:37 +0000 (18:16 +0000)
commit88c686221fd2c05b69b067f877c5755c90258ee0
tree75ad2381b4fbe9143fa3c9b1ffe9180ffe735c3f
parente3f371483fa79148cc9c593971feaaa0aeff939f
InstructionSimplify: Relanding r301766

Summary:
Re-applying r301766 with a fix to a typo and a regression test.

The log message for r301766 was:
==================================================================================
    InstructionSimplify: Canonicalize shuffle operands. NFC-ish.

    Summary:
     Apply canonicalization rules:
        1. Input vectors with no elements selected from can be replaced with undef.
        2. If only one input vector is constant it shall be the second one.

    This allows constant-folding to cover more ad-hoc simplifications that
    were in place and avoid duplication for RHS and LHS checks.

    There are more rules we may want to add in the future when we see a
    justification. e.g. mask elements that select undef elements can be
    replaced with undef.
==================================================================================

Reviewers: spatel, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302373 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/shufflevector.ll