Skip to content

Commit 1d02ea4

Browse files
Update ADD_NC instr. to use itinerary based on regClass
1 parent d56d2a3 commit 1d02ea4

File tree

3 files changed

+448
-1
lines changed

3 files changed

+448
-1
lines changed

llvm/lib/Target/AIE/AIE2GenInstrInfo.td

+9-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ let Itinerary = II_ADD in {
1414
def ADD_add_r_ri : AIE2_add_r_ri_inst_alu<(outs eR:$mRx), (ins eR:$mRx0, simm7:$c7s), "add", "$mRx, $mRx0, $c7s">;
1515
}
1616
let Itinerary = II_ADD_NC in {
17-
def ADD_NC : AIE2_mv_add_inst_mv<(outs OP_mMvSclDst:$dst), (ins eR:$s0, simm6:$imm), "add.nc", "$dst, $s0, $imm">;
17+
let ItineraryRegPairs = [ItinRegClassPair<II_ADD_NC_RS,[OperandRegClass<0, eR>]>,
18+
ItinRegClassPair<II_ADD_NC_P,[OperandRegClass<0, eP>]>,
19+
ItinRegClassPair<II_ADD_NC_M,[OperandRegClass<0, eM>]>,
20+
ItinRegClassPair<II_ADD_NC_RS,[OperandRegClass<0, eS>]>,
21+
ItinRegClassPair<II_ADD_NC_DC,[OperandRegClass<0, eDC>]>,
22+
ItinRegClassPair<II_ADD_NC_DJ,[OperandRegClass<0, eDJ>]>,
23+
ItinRegClassPair<II_ADD_NC_DN,[OperandRegClass<0, eDN>]>] in {
24+
def ADD_NC : AIE2_mv_add_inst_mv<(outs OP_mMvSclDst:$dst), (ins eR:$s0, simm6:$imm), "add.nc", "$dst, $s0, $imm">;
25+
}
1826
}
1927
// II_ADD_NC_GPR was defined to avoid unnecessary resource dependencies when moving the result into a GPR
2028
let Itinerary = II_ADD_NC_GPR, isCodeGenOnly = 1 in {

llvm/lib/Target/AIE/AIE2Schedule.td

+12
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ def II_ACQ_COND : InstrItinClass;
150150
def II_ADC : InstrItinClass;
151151
def II_ADD : InstrItinClass;
152152
def II_ADD_NC : InstrItinClass;
153+
def II_ADD_NC_DC : InstrItinClass;
154+
def II_ADD_NC_DJ : InstrItinClass;
155+
def II_ADD_NC_DN : InstrItinClass;
156+
def II_ADD_NC_M : InstrItinClass;
157+
def II_ADD_NC_P : InstrItinClass;
158+
def II_ADD_NC_RS : InstrItinClass;
153159
def II_ADD_NC_GPR : InstrItinClass;
154160
def II_AND : InstrItinClass;
155161
def II_ASHL : InstrItinClass;
@@ -436,6 +442,12 @@ InstrItinData<II_ADD, [InstrStage<1, [R_WX_PORT]>],
436442
InstrItinData<II_ADD_NC, [PrefixCycle<P_WM_PORT>, PrefixCycle<M_WM_PORT>, PrefixCycle<DJ_WM_PORT>,
437443
PrefixCycle<DN_WM_PORT>, PrefixCycle<DC_WM_PORT>, SimpleCycle<RS_WM_PORT>],
438444
[1,1,1]>,
445+
InstrItinData<II_ADD_NC_DC, [SimpleCycle<DC_WM_PORT>], [1,1,1]>,
446+
InstrItinData<II_ADD_NC_DJ, [SimpleCycle<DJ_WM_PORT>], [1,1,1]>,
447+
InstrItinData<II_ADD_NC_DN, [SimpleCycle<DN_WM_PORT>], [1,1,1]>,
448+
InstrItinData<II_ADD_NC_M, [SimpleCycle<M_WM_PORT>], [1,1,1]>,
449+
InstrItinData<II_ADD_NC_P, [SimpleCycle<P_WM_PORT>], [1,1,1]>,
450+
InstrItinData<II_ADD_NC_RS, [SimpleCycle<RS_WM_PORT>], [1,1,1]>,
439451
InstrItinData<II_ADD_NC_GPR, [SimpleCycle<RS_WM_PORT>], [1,1,1]>,
440452
InstrItinData<II_AND, [InstrStage<1, [R_WX_PORT]>], [1,1,1,1]>,
441453
InstrItinData<II_ASHL, [InstrStage<1, [R_WX_PORT]>], [1,1,1,1]>,

0 commit comments

Comments
 (0)