Skip to content

Commit 8b7a76a

Browse files
committed
[CodeGen] Rename isReallyTriviallyReMaterializable [nfc]
.. to isReMaterializableImpl. The "Really" naming has always been awkward, and we're working towards removing the "Trivial" part now, so go ehead and remove both pieces in a single rename. Note that this doesn't change any aspect of the current implementation; we still "mostly" only return instructions which are trivial (meaning no virtual register uses), but some targets do lie about that today.
1 parent ca2e8fc commit 8b7a76a

18 files changed

+26
-26
lines changed

llvm/include/llvm/CodeGen/MachineInstr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ class MachineInstr
12291229

12301230
/// Returns true if this instruction is a candidate for remat.
12311231
/// This flag is deprecated, please don't use it anymore. If this
1232-
/// flag is set, the isReallyTriviallyReMaterializable() method is called to
1232+
/// flag is set, the isReMaterializableImpl() method is called to
12331233
/// verify the instruction is really rematerializable.
12341234
bool isRematerializable(QueryType Type = AllInBundle) const {
12351235
// It's only possible to re-mat a bundle if all bundled instructions are

llvm/include/llvm/CodeGen/TargetInstrInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class LLVM_ABI TargetInstrInfo : public MCInstrInfo {
171171
return (MI.getOpcode() == TargetOpcode::IMPLICIT_DEF &&
172172
MI.getNumOperands() == 1) ||
173173
(MI.getDesc().isRematerializable() &&
174-
isReallyTriviallyReMaterializable(MI));
174+
isReMaterializableImpl(MI));
175175
}
176176

