This is an archive of the discontinued LLVM Phabricator instance.

[TypePromotion] Don't promote PHI + ZExt if wider than RegisterBitWidth
ClosedPublic

Authored by avieira on Aug 16 2022, 7:36 AM.

Details

Summary

There was an issue reported against D111237 because for Arm we were promoting a PHI + ZExt chain to i64, causing the existing idiv to require a library routine to perform a 64-bit division. This patch prevents promoting to a width that is wider than the RegisterBitWidth as that is likely to not be beneficial.

Diff Detail

Event Timeline

avieira created this revision.Aug 16 2022, 7:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2022, 7:36 AM
avieira requested review of this revision.Aug 16 2022, 7:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2022, 7:36 AM

Thanks a lot for the quick fix. This resolves all of the issues I noticed in my 32-bit ARM Linux kernel build tests. However, I don't think I am qualified enough to approve this.

samparker accepted this revision.Aug 17 2022, 1:39 AM

cheers

This revision is now accepted and ready to land.Aug 17 2022, 1:39 AM