GlobalISel: Add memSizeNotByteSizePow2 legality helper
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sun, 10 Apr 2022 23:50:47 +0000 (19:50 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 11 Apr 2022 23:43:37 +0000 (19:43 -0400)
commitd1f97a341958bb658e03bd8a01e9f19a9924d114
treebe6a966c97ee2796d85c59649087e12eb425ac6b
parent1416744f8405db03096bc240a8ec9de176a71569
GlobalISel: Add memSizeNotByteSizePow2 legality helper

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.
llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
llvm/test/CodeGen/ARM/GlobalISel/arm-legalize-load-store.mir