[llvm] d342d13 - AMDGPU: Use isMeta flags on pseudoinstructions
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 29 07:31:42 PDT 2022
Author: Matt Arsenault
Date: 2022-06-29T10:31:29-04:00
New Revision: d342d130da809460971c5bfb6806f2439d24e526
URL: https://github.com/llvm/llvm-project/commit/d342d130da809460971c5bfb6806f2439d24e526
DIFF: https://github.com/llvm/llvm-project/commit/d342d130da809460971c5bfb6806f2439d24e526.diff
LOG: AMDGPU: Use isMeta flags on pseudoinstructions
Added:
Modified:
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/test/CodeGen/AMDGPU/sched-barrier-pre-RA.mir
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index 5b5555d5dca87..86e319aa4c25a 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -1770,14 +1770,8 @@ unsigned SIInstrInfo::getNumWaitStates(const MachineInstr &MI) {
case AMDGPU::S_NOP:
return MI.getOperand(0).getImm() + 1;
-
- // FIXME: Any other pseudo instruction?
// SI_RETURN_TO_EPILOG is a fallthrough to code outside of the function. The
// hazard, even if one exist, won't really be visible. Should we handle it?
- case AMDGPU::SI_MASKED_UNREACHABLE:
- case AMDGPU::WAVE_BARRIER:
- case AMDGPU::SCHED_BARRIER:
- return 0;
}
}
diff --git a/llvm/lib/Target/AMDGPU/SIInstructions.td b/llvm/lib/Target/AMDGPU/SIInstructions.td
index 12abd5ffddf10..49972f55ede22 100644
--- a/llvm/lib/Target/AMDGPU/SIInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SIInstructions.td
@@ -313,6 +313,7 @@ def WAVE_BARRIER : SPseudoInstSI<(outs), (ins),
let isConvergent = 1;
let FixedSize = 1;
let Size = 0;
+ let isMeta = 1;
}
def SCHED_BARRIER : SPseudoInstSI<(outs), (ins i32imm:$mask),
@@ -325,6 +326,7 @@ def SCHED_BARRIER : SPseudoInstSI<(outs), (ins i32imm:$mask),
let isConvergent = 1;
let FixedSize = 1;
let Size = 0;
+ let isMeta = 1;
}
// SI pseudo instructions. These are used by the CFG structurizer pass
@@ -462,6 +464,7 @@ def SI_MASKED_UNREACHABLE : SPseudoInstSI <(outs), (ins),
let Size = 0;
let hasNoSchedulingInfo = 1;
let FixedSize = 1;
+ let isMeta = 1;
}
// Used as an isel pseudo to directly emit initialization with an
@@ -497,6 +500,9 @@ def SI_RETURN_TO_EPILOG : SPseudoInstSI <
let hasNoSchedulingInfo = 1;
let DisableWQM = 1;
let FixedSize = 1;
+
+ // TODO: Should this be true?
+ let isMeta = 0;
}
// Return for returning function calls.
diff --git a/llvm/test/CodeGen/AMDGPU/sched-barrier-pre-RA.mir b/llvm/test/CodeGen/AMDGPU/sched-barrier-pre-RA.mir
index 739a622fae1ad..fea30a37ab8c3 100644
--- a/llvm/test/CodeGen/AMDGPU/sched-barrier-pre-RA.mir
+++ b/llvm/test/CodeGen/AMDGPU/sched-barrier-pre-RA.mir
@@ -385,8 +385,8 @@ body: |
; CHECK-LABEL: name: sched_barrier_mask_256
; CHECK: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
; CHECK-NEXT: [[DS_READ_U16_gfx9_:%[0-9]+]]:vgpr_32 = DS_READ_U16_gfx9 [[DEF]], 0, 0, implicit $exec :: (load (s32) from %ir.in, !alias.scope !0, addrspace 3)
- ; CHECK-NEXT: [[V_MUL_LO_U32_e64_:%[0-9]+]]:vgpr_32 = nsw V_MUL_LO_U32_e64 [[DS_READ_U16_gfx9_]], [[DS_READ_U16_gfx9_]], implicit $exec
; CHECK-NEXT: [[DS_READ_U16_gfx9_1:%[0-9]+]]:vgpr_32 = DS_READ_U16_gfx9 [[DEF]], 0, 0, implicit $exec :: (load (s32) from %ir.in, !alias.scope !0, addrspace 3)
+ ; CHECK-NEXT: [[V_MUL_LO_U32_e64_:%[0-9]+]]:vgpr_32 = nsw V_MUL_LO_U32_e64 [[DS_READ_U16_gfx9_]], [[DS_READ_U16_gfx9_]], implicit $exec
; CHECK-NEXT: S_NOP 0
; CHECK-NEXT: DS_WRITE_B32 [[V_MUL_LO_U32_e64_]], [[DEF]], 0, 16, implicit $m0, implicit $exec :: (store (s32) into %ir.out, !noalias !0, addrspace 3)
; CHECK-NEXT: SCHED_BARRIER 256
More information about the llvm-commits
mailing list