This is an archive of the discontinued LLVM Phabricator instance.

[InstrInfo] Use 64-bit immediates for analyzeCompare() (NFCI)
ClosedPublic

Authored by nikic on Aug 28 2021, 12:52 PM.

Details

Summary

The backend generally uses 64-bit immediates (e.g. what MachineOperand::getImm() returns), so use that for analyzeCompare() and optimizeCompareInst() as well. This avoids truncation for targets that support immediates larger 32-bit. In particular, we can avoid the bugprone value normalization hack in the AArch64 target.

This is a followup to D108076.

Diff Detail

Event Timeline

nikic created this revision.Aug 28 2021, 12:52 PM
nikic requested review of this revision.Aug 28 2021, 12:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2021, 12:52 PM
dmgreen accepted this revision.Aug 30 2021, 7:33 AM

This looks good to me, for the places where these Immediates get used. I don't see them changing behaviour even on 32bit machines.

Thanks, LGTM.

This revision is now accepted and ready to land.Aug 30 2021, 7:33 AM
This revision was landed with ongoing or failed builds.Aug 30 2021, 10:46 AM
This revision was automatically updated to reflect the committed changes.