177177
/// Given \p MO is a PhysReg use return if it can be ignored for the purpose
@@ -198,7 +198,7 @@ class LLVM_ABI TargetInstrInfo : public MCInstrInfo {
198198
/// predicate must return false if the instruction has any side effects other
199199
/// than producing a value, or if it requres any address registers that are
200200
/// not always available.
201-
virtual bool isReallyTriviallyReMaterializable(const MachineInstr &MI) const;
201+
virtual bool isReMaterializableImpl(const MachineInstr &MI) const;
202202

203203
/// This method commutes the operands of the given machine instruction MI.
204204
/// The operands to be commuted are specified by their indices OpIdx1 and

llvm/include/llvm/MC/MCInstrDesc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ class MCInstrDesc {
532532
/// Returns true if this instruction is a candidate for remat. This
533533
/// flag is only used in TargetInstrInfo method isTriviallyRematerializable.
534534
///
535-
/// If this flag is set, the isReallyTriviallyReMaterializable() method is
535+
/// If this flag is set, the isReMaterializableImpl() method is
536536
/// called to verify the instruction is really rematerializable.
537537
bool isRematerializable() const {
538538
return Flags & (1ULL << MCID::Rematerializable);

llvm/lib/CodeGen/TargetInstrInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ MachineTraceStrategy TargetInstrInfo::getMachineCombinerTraceStrategy() const {
15901590
return MachineTraceStrategy::TS_MinInstrCount;
15911591
}
15921592

1593-
bool TargetInstrInfo::isReallyTriviallyReMaterializable(
1593+
bool TargetInstrInfo::isReMaterializableImpl(
15941594
const MachineInstr &MI) const {
15951595
const MachineFunction &MF = *MI.getMF();
15961596
const MachineRegisterInfo &MRI = MF.getRegInfo();

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static bool canRemat(const MachineInstr &MI) {
124124
return false;
125125
}
126126

127-
bool SIInstrInfo::isReallyTriviallyReMaterializable(
127+
bool SIInstrInfo::isReMaterializableImpl(
128128
const MachineInstr &MI) const {
129129

130130
if (canRemat(MI)) {
@@ -145,7 +145,7 @@ bool SIInstrInfo::isReallyTriviallyReMaterializable(
145145
return true;
146146
}
147147

148-
return TargetInstrInfo::isReallyTriviallyReMaterializable(MI);
148+
return TargetInstrInfo::isReMaterializableImpl(MI);
149149
}
150150

151151
// Returns true if the scalar result of a VALU instruction depends on exec.

llvm/lib/Target/AMDGPU/SIInstrInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class SIInstrInfo final : public AMDGPUGenInstrInfo {
244244
return ST;
245245
}
246246

247-
bool isReallyTriviallyReMaterializable(const MachineInstr &MI) const override;
247+
bool isReMaterializableImpl(const MachineInstr &MI) const override;
248248

249249
bool isIgnorableUse(const MachineOperand &MO) const override;
250250

llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6510,14 +6510,14 @@ bool ARMBaseInstrInfo::shouldOutlineFromFunctionByDefault(
65106510
return Subtarget.isMClass() && MF.getFunction().hasMinSize();
65116511
}
65126512

6513-
bool ARMBaseInstrInfo::isReallyTriviallyReMaterializable(
6513+
bool ARMBaseInstrInfo::isReMaterializableImpl(
65146514
const MachineInstr &MI) const {
65156515
// Try hard to rematerialize any VCTPs because if we spill P0, it will block
65166516
// the tail predication conversion. This means that the element count
65176517
// register has to be live for longer, but that has to be better than
65186518
// spill/restore and VPT predication.
65196519
return (isVCTP(&MI) && !isPredicated(MI)) ||
6520-
TargetInstrInfo::isReallyTriviallyReMaterializable(MI);
6520+
TargetInstrInfo::isReMaterializableImpl(MI);
65216521
}
65226522

65236523
unsigned llvm::getBLXOpcode(const MachineFunction &MF) {

llvm/lib/Target/ARM/ARMBaseInstrInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ class ARMBaseInstrInfo : public ARMGenInstrInfo {
479479
MachineInstr *canFoldIntoMOVCC(Register Reg, const MachineRegisterInfo &MRI,
480480
const TargetInstrInfo *TII) const;
481481

482-
bool isReallyTriviallyReMaterializable(const MachineInstr &MI) const override;
482+
bool isReMaterializableImpl(const MachineInstr &MI) const override;
483483

484484
private:
485485
/// Modeling special VFP / NEON fp MLA / MLS hazards.

llvm/lib/Target/LoongArch/LoongArchInstrInfo.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ let Predicates = [IsLA64] in {
943943
def ADD_D : ALU_3R<0x00108000>;
944944
def SUB_D : ALU_3R<0x00118000>;
945945
// ADDI_D isn't always rematerializable, but isReMaterializable will be used as
946-
// a hint which is verified in isReallyTriviallyReMaterializable.
946+
// a hint which is verified in isReMaterializableImpl.
947947
// See LoongArchInstrInfo::isAsCheapAsAMove for more details.
948948
let isReMaterializable = 1, isAsCheapAsAMove = 1 in {
949949
def ADDI_D : ALU_2RI12<0x02c00000, simm12_addlike>;

llvm/lib/Target/PowerPC/PPCInstrInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ Register PPCInstrInfo::isLoadFromStackSlot(const MachineInstr &MI,
10751075

10761076
// For opcodes with the ReMaterializable flag set, this function is called to
10771077
// verify the instruction is really rematable.
1078-
bool PPCInstrInfo::isReallyTriviallyReMaterializable(
1078+
bool PPCInstrInfo::isReMaterializableImpl(
10791079
const MachineInstr &MI) const {
10801080
switch (MI.getOpcode()) {
10811081
default:
@@ -1112,7 +1112,7 @@ bool PPCInstrInfo::isReallyTriviallyReMaterializable(
11121112
case PPC::DMXXSETACCZ:
11131113
return true;
11141114
}
1115-
return TargetInstrInfo::isReallyTriviallyReMaterializable(MI);
1115+
return TargetInstrInfo::isReMaterializableImpl(MI);
11161116
}
11171117

11181118
Register PPCInstrInfo::isStoreToStackSlot(const MachineInstr &MI,

0 commit comments

Comments
 (0)