This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix scheduler live-ins with debug inst at start of block
ClosedPublic

Authored by vangthao on Feb 2 2022, 3:33 PM.

Details

Summary

GCNDownwardRPTracker RPTracker.reset() skips debug instructions for NextMI so RPTracker.getNext() will never give the beginning of a sched region if it is a debug value. In this case we will never set the live-ins for that block.

Add check to see if getNext also equals the MI after skipping debug instructions.

Diff Detail

Event Timeline

vangthao created this revision.Feb 2 2022, 3:33 PM
vangthao requested review of this revision.Feb 2 2022, 3:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2022, 3:33 PM
vangthao updated this revision to Diff 405472.Feb 2 2022, 3:35 PM

Typo in commit message: "RPTracker.getNext() will *never* give the beginning of a sched region"

vangthao edited the summary of this revision. (Show Details)Feb 2 2022, 3:37 PM
vangthao added reviewers: rampitec, vpykhtin.
arsenm added inline comments.Feb 2 2022, 3:39 PM
llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
514

could you just apply skipDebuInstructionsForward to MBB->begin instead of adding a second check

vangthao added inline comments.Feb 2 2022, 4:06 PM
llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
514

We would have to call skipDebugInstructionsForward on Regions[CurRegion].first per loop iteration or check if Regions[CurRegion].first is a debug instruction and set region live-ins before the loop.

rampitec accepted this revision.Feb 2 2022, 4:14 PM
This revision is now accepted and ready to land.Feb 2 2022, 4:14 PM
This revision was landed with ongoing or failed builds.Feb 3 2022, 12:47 PM
This revision was automatically updated to reflect the committed changes.