[PATCH] D119022: [AMDGPU] Fix debug values in scheduler not placed correctly when reverting

Vang Thao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 4 10:44:40 PST 2022


vangthao created this revision.
Herald added subscribers: foad, ecnelises, kerbowa, javed.absar, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm, MatzeB.
vangthao requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Debug position data is cleared after ScheduleDAGMILive::schedule() due to it also calling placeDebugValues(). Make it so the data is not cleared after initial call to placeDebugValues since we will call it again after reverting a schedule.

Secondly, since we skip debug instructions when reverting the schedule on AMDGPU, all debug instructions are now moved to the end of the scheduling region. RegionEnd points to the beginning of this chunk of debug instructions since it was not incremented when a debug instruction was skipped. RegionBegin may also point to the same debug instruction if Unsched.front() is a debug instruction thus shrinking the region to 1. Fix RegionBegin and RegionEnd so that they point to the current beginning and ending before calling placeDebugValues() since both vars will be used as reference points to move debug instructions back.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119022

Files:
  llvm/lib/CodeGen/MachineScheduler.cpp
  llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
  llvm/test/CodeGen/AMDGPU/debug-value-scheduler.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119022.406038.patch
Type: text/x-patch
Size: 22254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220204/68c20124/attachment.bin>


More information about the llvm-commits mailing list