[all-commits] [llvm/llvm-project] 570471: [AMDGPU] Fix debug values in scheduler not placed ...

vangthao95 via All-commits all-commits at lists.llvm.org
Mon Feb 7 11:04:24 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 570471199bfa18fa0ee153336bd84e47dc5480a6
      https://github.com/llvm/llvm-project/commit/570471199bfa18fa0ee153336bd84e47dc5480a6
  Author: Vang Thao <Vang.Thao at amd.com>
  Date:   2022-02-07 (Mon, 07 Feb 2022)

  Changed paths:
    M llvm/lib/CodeGen/MachineScheduler.cpp
    M llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
    A llvm/test/CodeGen/AMDGPU/debug-value-scheduler.mir

  Log Message:
  -----------
  [AMDGPU] Fix debug values in scheduler not placed correctly when reverting

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.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D119022




More information about the All-commits mailing list