From 9d60f53582c18ab608aa11f3db415f5eb6a2f8ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Bossu?= Date: Thu, 12 Dec 2024 16:27:33 +0000 Subject: [PATCH] [AIE2] Fix missing bypass for VMOV to Q registers --- llvm/lib/Target/AIE/AIE2GenFixupInstrInfo.td | 4 ++- llvm/lib/Target/AIE/AIE2Schedule.td | 6 +++++ .../CodeGen/AIE/aie2/schedule/mov_bypass.mir | 27 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AIE/AIE2GenFixupInstrInfo.td b/llvm/lib/Target/AIE/AIE2GenFixupInstrInfo.td index bfb40122afc5..3e2016ec864a 100644 --- a/llvm/lib/Target/AIE/AIE2GenFixupInstrInfo.td +++ b/llvm/lib/Target/AIE/AIE2GenFixupInstrInfo.td @@ -762,7 +762,9 @@ let Itinerary = II_VMOV_W in { ItinRegClassPair, OperandRegClass<1, eWL>]>, ItinRegClassPair, OperandRegClass<1, eWH>]>, ItinRegClassPair, OperandRegClass<1, mQQm>]>, - ItinRegClassPair, OperandRegClass<1, mQQm>]>] in { + ItinRegClassPair, OperandRegClass<1, mQQm>]>, + ItinRegClassPair, OperandRegClass<1, eWL>]>, + ItinRegClassPair, OperandRegClass<1, eWH>]>] in { def VMOV_mv_w : AIE2_mv_w_inst_mv< (outs OP_mMvAMWQDst:$dst), (ins OP_mMvAMWQSrc:$src), "vmov", "$dst, $src">; } diff --git a/llvm/lib/Target/AIE/AIE2Schedule.td b/llvm/lib/Target/AIE/AIE2Schedule.td index e5c620b1c0c5..f2dcede7a3f7 100644 --- a/llvm/lib/Target/AIE/AIE2Schedule.td +++ b/llvm/lib/Target/AIE/AIE2Schedule.td @@ -350,6 +350,8 @@ def II_VMOV_W_WMH_WML : InstrItinClass; def II_VMOV_W_WML_WML : InstrItinClass; def II_VMOV_W_WML_Q : InstrItinClass; def II_VMOV_W_WMH_Q : InstrItinClass; +def II_VMOV_W_Q_WML : InstrItinClass; +def II_VMOV_W_Q_WMH : InstrItinClass; def II_VMOV_X : InstrItinClass; def II_VMOV_X_BM_BM : InstrItinClass; def II_VMOV_X_BM_XM : InstrItinClass; @@ -999,6 +1001,10 @@ InstrItinData, SimpleCycle], [2,1], [MOV_Bypass, NoBypass]>, InstrItinData, SimpleCycle], [2,1], [NoBypass, NoBypass]>, +InstrItinData, SimpleCycle], + [2,1], [NoBypass, MOV_Bypass]>, +InstrItinData, SimpleCycle], + [2,1], [NoBypass, NoBypass]>, InstrItinData, PrefixCycle, SimpleCycle], [2,1], [NoBypass, NoBypass]>, InstrItinData, SimpleCycle], diff --git a/llvm/test/CodeGen/AIE/aie2/schedule/mov_bypass.mir b/llvm/test/CodeGen/AIE/aie2/schedule/mov_bypass.mir index fde0e5bdeeb2..0865ba412584 100644 --- a/llvm/test/CodeGen/AIE/aie2/schedule/mov_bypass.mir +++ b/llvm/test/CodeGen/AIE/aie2/schedule/mov_bypass.mir @@ -148,6 +148,33 @@ body: | $wl0 = VMOV_mv_w $wh1 ... +--- +name: bypass_q_wl +alignment: 16 +body: | + bb.0.entry: + ; CHECK-LABEL: name: bypass_q_wl + ; CHECK: $wl1 = VMOV_mv_w killed $wl0 + ; CHECK-NEXT: $q0 = VMOV_mv_w killed $wl1 + ; CHECK-NEXT: NOP + $wl1 = VMOV_mv_w $wl0 + $q0 = VMOV_mv_w $wl1 +... + +--- +name: no_bypass_q_wh +alignment: 16 +body: | + bb.0.entry: + ; CHECK-LABEL: name: no_bypass_q_wh + ; CHECK: $wh1 = VMOV_mv_w killed $wl0 + ; CHECK-NEXT: NOP + ; CHECK-NEXT: $q0 = VMOV_mv_w killed $wh1 + ; CHECK-NEXT: NOP + $wh1 = VMOV_mv_w $wl0 + $q0 = VMOV_mv_w $wh1 +... + --- name: bypass_x alignment: 16