Skip to content

Commit f711892

Browse files
committed
cmd/compile/internal: stop lowering OpConvert on riscv64
Lowering for OpConvert was removed for all architectures in CL#108496, prior to the riscv64 port being upstreamed. Remove lowering of OpConvert on riscv64, which brings it inline with all other architectures. This results in 1,600+ instructions being removed from the riscv64 go binary. Change-Id: Iaaf1f8b397875926604048b66ad8ac91a98c871e Reviewed-on: https://go-review.googlesource.com/c/go/+/533335 Run-TryBot: Joel Sing <[email protected]> Reviewed-by: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 561bf04 commit f711892

File tree

5 files changed

+1
-26
lines changed

5 files changed

+1
-26
lines changed

src/cmd/compile/internal/riscv64/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
193193
// input args need no code
194194
case ssa.OpPhi:
195195
ssagen.CheckLoweredPhi(v)
196-
case ssa.OpCopy, ssa.OpRISCV64MOVconvert, ssa.OpRISCV64MOVDreg:
196+
case ssa.OpCopy, ssa.OpRISCV64MOVDreg:
197197
if v.Type.IsMemory() {
198198
return
199199
}

src/cmd/compile/internal/ssa/_gen/RISCV64.rules

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,6 @@
397397
(ADD <ptr.Type> ptr (MOVDconst [s-moveSize(t.Alignment(), config)]))
398398
mem)
399399

400-
(Convert ...) => (MOVconvert ...)
401-
402400
// Checks
403401
(IsNonNil ...) => (SNEZ ...)
404402
(IsInBounds ...) => (Less64U ...)

src/cmd/compile/internal/ssa/_gen/RISCV64Ops.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,6 @@ func init() {
233233
{name: "SLTU", argLength: 2, reg: gp21, asm: "SLTU"}, // arg0 < arg1, unsigned, result is 0 or 1
234234
{name: "SLTIU", argLength: 1, reg: gp11, asm: "SLTIU", aux: "Int64"}, // arg0 < auxint, unsigned, result is 0 or 1
235235

236-
// MOVconvert converts between pointers and integers.
237-
// We have a special op for this so as to not confuse GC
238-
// (particularly stack maps). It takes a memory arg so it
239-
// gets correctly ordered with respect to GC safepoints.
240-
{name: "MOVconvert", argLength: 2, reg: gp11, asm: "MOV"}, // arg0, but converted to int/ptr as appropriate; arg1=mem
241-
242236
// Round ops to block fused-multiply-add extraction.
243237
{name: "LoweredRound32F", argLength: 1, reg: fp11, resultInArg0: true},
244238
{name: "LoweredRound64F", argLength: 1, reg: fp11, resultInArg0: true},

src/cmd/compile/internal/ssa/opGen.go

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/compile/internal/ssa/rewriteRISCV64.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)