This is an archive of the discontinued LLVM Phabricator instance.

[Support][SelectionDAG][GlobalISel] Hoist PostShift adjustment for IsAdd into UnsignedDivideUsingMagic.
ClosedPublic

Authored by craig.topper on Jan 4 2023, 1:57 PM.

Details

Summary

Instead of doing the adjustment in 3 different places in the code
base, do it inside UnsignedDivideUsingMagic::get.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 4 2023, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2023, 1:57 PM
craig.topper requested review of this revision.Jan 4 2023, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2023, 1:57 PM
lebedev.ri added inline comments.Jan 4 2023, 2:08 PM
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
4965–4973

Probably want similar assertion for PreShift?

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
6059–6068

Probably want similar assertion for PreShift?

6063

The name PostShift be propagated into UnsignedDivisionByConstantInfo struct?

craig.topper retitled this revision from [Support][SelectionDAG][GlobalISel] Hoist PostShift adjustment for IsADd into UnsignedDivideUsingMagic. to [Support][SelectionDAG][GlobalISel] Hoist PostShift adjustment for IsAdd into UnsignedDivideUsingMagic..Jan 4 2023, 2:17 PM

Address review comments

This revision is now accepted and ready to land.Jan 4 2023, 2:31 PM
This revision was landed with ongoing or failed builds.Jan 4 2023, 3:31 PM
This revision was automatically updated to reflect the committed changes.