Skip to content

Commit e1a4fb7

Browse files
committed
fixup! [RISCV] Add XSfmm pseudo instruction and vset* insertion support
1 parent b311886 commit e1a4fb7

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,25 +1899,6 @@ void RISCVInsertVSETVLI::insertReadVL(MachineBasicBlock &MBB) {
18991899
}
19001900
}
19011901

1902-
static void shrinkInterval(MachineOperand &MO, LiveIntervals *LIS,
1903-
const TargetInstrInfo *TII) {
1904-
Register Reg = MO.getReg();
1905-
MO.setReg(RISCV::NoRegister);
1906-
MO.setIsKill(false);
1907-
1908-
if (!LIS)
1909-
return;
1910-
1911-
LiveInterval &LI = LIS->getInterval(Reg);
1912-
1913-
// Erase the AVL operand from the instruction.
1914-
SmallVector<MachineInstr *> DeadMIs;
1915-
LIS->shrinkToUses(&LI, &DeadMIs);
1916-
// TODO: Enable this once needVSETVLIPHI is supported.
1917-
// SmallVector<LiveInterval *> SplitLIs;
1918-
// LIS->splitSeparateComponents(LI, SplitLIs);
1919-
}
1920-
19211902
bool RISCVInsertVSETVLI::insertVSETMTK(MachineBasicBlock &MBB,
19221903
TKTMMode Mode) const {
19231904

@@ -1960,10 +1941,19 @@ bool RISCVInsertVSETVLI::insertVSETMTK(MachineBasicBlock &MBB,
19601941
.addImm(Log2_32(CurrInfo.getTWiden()) + 1);
19611942

19621943
Changed = true;
1963-
if (LIS)
1944+
if (LIS) {
19641945
LIS->InsertMachineInstrInMaps(*TmpMI);
1946+
LiveInterval &LI = LIS->getInterval(Op.getReg());
1947+
1948+
// Erase the AVL operand from the instruction.
1949+
LIS->shrinkToUses(&LI);
1950+
// TODO: Enable this once needVSETVLIPHI is supported.
1951+
// SmallVector<LiveInterval *> SplitLIs;
1952+
// LIS->splitSeparateComponents(LI, SplitLIs);
1953+
}
19651954

1966-
shrinkInterval(Op, LIS, TII);
1955+
Op.setReg(RISCV::NoRegister);
1956+
Op.setIsKill(false);
19671957
}
19681958
return Changed;
19691959
}

0 commit comments

Comments
 (0)