This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Waitcnt pass: propagate info in the case of a single basic block loop
ClosedPublic

Authored by msearles on Mar 13 2018, 8:50 AM.

Details

Summary

Modify the waitcnt pass to propagate info in the case of a single basic block loop. mergeInputScoreBrackets() does this for us; update it so that it processes the single bb's score bracket when processing the single bb's preds. It is, after all, a pred of itself, so it's score bracket is needed.

Diff Detail

Repository
rL LLVM

Event Timeline

msearles created this revision.Mar 13 2018, 8:50 AM
msearles added a project: Restricted Project.
msearles added subscribers: llvm-commits, Restricted Project.
rampitec added inline comments.Mar 13 2018, 9:38 AM
lib/Target/AMDGPU/SIInsertWaitcnts.cpp
1313 ↗(On Diff #138201)

I think you can use std::find().

1328 ↗(On Diff #138201)

Do you need to make a copy if block is not a self predecessor? You are not going to reuse it then as far as I understand.

msearles updated this revision to Diff 138391.Mar 14 2018, 9:32 AM

Adjust per reviewer comments.

msearles marked 2 inline comments as done.Mar 14 2018, 9:32 AM
rampitec accepted this revision.Mar 14 2018, 11:32 AM

LGTM, just fix formatting before submit.

lib/Target/AMDGPU/SIInsertWaitcnts.cpp
1320 ↗(On Diff #138391)

Please add spaces after commas.

This revision is now accepted and ready to land.Mar 14 2018, 11:32 AM
msearles updated this revision to Diff 138430.Mar 14 2018, 11:50 AM

Fix formatting per reviewer comments

msearles marked an inline comment as done.Mar 14 2018, 11:51 AM
This revision was automatically updated to reflect the committed changes.