This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Emit G_ASSERT_ZEXT in assignValueToAddress for ZExt params
ClosedPublic

Authored by paquette on Feb 1 2021, 11:09 AM.

Details

Summary

When we have a zeroext parameter coming in on the stack, build

%x = G_LOAD ...
%x_assert_zext = G_ASSERT_ZEXT %x, narrow_size
%trunc = G_TRUNC %x_assert_zext

Rather than just loading into the truncated type.

This allows us to optimize cases like this: https://godbolt.org/z/vfjhW8

Diff Detail

Event Timeline

paquette created this revision.Feb 1 2021, 11:09 AM
paquette requested review of this revision.Feb 1 2021, 11:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2021, 11:09 AM
aemerson accepted this revision.Feb 3 2021, 3:52 PM
This revision is now accepted and ready to land.Feb 3 2021, 3:52 PM