This is an archive of the discontinued LLVM Phabricator instance.

[InstSimplify] peek through unsigned FP casts for sign-bit compares (PR36682)
ClosedPublic

Authored by lebedev.ri on Mar 13 2018, 7:06 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

lebedev.ri created this revision.Mar 13 2018, 7:06 AM
lebedev.ri retitled this revision from [InstCombine] peek through unsigned FP casts for sign-bit compares (PR36682) to [InstSimplify] peek through unsigned FP casts for sign-bit compares (PR36682).

Rebased ontop of updated tests, moved to InstSimplify.
FIXME: should that code be in some other place, in some other function?

Rebased to fix test conflicts, NFC.

Rebased ontop of updated tests, moved to InstSimplify.
FIXME: should that code be in some other place, in some other function?

simplifyICmpWithConstant()? I think you'd have to put it above the m_APInt() check in that function in order to still get some of the vector tests with undef elements though.

test/Transforms/InstSimplify/cast-unsigned-icmp-cmp-0.ll
4 ↗(On Diff #138415)

Please remove the datalayout comment.

8 ↗(On Diff #138415)

Remove the 'FIXME' part of this.

12 ↗(On Diff #138415)

This should be "m_Zero does not handle undef elements in vectors."

lebedev.ri marked 3 inline comments as done.

simplifyICmpWithConstant()? I think you'd have to put it above the m_APInt() check in that function in order to still get some of the vector tests with undef elements though.

Yep, thanks, looks less out-of-place there!

The GetCompareTy(RHS) change will be a preparatory NFC commit before the main commit.

spatel accepted this revision.Mar 15 2018, 6:01 AM

LGTM.

This revision is now accepted and ready to land.Mar 15 2018, 6:01 AM