OSDN Git Service

[InstSimplify] teach SimplifySelectInst() to fold more vector selects
authorHaicheng Wu <haicheng@codeaurora.org>
Mon, 2 Oct 2017 23:43:52 +0000 (23:43 +0000)
committerHaicheng Wu <haicheng@codeaurora.org>
Mon, 2 Oct 2017 23:43:52 +0000 (23:43 +0000)
commitf7bb6862c7de232d24c399930ef921ecfe685824
treeac4e9563f9c155e2042287a53ca320bd10b1bdad
parent0e47622a91ad77b20fb86147bf23576897050ef3
[InstSimplify] teach SimplifySelectInst() to fold more vector selects

Call ConstantFoldSelectInstruction() to fold cases like below

select <2 x i1><i1 true, i1 false>, <2 x i8> <i8 0, i8 1>, <2 x i8> <i8 2, i8 3>

All operands are constants and the condition has mixed true and false conditions.

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

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