OSDN Git Service

InstructionSimplify: Canonicalize shuffle operands. NFC-ish.
authorZvi Rackover <zvi.rackover@intel.com>
Sun, 30 Apr 2017 06:25:04 +0000 (06:25 +0000)
committerZvi Rackover <zvi.rackover@intel.com>
Sun, 30 Apr 2017 06:25:04 +0000 (06:25 +0000)
commitc6bea6e8689ba2394684d6ff66b94d31cb1f7012
tree420539bd68142345589e1762b163de9e548dabd7
parentf24bed9225e3302991cbd146e8af685607e959ab
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, andreadb, davide

Reviewed By: spatel, RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301766 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp