This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] fix G_ADD*/G_SUB* legalization
ClosedPublic

Authored by tmatheson on Aug 24 2022, 3:33 AM.

Details

Summary

widenScalarDst updates the insert point to after MI, so
widenScalarSrc must be called before widenScalarDst. Otherwise
The updated Src values will appear after MI and break SSA. e.g.:

%14:_(s64), %15:_(s1) = G_UADDE %9:_, %11:_, %13:_

becomes

%14:_(s64), %16:_(s32) = G_UADDE %9:_, %11:_, %17:_
%15:_(s1) = G_TRUNC %16:_(s32)
%17:_(s32) = G_ZEXT %13:_(s1)

Diff Detail

Event Timeline

tmatheson created this revision.Aug 24 2022, 3:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 3:33 AM
tmatheson requested review of this revision.Aug 24 2022, 3:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 3:33 AM
lenary accepted this revision.Aug 25 2022, 5:30 AM
This revision is now accepted and ready to land.Aug 25 2022, 5:30 AM
tmatheson edited the summary of this revision. (Show Details)Aug 25 2022, 8:22 AM
This revision was landed with ongoing or failed builds.Aug 30 2022, 3:00 AM
This revision was automatically updated to reflect the committed changes.