Revert "[RISCV] move `isFaultFirstLoad` into `RISCVInstrInfo`"

This reverts commit e018e493c1.

There are some problems with this commit,
related revision: https://reviews.llvm.org/D127477
This commit is contained in:
Shao-Ce SUN 2022-06-11 00:02:45 +08:00
parent d459530804
commit 93116374e7
4 changed files with 8 additions and 9 deletions

View File

@ -182,4 +182,9 @@ void RISCVVType::printVType(unsigned VType, raw_ostream &OS) {
OS << ", mu";
}
bool isFaultFirstLoad(const MachineInstr &MI) {
return MI.getNumExplicitDefs() == 2 && MI.modifiesRegister(RISCV::VL) &&
!MI.isInlineAsm();
}
} // namespace llvm

View File

@ -433,13 +433,7 @@ void printVType(unsigned VType, raw_ostream &OS);
} // namespace RISCVVType
namespace RISCVVInstInfo {
inline static bool isFaultFirstLoad(const MachineInstr &MI) {
return MI.getNumExplicitDefs() == 2 && MI.modifiesRegister(RISCV::VL) &&
!MI.isInlineAsm();
}
} // namespace RISCVVInstInfo
bool isFaultFirstLoad(const MachineInstr &MI);
} // namespace llvm
#endif

View File

@ -1414,7 +1414,7 @@ void RISCVInsertVSETVLI::doLocalPostpass(MachineBasicBlock &MBB) {
void RISCVInsertVSETVLI::insertReadVL(MachineBasicBlock &MBB) {
for (auto I = MBB.begin(), E = MBB.end(); I != E;) {
MachineInstr &MI = *I++;
if (RISCVVInstInfo::isFaultFirstLoad(MI)) {
if (isFaultFirstLoad(MI)) {
Register VLOutput = MI.getOperand(1).getReg();
if (!MRI->use_nodbg_empty(VLOutput))
BuildMI(MBB, I, MI.getDebugLoc(), TII->get(RISCV::PseudoReadVL),

View File

@ -158,7 +158,7 @@ static bool lowerRISCVVMachineInstrToMCInst(const MachineInstr *MI,
if (RISCVII::hasSEWOp(TSFlags))
--NumOps;
bool hasVLOutput = RISCVVInstInfo::isFaultFirstLoad(*MI);
bool hasVLOutput = isFaultFirstLoad(*MI);
for (unsigned OpNo = 0; OpNo != NumOps; ++OpNo) {
const MachineOperand &MO = MI->getOperand(OpNo);
// Skip vl ouput. It should be the second output.