Skip to content

Commit c034c77

Browse files
Move PreferSmallerInstructions to AsmParser
1 parent 46bda4a commit c034c77

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

llvm/include/llvm/Target/Target.td

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,10 @@ class AsmParser {
15641564
// method shall be called for all operands as opposed to only those
15651565
// that have their own specified custom parsers.
15661566
bit CallCustomParserForAllOperands = false;
1567+
1568+
// PreferSmallerInstructions - Should the assembly matcher prefer the smaller
1569+
// instructions.
1570+
bit PreferSmallerInstructions = false;
15671571
}
15681572
def DefaultAsmParser : AsmParser;
15691573

@@ -1743,11 +1747,6 @@ class Target {
17431747
// setting hasExtraDefRegAllocReq and hasExtraSrcRegAllocReq to 1
17441748
// for all opcodes if this flag is set to 0.
17451749
int AllowRegisterRenaming = 0;
1746-
1747-
// PreferSmallerInstructions - Should the assembly matcher prefer the smaller
1748-
// instructions. 1 if the instruction set should sort by size,
1749-
// 0 otherwise.
1750-
bit PreferSmallerInstructions = 0;
17511750
}
17521751

17531752
//===----------------------------------------------------------------------===//

llvm/utils/TableGen/CodeGenTarget.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,6 @@ bool CodeGenTarget::getAllowRegisterRenaming() const {
332332
return TargetRec->getValueAsInt("AllowRegisterRenaming");
333333
}
334334

335-
bool CodeGenTarget::getPreferSmallerInstructions() const {
336-
return TargetRec->getValueAsBit("PreferSmallerInstructions");
337-
}
338-
339335
/// getAsmParser - Return the AssemblyParser definition for this target.
340336
///
341337
Record *CodeGenTarget::getAsmParser() const {
@@ -346,6 +342,10 @@ Record *CodeGenTarget::getAsmParser() const {
346342
return LI[AsmParserNum];
347343
}
348344

345+
bool CodeGenTarget::getPreferSmallerInstructions() const {
346+
return getAsmParser()->getValueAsBit("PreferSmallerInstructions");
347+
}
348+
349349
/// getAsmParserVariant - Return the AssemblyParserVariant definition for
350350
/// this target.
351351
///

0 commit comments

Comments
 (0)