This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombine] optimizeSetCCOfSignedTruncationCheck(): handle inverted pattern
ClosedPublic

Authored by lebedev.ri on Aug 31 2018, 2:49 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.Aug 31 2018, 2:49 AM

That is complicated/magical. :)
It would be good to put an example with fixed constants in the code comments where you do the inversion, so we can better grasp how the transform works with real numbers.
x86 diffs look neutral or better. Adding some more potential AArch64 reviewers to confirm the same on those tests.

AArch64 test changes look fine.

test/CodeGen/AArch64/signed-truncation-check.ll
110

We should be able to optimize out the masking here, I think, but I guess that's orthogonal.

Add very basic example of the expected pattern as a comment.

spatel accepted this revision.Sep 1 2018, 4:54 AM

LGTM

This revision is now accepted and ready to land.Sep 1 2018, 4:54 AM

LGTM

Thank you for the review!

This revision was automatically updated to reflect the committed changes.