[TargetInstrInfo] add override function setSpecialOperandAttr - NFC

This commit is contained in:
Chen Zheng 2020-05-18 21:20:52 -04:00
parent 4a69eda6f3
commit ddcb3cf213
2 changed files with 10 additions and 0 deletions

View File

@ -1101,6 +1101,8 @@ public:
MachineInstr &NewMI1,
MachineInstr &NewMI2) const {}
virtual void setSpecialOperandAttr(MachineInstr &MI, uint16_t Flags) const {}
/// Return true when a target supports MachineCombiner.
virtual bool useMachineCombiner() const { return false; }

View File

@ -245,6 +245,14 @@ void PPCInstrInfo::setSpecialOperandAttr(MachineInstr &OldMI1,
NewMI2.clearFlag(MachineInstr::MIFlag::IsExact);
}
void PPCInstrInfo::setSpecialOperandAttr(MachineInstr &MI,
uint16_t Flags) const {
MI.setFlags(Flags);
MI.clearFlag(MachineInstr::MIFlag::NoSWrap);
MI.clearFlag(MachineInstr::MIFlag::NoUWrap);
MI.clearFlag(MachineInstr::MIFlag::IsExact);
}
// This function does not list all associative and commutative operations, but
// only those worth feeding through the machine combiner in an attempt to
// reduce the critical path. Mostly, this means floating-point operations,