This causes more inlining for rangefunc code.
The PAUTOHEAP case catches closure-passed-as-param
to function that returns a closure, that calls the
outer PPARAM.
Change-Id: I927cf2e1924ed2191e0ad8be9a1f2e793b6f2b38
Reviewed-on: https://go-review.googlesource.com/c/go/+/620220
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
}
}
}
- if name.Class == ir.PPARAM {
+ if name.Class == ir.PPARAM || name.Class == ir.PAUTOHEAP && name.IsClosureVar() {
extraCost = min(extraCost, inlineParamCallCost)
}
}