This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Add option to expand 64-bit integer division in IR
ClosedPublic

Authored by arsenm on Jan 20 2020, 4:58 PM.

Details

Reviewers
rampitec
Summary

I didn't realize we were already expanding 24/32-bit division here
already. Use the available IntegerDivision utilities. This uses loops,
so produces significantly smaller code than the inline DAG expansion.

This now requires width reductions of 64-bit divisions before
introducing the expanded loops.

This helps work around missing legalization in GlobalISel for
division, which are the only remaining core instructions that didn't
work at all.

I think this is plausibly a better implementation than exists in the
DAG, although turning it on by default misses out on the constant
value optimizations and also needs benchmarking.

Diff Detail

Event Timeline

arsenm created this revision.Jan 20 2020, 4:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2020, 4:58 PM
This revision is now accepted and ready to land.Jan 29 2020, 10:25 AM
arsenm updated this revision to Diff 243986.Feb 11 2020, 1:41 PM

Rebase and fix special cases

arsenm requested review of this revision.Feb 11 2020, 1:41 PM
arsenm updated this revision to Diff 243987.

Correct patch

rampitec accepted this revision.Feb 11 2020, 2:05 PM
This revision is now accepted and ready to land.Feb 11 2020, 2:05 PM