This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: memSizeNotByteSizePow2 legality helper
ClosedPublic

Authored by arsenm on Apr 11 2022, 8:43 AM.

Details

Summary

This is really a replacement for memSizeInBytesNotPow2 that actually
does what most every target wants. In particular, since s1 rounds to 1
byte, it wasn't lowered by this predicate. This results in targets
needing to think harder and add more matchers to catch all the
degenerate cases.

Also small bug fix that prevented the correct insertion of
G_ASSERT_ZEXT in the AArch64 use case.

Diff Detail

Event Timeline

arsenm created this revision.Apr 11 2022, 8:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2022, 8:43 AM
arsenm requested review of this revision.Apr 11 2022, 8:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2022, 8:43 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm updated this revision to Diff 421983.Apr 11 2022, 11:21 AM

Missed test update

paquette added inline comments.Apr 11 2022, 2:52 PM
llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
569 ↗(On Diff #421983)

wrong patch?

arsenm updated this revision to Diff 422053.Apr 11 2022, 3:31 PM

Correct patch

paquette accepted this revision.Apr 11 2022, 3:40 PM

Also small bug fix that prevented the correct insertion of G_ASSERT_ZEXT in the AArch64 use case.

This looks like it's 32 bit ARM not AArch64?

Anyway this looks reasonable to me.

This revision is now accepted and ready to land.Apr 11 2022, 3:40 PM

Also small bug fix that prevented the correct insertion of G_ASSERT_ZEXT in the AArch64 use case.

This looks like it's 32 bit ARM not AArch64?

No, the fix prevented a regression in the AArch64 case. The opposite improvement was made to the ARM one