InstSimplify: Add a hook for shufflevector
authorZvi Rackover <zvi.rackover@intel.com>
Mon, 3 Apr 2017 22:05:30 +0000 (22:05 +0000)
committerZvi Rackover <zvi.rackover@intel.com>
Mon, 3 Apr 2017 22:05:30 +0000 (22:05 +0000)
commit8f460655a26fb564a15cb927382fed4b69f41c67
treeea2ddf6dc6bede61d1c3b7e75d53749dbaae87bc
parent74a7fa059484465536cb4f5040da056ae4d9699b
InstSimplify: Add a hook for shufflevector

Summary:
Add a hook for simplification of shufflevector's with the following rules:
- Constant folding - NFC, as it was already being done by the default handler.
-  If only one of the operands is constant, constant fold the shuffle if the
    mask does not select elements from the variable operand -  to show the hook is firing and affecting the test-cases.

Reviewers: RKSimon, craig.topper, spatel, sanjoy, nlopes, majnemer

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 299393
llvm/include/llvm/Analysis/ConstantFolding.h
llvm/include/llvm/Analysis/InstructionSimplify.h
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/shufflevector.ll