[llvm] 460e1bd - [X86][tablgen] Remove PointerLikeRegClass from isRegisterOperand b/c getRegOperandSize crashes for it. NFCI
Shengchen Kan via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 26 16:40:20 PDT 2022
Author: Shengchen Kan
Date: 2022-03-27T07:35:47+08:00
New Revision: 460e1bd66e5757be06efc5bbb5f686fd8c119a02
URL: https://github.com/llvm/llvm-project/commit/460e1bd66e5757be06efc5bbb5f686fd8c119a02
DIFF: https://github.com/llvm/llvm-project/commit/460e1bd66e5757be06efc5bbb5f686fd8c119a02.diff
LOG: [X86][tablgen] Remove PointerLikeRegClass from isRegisterOperand b/c getRegOperandSize crashes for it. NFCI
Added:
Modified:
llvm/utils/TableGen/X86FoldTablesEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/X86FoldTablesEmitter.cpp b/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
index 05e250d4a878e..eb52ebd736f71 100644
--- a/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
+++ b/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
@@ -272,8 +272,7 @@ static inline bool isNOREXRegClass(const Record *Op) {
static inline bool isRegisterOperand(const Record *Rec) {
return Rec->isSubClassOf("RegisterClass") ||
- Rec->isSubClassOf("RegisterOperand") ||
- Rec->isSubClassOf("PointerLikeRegClass");
+ Rec->isSubClassOf("RegisterOperand");
}
static inline bool isMemoryOperand(const Record *Rec) {
@@ -506,7 +505,10 @@ void X86FoldTablesEmitter::updateTables(const CodeGenInstruction *RegInstr,
for (unsigned i = RegOutSize, e = RegInstr->Operands.size(); i < e; i++) {
Record *RegOpRec = RegInstr->Operands[i].Rec;
Record *MemOpRec = MemInstr->Operands[i].Rec;
- if (isRegisterOperand(RegOpRec) && isMemoryOperand(MemOpRec)) {
+ // PointerLikeRegClass: For instructions like TAILJMPr, TAILJMPr64, TAILJMPr64_REX
+ if ((isRegisterOperand(RegOpRec) ||
+ RegOpRec->isSubClassOf("PointerLikeRegClass")) &&
+ isMemoryOperand(MemOpRec)) {
switch (i) {
case 0:
addEntryWithFlags(Table0, RegInstr, MemInstr, S, 0);
More information about the llvm-commits
mailing list