[llvm] [AMDGPU] Relax VOPD constraints for gfx12+ with data deps (PR #191264)
Shilei Tian via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 11 21:33:21 PDT 2026
================
@@ -183,38 +240,30 @@ static bool shouldScheduleVOPDAdjacent(const TargetInstrInfo &TII,
const MachineInstr &SecondMI) {
const SIInstrInfo &STII = static_cast<const SIInstrInfo &>(TII);
const GCNSubtarget &ST = STII.getSubtarget();
- unsigned EncodingFamily = AMDGPU::getVOPDEncodingFamily(ST);
- unsigned Opc2 = SecondMI.getOpcode();
-
- const auto checkVOPD = [&](bool VOPD3) -> bool {
- auto SecondCanBeVOPD = AMDGPU::getCanBeVOPD(Opc2, EncodingFamily, VOPD3);
-
- // One instruction case
- if (!FirstMI)
- return SecondCanBeVOPD.Y || SecondCanBeVOPD.X;
-
- unsigned Opc = FirstMI->getOpcode();
- auto FirstCanBeVOPD = AMDGPU::getCanBeVOPD(Opc, EncodingFamily, VOPD3);
- if (!((FirstCanBeVOPD.X && SecondCanBeVOPD.Y) ||
- (FirstCanBeVOPD.Y && SecondCanBeVOPD.X)))
- return false;
+ // One instruction case: just check whether SecondMI is eligible at all.
+ if (!FirstMI) {
+ unsigned EncodingFamily = AMDGPU::getVOPDEncodingFamily(ST);
+ unsigned Opc2 = SecondMI.getOpcode();
+ auto checkCanBeVOPD = [&](bool VOPD3) {
+ auto CanBeVOPD = AMDGPU::getCanBeVOPD(Opc2, EncodingFamily, VOPD3);
----------------
shiltian wrote:
no auto
https://github.com/llvm/llvm-project/pull/191264
More information about the llvm-commits
mailing list