Skip to content

Commit 6bceb53

Browse files
author
Yeting Kuo
committed
Set change right after adding implict use of frm.
1 parent da0489e commit 6bceb53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVInsertReadWriteCSR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ bool RISCVInsertReadWriteCSR::emitWriteRoundingModeOpt(MachineBasicBlock &MBB) {
105105
// Make MI implicit use FRM.
106106
MI.addOperand(MachineOperand::CreateReg(RISCV::FRM, /*IsDef*/ false,
107107
/*IsImp*/ true));
108+
Changed = true;
108109

109110
// Skip if MI uses same rounding mode as FRM.
110111
if (InstrRM == CurrentRM)
@@ -122,7 +123,6 @@ bool RISCVInsertReadWriteCSR::emitWriteRoundingModeOpt(MachineBasicBlock &MBB) {
122123
.addImm(InstrRM);
123124
}
124125
CurrentRM = InstrRM;
125-
Changed = true;
126126
}
127127

128128
// Restore FRM if needed.

0 commit comments

Comments
 (0)