summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineFunctionPass.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2014-03-17 19:57:04 +0000
committerDan Gohman <dan433584@gmail.com>2014-03-17 19:57:04 +0000
commit172c5d34515b3dd8b731ae144bea4c0cddb0890f (patch)
treef7906277032e26efb8e72e8246fdbd83e68669f0 /llvm/lib/CodeGen/MachineFunctionPass.cpp
parentb36376efcb0f75963a0236447cc7dffba14f5ada (diff)
downloadbcm5719-llvm-172c5d34515b3dd8b731ae144bea4c0cddb0890f.tar.gz
bcm5719-llvm-172c5d34515b3dd8b731ae144bea4c0cddb0890f.zip
Use range metadata instead of introducing selects.
When GlobalOpt has determined that a GlobalVariable only ever has two values, it would convert the GlobalVariable to a boolean, and introduce SelectInsts at every load, to choose between the two possible values. These SelectInsts introduce overhead and other unpleasantness. This patch makes GlobalOpt just add range metadata to loads from such GlobalVariables instead. This enables the same main optimization (as seen in test/Transforms/GlobalOpt/integer-bool.ll), without introducing selects. The main downside is that it doesn't get the memory savings of shrinking such GlobalVariables, but this is expected to be negligible. llvm-svn: 204076
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunctionPass.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud