This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Teach SimplifyDemandedUseBits to shrink Constants on the left side of subtracts
ClosedPublic

Authored by craig.topper on Mar 19 2017, 12:07 AM.

Details

Summary

Subtracts can have constants on the left side, but we don't shrink them based on demanded bits. This patch fixes that to match the right hand side.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Mar 19 2017, 12:07 AM
spatel accepted this revision.Mar 21 2017, 4:23 PM

http://rise4fun.com/Alive/nI0
I had to use Alive to convince myself those tests are right. :)
LGTM.

This revision is now accepted and ready to land.Mar 21 2017, 4:23 PM
This revision was automatically updated to reflect the committed changes.