From: Guoqi Chen Date: Tue, 28 Jun 2022 07:46:00 +0000 (+0800) Subject: cmd/compile: add missing tail calls flag for linux/loong64 X-Git-Tag: go1.20rc1~504 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8a9e2d9d49a9d5234b52a0360ed6a0f91753c291;p=gostls13.git cmd/compile: add missing tail calls flag for linux/loong64 Set the value of the variable tailCall to true and prevent allocating or clobber the linker register. Change-Id: I4ec19c67056cb99196911aa7c0054be89ab7eb8d Reviewed-on: https://go-review.googlesource.com/c/go/+/414954 Reviewed-by: Cherry Mui Reviewed-by: David Chase Run-TryBot: Wayne Zuo Reviewed-by: WANG Xuerui --- diff --git a/src/cmd/compile/internal/ssa/_gen/LOONG64Ops.go b/src/cmd/compile/internal/ssa/_gen/LOONG64Ops.go index 2cc0f975a1..5a84529192 100644 --- a/src/cmd/compile/internal/ssa/_gen/LOONG64Ops.go +++ b/src/cmd/compile/internal/ssa/_gen/LOONG64Ops.go @@ -270,7 +270,7 @@ func init() { // function calls {name: "CALLstatic", argLength: 1, reg: regInfo{clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true}, // call static function aux.(*obj.LSym). arg0=mem, auxint=argsize, returns mem - {name: "CALLtail", argLength: 1, reg: regInfo{clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true}, // tail call static function aux.(*obj.LSym). arg0=mem, auxint=argsize, returns mem + {name: "CALLtail", argLength: 1, reg: regInfo{clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true, tailCall: true}, // tail call static function aux.(*obj.LSym). arg0=mem, auxint=argsize, returns mem {name: "CALLclosure", argLength: 3, reg: regInfo{inputs: []regMask{gpsp, buildReg("R29"), 0}, clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true}, // call function via closure. arg0=codeptr, arg1=closure, arg2=mem, auxint=argsize, returns mem {name: "CALLinter", argLength: 2, reg: regInfo{inputs: []regMask{gp}, clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true}, // call fn by pointer. arg0=codeptr, arg1=mem, auxint=argsize, returns mem diff --git a/src/cmd/compile/internal/ssa/opGen.go b/src/cmd/compile/internal/ssa/opGen.go index 9087815d72..994a0c9464 100644 --- a/src/cmd/compile/internal/ssa/opGen.go +++ b/src/cmd/compile/internal/ssa/opGen.go @@ -24107,6 +24107,7 @@ var opcodeTable = [...]opInfo{ argLen: 1, clobberFlags: true, call: true, + tailCall: true, reg: regInfo{ clobbers: 4611686018426339320, // R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 R17 R18 R19 R20 g R23 R24 R25 R26 R27 R28 R29 R31 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F20 F21 F22 F23 F24 F25 F26 F27 F28 F29 F30 F31 },