This is an archive of the discontinued LLVM Phabricator instance.

Extend known bits to understand @llvm.bswap
ClosedPublic

Authored by reames on Sep 29 2015, 9:03 AM.

Details

Summary

This is a cleaned up patch from the one written by John Regehr based on the findings of the Souper superoptimizer.

When writing tests, I was surprised to find that instsimplify apparently doesn't know how to collapse bit test sequences based purely on known bits. This required me to split my tests across both instsimplify and instcombine.

Diff Detail

Event Timeline

reames updated this revision to Diff 35983.Sep 29 2015, 9:03 AM
reames retitled this revision from to Extend known bits to understand @llvm.bswap.
reames updated this object.
reames added reviewers: majnemer, spatel, hfinkel, regehr.
reames added a subscriber: llvm-commits.
spatel accepted this revision.Sep 30 2015, 10:23 AM
spatel edited edge metadata.
spatel added inline comments.
test/Transforms/InstCombine/bswap-known-bits.ll
3

Interesting...I didn't consider -instsimplify for the similar tests in D13222. I will look again.

Typo: "apparently"

28

Do we need this test? Seems like test4 is a superset.
Use different bswap sizes for more test coverage?

This revision is now accepted and ready to land.Sep 30 2015, 10:23 AM
This revision was automatically updated to reflect the committed changes.