Skip to content

Commit 09df635

Browse files
author
chenqian
committed
fix: add ESP_VST_128_IP isSchedulingBoundary because instruction scheduling causes register erros
1 parent ffb1f70 commit 09df635

File tree

3 files changed

+231
-217
lines changed

3 files changed

+231
-217
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4329,3 +4329,15 @@ RISCVInstrInfo::analyzeLoopForPipelining(MachineBasicBlock *LoopBB) const {
43294329

43304330
return std::make_unique<RISCVPipelinerLoopInfo>(LHS, RHS, Cond);
43314331
}
4332+
4333+
bool RISCVInstrInfo::isSchedulingBoundary(const MachineInstr &MI,
4334+
const MachineBasicBlock *MBB,
4335+
const MachineFunction &MF) const {
4336+
if (MI.getOpcode() == RISCV::ESP_VST_128_IP ||
4337+
MI.getOpcode() == RISCV::ESP_VST_L_64_IP ||
4338+
MI.getOpcode() == RISCV::ESP_VST_H_64_IP ||
4339+
MI.getOpcode() == RISCV::ESP_VLDBC_8_IP ||
4340+
MI.getOpcode() == RISCV::ESP_ZERO_Q)
4341+
return true;
4342+
return TargetInstrInfo::isSchedulingBoundary(MI, MBB, MF);
4343+
}

llvm/lib/Target/RISCV/RISCVInstrInfo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ class RISCVInstrInfo : public RISCVGenInstrInfo {
141141
bool
142142
reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
143143

144+
bool isSchedulingBoundary(const MachineInstr &MI,
145+
const MachineBasicBlock *MBB,
146+
const MachineFunction &MF) const override;
147+
144148
bool optimizeCondBranch(MachineInstr &MI) const override;
145149

146150
MachineBasicBlock *getBranchDestBlock(const MachineInstr &MI) const override;

0 commit comments

Comments
 (0)