This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Unroll more to eliminate phis and conditions
ClosedPublic

Authored by rampitec on Apr 4 2017, 5:49 PM.

Details

Summary

Increase threshold to unroll a loop which contains an "if" statement
whose condition defined by a PHI belonging to the loop. This may help
to eliminate if region and potentially even PHI itself, saving on
both divergence and registers used for the PHI.

Add a small bonus for each of such "if" statements.

Diff Detail

Repository
rL LLVM

Event Timeline

rampitec created this revision.Apr 4 2017, 5:49 PM
rampitec updated this revision to Diff 94168.Apr 5 2017, 1:20 AM

Renamed variable

rampitec updated this revision to Diff 94170.Apr 5 2017, 1:35 AM

Added CHECK-LABEL to the test

vpykhtin accepted this revision.Apr 7 2017, 4:16 AM

LGTM.

lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
49

you can decrease nesting by using early exit here.

This revision is now accepted and ready to land.Apr 7 2017, 4:16 AM
rampitec updated this revision to Diff 94531.Apr 7 2017, 9:19 AM
rampitec marked an inline comment as done.

Use early exit as suggested.

This revision was automatically updated to reflect the committed changes.