summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/YAMLTraits.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-05-03 21:58:44 +0000
committerSanjay Patel <spatel@rotateright.com>2018-05-03 21:58:44 +0000
commite7b665471135e63955bbc102cb5ac457726849e4 (patch)
tree0f52533637946d077e702b54c9096ee1c4a4cd34 /llvm/lib/Support/YAMLTraits.cpp
parentabc9871d6099d154dcab127b3676f015f76accec (diff)
downloadbcm5719-llvm-e7b665471135e63955bbc102cb5ac457726849e4.tar.gz
bcm5719-llvm-e7b665471135e63955bbc102cb5ac457726849e4.zip
[InstCombine] refine select-of-constants to bitwise ops
Add logic for the special case when a cmp+select can clearly be reduced to just a bitwise logic instruction, and remove an over-reaching chunk of general purpose bit magic. The primary goal is to remove cases where we are not improving the IR instruction count when doing these select transforms, and in all cases here that is true. In the motivating 3-way compare tests, there are further improvements because we can combine/propagate select values (not sure if that belongs in instcombine, but it's there for now). DAGCombiner has folds to turn some of these selects into bit magic, so there should be no difference in the end result in those cases. Not all constant combinations are handled there yet, however, so it is possible that some targets will see more cmov/csel codegen with this change in IR canonicalization. Ideally, we'll go further to *not* turn selects into multiple logic/math ops in instcombine, and we'll canonicalize to selects. But we should make sure that this step does not result in regressions first (and if it does, we should fix those in the backend). The general direction for this change was discussed here: http://lists.llvm.org/pipermail/llvm-dev/2016-September/105373.html http://lists.llvm.org/pipermail/llvm-dev/2017-July/114885.html Alive proofs for the new bit magic: https://rise4fun.com/Alive/XG7 Differential Revision: https://reviews.llvm.org/D46086 llvm-svn: 331486
Diffstat (limited to 'llvm/lib/Support/YAMLTraits.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud