OSDN Git Service

[InstCombine] canonicalize non-obivous forms of integer min/max
authorSanjay Patel <spatel@rotateright.com>
Tue, 21 Feb 2017 19:33:53 +0000 (19:33 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 21 Feb 2017 19:33:53 +0000 (19:33 +0000)
commit2d562fe758bfc6e94c4d794bf5cbf4775854d958
tree5a7ddacdee89d6e87767ccc3c139244281eacaf3
parent8a7ccd71293dc517a37dfc20b8ad60e16c5a3cef
[InstCombine] canonicalize non-obivous forms of integer min/max

This is part of trying to clean up our handling of min/max patterns in IR.
By converting these to canonical form, we're more likely to recognize them
because there are various places in InstCombine that don't use
matchSelectPattern or m_SMax and friends.

The backend fixups referenced in the now deleted TODO comment were added with:
https://reviews.llvm.org/rL291392
https://reviews.llvm.org/rL289738

If there's any codegen fallout from this change, we should be able to address
it in DAGCombiner or target-specific lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295758 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/select.ll
test/Transforms/InstCombine/select_meta.ll