summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Statistic.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-06 07:52:12 +0000
committerChris Lattner <sabre@nondot.org>2006-01-06 07:52:12 +0000
commiteb372a02761a7bb00739e6852888d4584ff0e9a2 (patch)
tree80c799e6cd809e293744061e6c2494865c9eda5f /llvm/lib/Support/Statistic.cpp
parent60d3002606ecc98c0408d1621e085a6dafdbe5bc (diff)
downloadbcm5719-llvm-eb372a02761a7bb00739e6852888d4584ff0e9a2.tar.gz
bcm5719-llvm-eb372a02761a7bb00739e6852888d4584ff0e9a2.zip
Enhance the shift-shift folding code to allow a no-op cast to occur in between
the shifts. This allows us to fold this (which is the 'integer add a constant' sequence from cozmic's scheme compmiler): int %x(uint %anf-temporary776) { %anf-temporary777 = shr uint %anf-temporary776, ubyte 1 %anf-temporary800 = cast uint %anf-temporary777 to int %anf-temporary804 = shl int %anf-temporary800, ubyte 1 %anf-temporary805 = add int %anf-temporary804, -2 %anf-temporary806 = or int %anf-temporary805, 1 ret int %anf-temporary806 } into this: int %x(uint %anf-temporary776) { %anf-temporary776 = cast uint %anf-temporary776 to int %anf-temporary776.mask1 = add int %anf-temporary776, -2 %anf-temporary805 = or int %anf-temporary776.mask1, 1 ret int %anf-temporary805 } note that instcombine already knew how to eliminate the AND that the two shifts fold into. This is tested by InstCombine/shift.ll:test26 -Chris llvm-svn: 25128
Diffstat (limited to 'llvm/lib/Support/Statistic.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud