Skip to content

Commit 9b3e2f5

Browse files
authored
X86: Elide use of RegClassByHwMode in some ptr_rc_tailcall uses (llvm#159874)
Different instructions are used for the 32-bit and 64-bit cases anyway, so directly use the concrete register class in the instruction.
1 parent 07def27 commit 9b3e2f5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Target/X86/X86InstrCompiler.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,8 +1324,8 @@ def : Pat<(X86imp_call (i64 tglobaladdr:$dst)),
13241324
// %r11. This happens when calling a vararg function with 6 arguments.
13251325
//
13261326
// Match an X86tcret that uses less than 7 volatile registers.
1327-
def : Pat<(X86tcret ptr_rc_tailcall:$dst, timm:$off),
1328-
(TCRETURNri ptr_rc_tailcall:$dst, timm:$off)>,
1327+
def : Pat<(X86tcret GR32_TC:$dst, timm:$off),
1328+
(TCRETURNri GR32_TC:$dst, timm:$off)>,
13291329
Requires<[Not64BitMode, IsNotHiPECCFunc, NotUseIndirectThunkCalls]>;
13301330

13311331
def : Pat<(X86tcret GR32:$dst, timm:$off),

llvm/lib/Target/X86/X86InstrControl.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1,
280280
isCodeGenOnly = 1, Uses = [ESP, SSP] in {
281281
def TCRETURNdi : PseudoI<(outs), (ins i32imm_brtarget:$dst, i32imm:$offset),
282282
[]>, Sched<[WriteJump]>;
283-
def TCRETURNri : PseudoI<(outs), (ins ptr_rc_tailcall:$dst, i32imm:$offset),
283+
def TCRETURNri : PseudoI<(outs), (ins GR32_TC:$dst, i32imm:$offset),
284284
[]>, Sched<[WriteJump]>;
285285

286286
def TCRETURN_HIPE32ri : PseudoI<(outs), (ins GR32:$dst, i32imm:$offset),
@@ -359,7 +359,7 @@ let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1,
359359
(ins i64i32imm_brtarget:$dst, i32imm:$offset),
360360
[]>, Sched<[WriteJump]>;
361361
def TCRETURNri64 : PseudoI<(outs),
362-
(ins ptr_rc_tailcall:$dst, i32imm:$offset),
362+
(ins GR64_TC:$dst, i32imm:$offset),
363363
[]>, Sched<[WriteJump]>;
364364
def TCRETURN_WIN64ri : PseudoI<(outs), (ins GR64_TCW64:$dst, i32imm:$offset),
365365
[]>, Sched<[WriteJump]>;

0 commit comments

Comments
 (0)