forked from OSchip/llvm-project
[AMDGPU] Disable endcf collapse
There are some functional regressions and I suspect our scopes are not as perfectly enclosed as I expected. Disable it for now. Differential Revision: https://reviews.llvm.org/D76148
This commit is contained in:
parent
994c071a1b
commit
32e90cbcd1
|
@ -74,6 +74,10 @@ using namespace llvm;
|
||||||
|
|
||||||
#define DEBUG_TYPE "si-lower-control-flow"
|
#define DEBUG_TYPE "si-lower-control-flow"
|
||||||
|
|
||||||
|
static cl::opt<bool>
|
||||||
|
RemoveRedundantEndcf("amdgpu-remove-redundant-endcf",
|
||||||
|
cl::init(false), cl::ReallyHidden);
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class SILowerControlFlow : public MachineFunctionPass {
|
class SILowerControlFlow : public MachineFunctionPass {
|
||||||
|
@ -444,14 +448,17 @@ void SILowerControlFlow::emitEndCf(MachineInstr &MI) {
|
||||||
|
|
||||||
// If the only instruction immediately following this END_CF is an another
|
// If the only instruction immediately following this END_CF is an another
|
||||||
// END_CF in the only successor we can avoid emitting exec mask restore here.
|
// END_CF in the only successor we can avoid emitting exec mask restore here.
|
||||||
auto Next = skipIgnoreExecInstsTrivialSucc(MBB, std::next(MI.getIterator()));
|
if (RemoveRedundantEndcf) {
|
||||||
if (Next != MBB.end() && (Next->getOpcode() == AMDGPU::SI_END_CF ||
|
auto Next =
|
||||||
LoweredEndCf.count(&*Next))) {
|
skipIgnoreExecInstsTrivialSucc(MBB, std::next(MI.getIterator()));
|
||||||
LLVM_DEBUG(dbgs() << "Skip redundant "; MI.dump());
|
if (Next != MBB.end() && (Next->getOpcode() == AMDGPU::SI_END_CF ||
|
||||||
if (LIS)
|
LoweredEndCf.count(&*Next))) {
|
||||||
LIS->RemoveMachineInstrFromMaps(MI);
|
LLVM_DEBUG(dbgs() << "Skip redundant "; MI.dump());
|
||||||
MI.eraseFromParent();
|
if (LIS)
|
||||||
return;
|
LIS->RemoveMachineInstrFromMaps(MI);
|
||||||
|
MI.eraseFromParent();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MachineBasicBlock::iterator InsPt =
|
MachineBasicBlock::iterator InsPt =
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN %s
|
; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs -amdgpu-remove-redundant-endcf < %s | FileCheck -enable-var-scope -check-prefix=GCN %s
|
||||||
|
|
||||||
; GCN-LABEL: {{^}}simple_nested_if:
|
; GCN-LABEL: {{^}}simple_nested_if:
|
||||||
; GCN: s_and_saveexec_b64 [[SAVEEXEC:s\[[0-9:]+\]]]
|
; GCN: s_and_saveexec_b64 [[SAVEEXEC:s\[[0-9:]+\]]]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
||||||
# RUN: llc -march=amdgcn -verify-machineinstrs -run-pass=si-lower-control-flow %s -o - | FileCheck -check-prefix=GCN %s
|
# RUN: llc -march=amdgcn -verify-machineinstrs -run-pass=si-lower-control-flow -amdgpu-remove-redundant-endcf %s -o - | FileCheck -check-prefix=GCN %s
|
||||||
|
|
||||||
# Make sure dbg_value doesn't change codeegn when collapsing end_cf
|
# Make sure dbg_value doesn't change codeegn when collapsing end_cf
|
||||||
---
|
---
|
||||||
|
|
|
@ -58,7 +58,7 @@ define void @lsr_order_mul24_1(i32 %arg, i32 %arg1, i32 %arg2, float addrspace(3
|
||||||
; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, 1, v5
|
; GFX9-NEXT: v_cmp_eq_u32_e32 vcc, 1, v5
|
||||||
; GFX9-NEXT: v_cmp_lt_u32_e64 s[4:5], v0, v1
|
; GFX9-NEXT: v_cmp_lt_u32_e64 s[4:5], v0, v1
|
||||||
; GFX9-NEXT: s_and_saveexec_b64 s[10:11], s[4:5]
|
; GFX9-NEXT: s_and_saveexec_b64 s[10:11], s[4:5]
|
||||||
; GFX9-NEXT: s_cbranch_execz BB1_3
|
; GFX9-NEXT: s_cbranch_execz BB1_4
|
||||||
; GFX9-NEXT: ; %bb.1: ; %bb19
|
; GFX9-NEXT: ; %bb.1: ; %bb19
|
||||||
; GFX9-NEXT: v_cvt_f32_u32_e32 v7, v6
|
; GFX9-NEXT: v_cvt_f32_u32_e32 v7, v6
|
||||||
; GFX9-NEXT: v_and_b32_e32 v5, 0xffffff, v6
|
; GFX9-NEXT: v_and_b32_e32 v5, 0xffffff, v6
|
||||||
|
@ -100,7 +100,9 @@ define void @lsr_order_mul24_1(i32 %arg, i32 %arg1, i32 %arg2, float addrspace(3
|
||||||
; GFX9-NEXT: v_add_u32_e32 v3, v3, v6
|
; GFX9-NEXT: v_add_u32_e32 v3, v3, v6
|
||||||
; GFX9-NEXT: s_andn2_b64 exec, exec, s[12:13]
|
; GFX9-NEXT: s_andn2_b64 exec, exec, s[12:13]
|
||||||
; GFX9-NEXT: s_cbranch_execnz BB1_2
|
; GFX9-NEXT: s_cbranch_execnz BB1_2
|
||||||
; GFX9-NEXT: BB1_3: ; %Flow3
|
; GFX9-NEXT: ; %bb.3: ; %Flow
|
||||||
|
; GFX9-NEXT: s_or_b64 exec, exec, s[12:13]
|
||||||
|
; GFX9-NEXT: BB1_4: ; %Flow3
|
||||||
; GFX9-NEXT: s_or_b64 exec, exec, s[10:11]
|
; GFX9-NEXT: s_or_b64 exec, exec, s[10:11]
|
||||||
; GFX9-NEXT: s_waitcnt lgkmcnt(0)
|
; GFX9-NEXT: s_waitcnt lgkmcnt(0)
|
||||||
; GFX9-NEXT: s_setpc_b64 s[30:31]
|
; GFX9-NEXT: s_setpc_b64 s[30:31]
|
||||||
|
|
Loading…
Reference in New Issue