2019-03-26 01:15:44 +08:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
|
|
|
# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=machine-scheduler -verify-machineinstrs %s -o - | FileCheck %s
|
|
|
|
|
|
|
|
# The sequence of DBG_VALUEs forms a scheduling region with 0 real
|
|
|
|
# instructions. The RegPressure tracker would end up skipping over any
|
|
|
|
# debug instructions, so it would point to the instruction
|
|
|
|
# before/outside of the region, hitting this assert:
|
|
|
|
# assert((BotRPTracker.getPos() == RegionEnd ||
|
|
|
|
# (RegionEnd->isDebugInstr() &&
|
|
|
|
# BotRPTracker.getPos() == priorNonDebug(RegionEnd, RegionBegin))) &&
|
|
|
|
# "Can't find the region bottom");
|
|
|
|
|
|
|
|
---
|
|
|
|
name: only_dbg_value_sched_region
|
|
|
|
tracksRegLiveness: true
|
|
|
|
machineFunctionInfo:
|
|
|
|
isEntryFunction: true
|
|
|
|
waveLimiter: true
|
|
|
|
body: |
|
|
|
|
; CHECK-LABEL: name: only_dbg_value_sched_region
|
|
|
|
; CHECK: bb.0:
|
|
|
|
; CHECK: successors: %bb.1(0x80000000)
|
|
|
|
; CHECK: liveins: $vgpr0
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
|
|
|
|
; CHECK: [[DEF:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
|
2019-05-01 06:08:23 +08:00
|
|
|
; CHECK: [[GLOBAL_LOAD_DWORDX2_:%[0-9]+]]:vreg_64 = GLOBAL_LOAD_DWORDX2 [[DEF]], 0, 0, 0, 0, implicit $exec
|
|
|
|
; CHECK: [[GLOBAL_LOAD_DWORD:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD [[DEF]], 8, 0, 0, 0, implicit $exec
|
2020-01-07 23:43:46 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:vreg_64 = COPY [[GLOBAL_LOAD_DWORDX2_]]
|
|
|
|
; CHECK: undef %6.sub0:vreg_64 = V_ADD_F32_e32 [[DEF]].sub0, [[COPY1]].sub0, implicit $mode, implicit $exec
|
|
|
|
; CHECK: dead undef %6.sub1:vreg_64 = V_ADD_F32_e32 [[DEF]].sub1, [[COPY1]].sub0, implicit $mode, implicit $exec
|
|
|
|
; CHECK: [[GLOBAL_LOAD_DWORD1:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD [[COPY1]], 0, 0, 0, 0, implicit $exec
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 22:33:59 +08:00
|
|
|
; CHECK: undef %4.sub0:vreg_64 = V_MOV_B32_e32 111, implicit $exec
|
2019-03-26 01:15:44 +08:00
|
|
|
; CHECK: [[DEF1:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
|
|
|
|
; CHECK: [[DEF2:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
|
|
|
|
; CHECK: [[DEF3:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
|
|
|
|
; CHECK: undef %11.sub1:vreg_64 = IMPLICIT_DEF
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 22:33:59 +08:00
|
|
|
; CHECK: [[DEF4:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
|
|
|
|
; CHECK: [[DEF5:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
|
|
|
|
; CHECK: [[DEF6:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
|
2020-05-28 01:25:37 +08:00
|
|
|
; CHECK: undef %19.sub0:vreg_64 = V_ADD_F32_e32 [[GLOBAL_LOAD_DWORD1]], [[GLOBAL_LOAD_DWORDX2_]].sub0, implicit $mode, implicit $exec
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 22:33:59 +08:00
|
|
|
; CHECK: [[DEF7:%[0-9]+]]:vreg_64 = IMPLICIT_DEF
|
2020-05-28 01:25:37 +08:00
|
|
|
; CHECK: %19.sub1:vreg_64 = V_ADD_F32_e32 [[GLOBAL_LOAD_DWORD]], [[GLOBAL_LOAD_DWORD]], implicit $mode, implicit $exec
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 22:33:59 +08:00
|
|
|
; CHECK: [[DEF8:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
|
|
|
|
; CHECK: %4.sub1:vreg_64 = V_ADD_U32_e32 [[COPY]], [[COPY]], implicit $exec
|
2019-05-01 06:08:23 +08:00
|
|
|
; CHECK: GLOBAL_STORE_DWORDX2 %19, %4, 32, 0, 0, 0, implicit $exec
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 22:33:59 +08:00
|
|
|
; CHECK: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
; CHECK: [[V_MOV_B32_e32_1:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
; CHECK: %11.sub0:vreg_64 = GLOBAL_LOAD_DWORD [[DEF2]], 0, 0, 0, 0, implicit $exec
|
|
|
|
; CHECK: [[DEF1]].sub0:vreg_64 = GLOBAL_LOAD_DWORD [[DEF3]], 0, 0, 0, 0, implicit $exec
|
2019-05-01 06:08:23 +08:00
|
|
|
; CHECK: dead %20:vgpr_32 = GLOBAL_LOAD_DWORD %11, 0, 0, 0, 0, implicit $exec
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 22:33:59 +08:00
|
|
|
; CHECK: dead %21:vgpr_32 = GLOBAL_LOAD_DWORD [[DEF6]], 0, 0, 0, 0, implicit $exec
|
|
|
|
; CHECK: [[V_LSHLREV_B64_:%[0-9]+]]:vreg_64 = V_LSHLREV_B64 2, [[DEF1]], implicit $exec
|
|
|
|
; CHECK: dead %22:vgpr_32 = GLOBAL_LOAD_DWORD [[DEF7]], 0, 0, 0, 0, implicit $exec
|
|
|
|
; CHECK: S_NOP 0, implicit [[DEF5]], implicit [[V_LSHLREV_B64_]].sub0, implicit [[DEF4]], implicit [[V_MOV_B32_e32_]]
|
|
|
|
; CHECK: GLOBAL_STORE_DWORD [[DEF7]], [[V_MOV_B32_e32_1]], 0, 0, 0, 0, implicit $exec
|
2019-03-26 01:15:44 +08:00
|
|
|
; CHECK: bb.1:
|
|
|
|
; CHECK: successors: %bb.2(0x80000000)
|
2020-05-28 01:25:37 +08:00
|
|
|
; CHECK: S_SETREG_IMM32_B32 0, 1, implicit-def $mode, implicit $mode
|
2019-03-26 01:15:44 +08:00
|
|
|
; CHECK: DBG_VALUE
|
|
|
|
; CHECK: DBG_VALUE
|
|
|
|
; CHECK: DBG_VALUE
|
2020-05-28 01:25:37 +08:00
|
|
|
; CHECK: S_SETREG_IMM32_B32 0, 1, implicit-def $mode, implicit $mode
|
2019-03-26 01:15:44 +08:00
|
|
|
; CHECK: bb.2:
|
|
|
|
; CHECK: S_NOP 0, implicit [[COPY]]
|
|
|
|
; CHECK: S_NOP 0, implicit [[DEF8]]
|
|
|
|
; CHECK: S_ENDPGM 0
|
|
|
|
bb.0:
|
|
|
|
liveins: $vgpr0
|
|
|
|
|
|
|
|
%0:vgpr_32 = COPY $vgpr0
|
|
|
|
%1:vreg_64 = IMPLICIT_DEF
|
2019-05-01 06:08:23 +08:00
|
|
|
%2:vreg_64 = GLOBAL_LOAD_DWORDX2 %1, 0, 0, 0, 0, implicit $exec
|
|
|
|
%3:vgpr_32 = GLOBAL_LOAD_DWORD %1, 8, 0, 0, 0, implicit $exec
|
2019-03-26 01:15:44 +08:00
|
|
|
undef %4.sub1:vreg_64 = V_ADD_U32_e32 %0, %0, implicit $exec
|
|
|
|
%4.sub0:vreg_64 = V_MOV_B32_e32 111, implicit $exec
|
|
|
|
%5:vreg_64 = COPY %2
|
2020-05-28 01:25:37 +08:00
|
|
|
undef %6.sub0:vreg_64 = V_ADD_F32_e32 %1.sub0, %5.sub0, implicit $mode, implicit $exec
|
|
|
|
%6.sub1:vreg_64 = V_ADD_F32_e32 %1.sub1, %5.sub0, implicit $mode, implicit $exec
|
2019-05-01 06:08:23 +08:00
|
|
|
%7:vgpr_32 = GLOBAL_LOAD_DWORD %5, 0, 0, 0, 0, implicit $exec
|
2019-03-26 01:15:44 +08:00
|
|
|
%8:vreg_64 = IMPLICIT_DEF
|
|
|
|
%9:vreg_64 = IMPLICIT_DEF
|
|
|
|
%10:vreg_64 = IMPLICIT_DEF
|
|
|
|
undef %11.sub1:vreg_64 = IMPLICIT_DEF
|
|
|
|
%12:vgpr_32 = IMPLICIT_DEF
|
|
|
|
%13:vgpr_32 = IMPLICIT_DEF
|
|
|
|
%14:vreg_64 = IMPLICIT_DEF
|
|
|
|
%15:vreg_64 = IMPLICIT_DEF
|
|
|
|
%16:vgpr_32 = IMPLICIT_DEF
|
|
|
|
%17:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
|
|
|
|
%18:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
|
2020-05-28 01:25:37 +08:00
|
|
|
undef %19.sub0:vreg_64 = V_ADD_F32_e32 %7, %2.sub0, implicit $mode, implicit $exec
|
|
|
|
%19.sub1:vreg_64 = V_ADD_F32_e32 %3, %3, implicit $mode, implicit $exec
|
2019-05-01 06:08:23 +08:00
|
|
|
GLOBAL_STORE_DWORDX2 %19, %4, 32, 0, 0, 0, implicit $exec
|
|
|
|
%11.sub0:vreg_64 = GLOBAL_LOAD_DWORD %9, 0, 0, 0, 0, implicit $exec
|
|
|
|
%8.sub0:vreg_64 = GLOBAL_LOAD_DWORD %10, 0, 0, 0, 0, implicit $exec
|
|
|
|
%20:vgpr_32 = GLOBAL_LOAD_DWORD %11, 0, 0, 0, 0, implicit $exec
|
|
|
|
%21:vgpr_32 = GLOBAL_LOAD_DWORD %14, 0, 0, 0, 0, implicit $exec
|
|
|
|
%22:vgpr_32 = GLOBAL_LOAD_DWORD %15, 0, 0, 0, 0, implicit $exec
|
2019-03-26 01:15:44 +08:00
|
|
|
%23:vreg_64 = V_LSHLREV_B64 2, %8, implicit $exec
|
|
|
|
S_NOP 0, implicit %13, implicit %23.sub0, implicit %12, implicit %17
|
2019-05-01 06:08:23 +08:00
|
|
|
GLOBAL_STORE_DWORD %15, %18, 0, 0, 0, 0, implicit $exec
|
2019-03-26 01:15:44 +08:00
|
|
|
|
|
|
|
bb.1:
|
2020-05-28 01:25:37 +08:00
|
|
|
S_SETREG_IMM32_B32 0, 1, implicit-def $mode, implicit $mode
|
2019-03-26 01:15:44 +08:00
|
|
|
DBG_VALUE
|
|
|
|
DBG_VALUE
|
|
|
|
DBG_VALUE
|
2020-05-28 01:25:37 +08:00
|
|
|
S_SETREG_IMM32_B32 0, 1, implicit-def $mode, implicit $mode
|
2019-03-26 01:15:44 +08:00
|
|
|
|
|
|
|
bb.2:
|
|
|
|
S_NOP 0, implicit %0
|
|
|
|
S_NOP 0, implicit %16
|
|
|
|
S_ENDPGM 0
|
|
|
|
|
|
|
|
...
|