This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] don't try SimplifyDemandedInstructionBits from zext/sext because it's slow and unnecessary
ClosedPublic

Authored by spatel on Feb 22 2017, 4:17 PM.

Details

Summary

Since D30270 was approved, let's try again. :)

This one seems more obvious to me that it can't make improvements because an extension always needs all of the incoming bits. There's one specific transform of converting a sext to a zext when the sign-bit is known zero in SimplifyDemandedInstructionBits, but that is handled explicitly in visitSext() with ComputeSignBit() (just below that deleted hunk).

Again, there are no IR differences (other than instruction names) for the case in PR32037:
https://bugs.llvm.org//show_bug.cgi?id=32037
...and no regression test differences.

Zext/sext are a smaller part of the profile, but this still appears to shave off another 0.5% or so from 'opt -O2'. I didn't try very hard to accurately measure the difference because I think this is a pure win amputation of redundant calls to SimplifyDemandedInstructionBits.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel created this revision.Feb 22 2017, 4:17 PM
efriedma accepted this revision.Feb 23 2017, 2:43 PM

LGTM.

This revision is now accepted and ready to land.Feb 23 2017, 2:43 PM
This revision was automatically updated to reflect the committed changes.