OSDN Git Service

[InstCombine] narrow select to match condition operands' size
authorSanjay Patel <spatel@rotateright.com>
Thu, 31 May 2018 19:55:27 +0000 (19:55 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 31 May 2018 19:55:27 +0000 (19:55 +0000)
commit4495104b59ac851c15cbd9790de5ad30a0e79756
tree3cf5fb8b6c00e74aa2e9b11c5c47d985dffde568
parent93b037daa0a188aeb6718d8a84150eda440e8816
[InstCombine] narrow select to match condition operands' size

This is the planned enhancement to D47163 / rL333611.
We want to match cmp/select sizes because that will be recognized
as min/max more easily and lead to better codegen (especially for
vector types).

As mentioned in D47163, this improves some of the tests that would
also be folded by D46380, so we may want to adjust that patch to
match the new patterns where the extend op occurs after the select.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333689 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/minmax-fold.ll
test/Transforms/InstCombine/select-bitext-bitwise-ops.ll
test/Transforms/InstCombine/select-obo-peo-ops.ll