This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Clear promoted bits before UREM on shift amount in PromoteIntRes_FunnelShift.
ClosedPublic

Authored by craig.topper on May 6 2022, 12:12 AM.

Details

Summary

Otherwise we have garbage in the upper bits that can affect the
results of the UREM.

Fixes PR55296.

Diff Detail

Event Timeline

craig.topper created this revision.May 6 2022, 12:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 12:12 AM
craig.topper requested review of this revision.May 6 2022, 12:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 12:12 AM
RKSimon accepted this revision.May 6 2022, 1:06 AM

LGTM (although the title should say PromoteIntRes_FunnelShift?)

This revision is now accepted and ready to land.May 6 2022, 1:06 AM
craig.topper retitled this revision from [SelectionDAG] Clear promoted bits before UREM on shift amount in PromoteIntRes_Rotate. to [SelectionDAG] Clear promoted bits before UREM on shift amount in PromoteIntRes_FunnelShift..May 6 2022, 8:57 AM
craig.topper added inline comments.May 6 2022, 9:00 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1280

Like other shifts/rotates, the shift amount for funnel shifts isn't required to match the data type is it? Should this be checking that the argument needs to be promoted first?

RKSimon added inline comments.May 6 2022, 9:18 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1280

Yes, the shift amount type works the same way as basic shifts/rotations

This revision was landed with ongoing or failed builds.May 6 2022, 9:26 AM
This revision was automatically updated to reflect the committed changes.