Page MenuHomePhabricator

[InstCombine] Remove one use restriction on the shift for calls to foldICmpAndShift.
ClosedPublic

Authored by craig.topper on Sep 22 2017, 4:15 PM.

Details

Summary

If this transformation succeeds, we're going to remove our dependency on the shift by rewriting the and. So it doesn't matter how many uses the shift has.

This distributes the one use check to other transforms in foldICmpAndConstConst that do need it.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Sep 22 2017, 4:15 PM
craig.topper edited the summary of this revision. (Show Details)Sep 22 2017, 4:16 PM
craig.topper added reviewers: spatel, davide.
craig.topper added a subscriber: llvm-commits.
spatel added inline comments.Sep 25 2017, 1:29 PM
lib/Transforms/InstCombine/InstCombineCompares.cpp
1717–1718 ↗(On Diff #116431)

We're also easing the restriction on this fold, right? Add another test for it too?

spatel accepted this revision.Sep 26 2017, 9:17 AM

LGTM. The transform that I asked about no longer exists after rL314153, so that question is decoupled from this patch. Still might be worth adding a test if one doesn't exist already.

This revision is now accepted and ready to land.Sep 26 2017, 9:17 AM
This revision was automatically updated to reflect the committed changes.