Skip to content

Commit 14d69cf

Browse files
s/spillable/foldable/
1 parent 9a607c2 commit 14d69cf

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

llvm/include/llvm/CodeGen/MachineInstr.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,9 +1364,10 @@ class MachineInstr
13641364
return getOpcode() == TargetOpcode::INLINEASM ||
13651365
getOpcode() == TargetOpcode::INLINEASM_BR;
13661366
}
1367-
/// Returns true if the memory operand can be folded. Does so by checking the
1368-
/// InlineAsm::Flag immediate operand at OpId - 1.
1369-
bool mayFoldInlineAsmMemOp(unsigned OpId) const;
1367+
/// Returns true if the register operand can be folded with a load or store
1368+
/// into a frame index. Does so by checking the InlineAsm::Flag immediate
1369+
/// operand at OpId - 1.
1370+
bool mayFoldInlineAsmRegOp(unsigned OpId) const;
13701371

13711372
bool isStackAligningInlineAsm() const;
13721373
InlineAsm::AsmDialect getInlineAsmDialect() const;

llvm/include/llvm/IR/InlineAsm.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class InlineAsm final : public Value {
293293
// Else:
294294
// Bits 29-16 - The register class ID to use for the operand. (RegClass)
295295
// Bit 30 - If the register is permitted to be spilled.
296-
// (RegMayBeSpilled)
296+
// (RegMayBeFolded)
297297
// Defaults to false "r", may be set for constraints like
298298
// "rm" (or "g").
299299
//
@@ -307,7 +307,7 @@ class InlineAsm final : public Value {
307307
using MatchedOperandNo = Bitfield::Element<unsigned, 16, 15>;
308308
using MemConstraintCode = Bitfield::Element<ConstraintCode, 16, 15, ConstraintCode::Max>;
309309
using RegClass = Bitfield::Element<unsigned, 16, 14>;
310-
using RegMayBeSpilled = Bitfield::Element<bool, 30, 1>;
310+
using RegMayBeFolded = Bitfield::Element<bool, 30, 1>;
311311
using IsMatched = Bitfield::Element<bool, 31, 1>;
312312

313313

@@ -428,15 +428,15 @@ class InlineAsm final : public Value {
428428
/// ("rm") vs ones it does not ("r"). This is because the inline asm may use
429429
/// instructions which don't support memory addressing modes for that
430430
/// operand.
431-
void setRegMayBeSpilled(bool B) {
431+
void setRegMayBeFolded(bool B) {
432432
assert((isRegDefKind() || isRegDefEarlyClobberKind() || isRegUseKind()) &&
433433
"Must be reg");
434-
Bitfield::set<RegMayBeSpilled>(Storage, B);
434+
Bitfield::set<RegMayBeFolded>(Storage, B);
435435
}
436-
bool getRegMayBeSpilled() const {
436+
bool getRegMayBeFolded() const {
437437
assert((isRegDefKind() || isRegDefEarlyClobberKind() || isRegUseKind()) &&
438438
"Must be reg");
439-
return Bitfield::get<RegMayBeSpilled>(Storage);
439+
return Bitfield::get<RegMayBeFolded>(Storage);
440440
}
441441
};
442442

llvm/lib/CodeGen/MachineInstr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,8 +1794,8 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
17941794

17951795
if ((F.isRegDefKind() || F.isRegDefEarlyClobberKind() ||
17961796
F.isRegUseKind()) &&
1797-
F.getRegMayBeSpilled()) {
1798-
OS << " spillable";
1797+
F.getRegMayBeFolded()) {
1798+
OS << " foldable";
17991799
}
18001800

18011801
OS << ']';
@@ -2533,7 +2533,7 @@ void MachineInstr::insert(mop_iterator InsertBefore,
25332533
}
25342534
}
25352535

2536-
bool MachineInstr::mayFoldInlineAsmMemOp(unsigned OpId) const {
2536+
bool MachineInstr::mayFoldInlineAsmRegOp(unsigned OpId) const {
25372537
assert(OpId && "expected non-zero operand id");
25382538
assert(isInlineAsm() && "should only be used on inline asm");
25392539

@@ -2546,6 +2546,6 @@ bool MachineInstr::mayFoldInlineAsmMemOp(unsigned OpId) const {
25462546

25472547
InlineAsm::Flag F(MD.getImm());
25482548
if (F.isRegUseKind() || F.isRegDefKind() || F.isRegDefEarlyClobberKind())
2549-
return F.getRegMayBeSpilled();
2549+
return F.getRegMayBeFolded();
25502550
return false;
25512551
}

llvm/lib/CodeGen/TargetInstrInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,8 @@ std::string TargetInstrInfo::createMIROperandComment(
16401640
OS << " tiedto:$" << TiedTo;
16411641

16421642
if ((F.isRegDefKind() || F.isRegDefEarlyClobberKind() || F.isRegUseKind()) &&
1643-
F.getRegMayBeSpilled())
1644-
OS << " spillable";
1643+
F.getRegMayBeFolded())
1644+
OS << " foldable";
16451645

16461646
return OS.str();
16471647
}

0 commit comments

Comments
 (0)