aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal
AgeCommit message (Collapse)Author
2026-03-30all: fix some minor issues in the commentscuishuang
Change-Id: If6c304efac7a46a9718cdc63ded3d98a26a3a831 Reviewed-on: https://go-review.googlesource.com/c/go/+/760700 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Neal Patel <nealpatel@google.com> Reviewed-by: Fred Sauer <fredsa@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-03-30cmd/compile/internal/noder: swap use of TypeList for []TypeMark Freeman
The noder will need to manipulate type argument lists. Because it is outside types2, it needs exported APIs to do so, which then must also be reflected in go/types. We don't want APIs which only the noder cares about to be surfaced so broadly. It might be better for the noder to use its own representation for type lists; a []Type is fine for now. Change-Id: Ia0917a6d26e00218fc9ccfd443d8d07224b1db5d Reviewed-on: https://go-review.googlesource.com/c/go/+/760360 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-03-30cmd/compile/internal/noder: add is[Concrete|Generic]Method helpersMark Freeman
The isGenericMethod helper will be necessary for upcoming changes to UIR, though it's not currently used. Since all generic methods are concrete methods, we also define the isConcreteMethod helper to illustrate the subset relationship between the two classes of methods. We use this helper for encoding method dictionaries. Change-Id: Ib7cdd7224fc733553726c8f86c0fe59ad60bff67 Reviewed-on: https://go-review.googlesource.com/c/go/+/759781 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-03-30cmd/compile/internal/devirtualize: improve debug logsMateusz Poliwczak
Change-Id: Ie8d74d0968c3dfa6fe3454f1d3fdf13d6a6a6944 Reviewed-on: https://go-review.googlesource.com/c/go/+/760162 Auto-Submit: Mateusz Poliwczak <mpoliwczak34@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-30cmd/compile/internal/devirtualize: use pointer identity for type comparisonMateusz Poliwczak
Fixes #78404 Change-Id: I6adc1fb42ad6a3acce21333c6819d0796a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/760161 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2026-03-27cmd/compile/internal/ssa: prove support induction variable pairYoulin Feng
We have two induction variables i and j in the following loop: for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { // loop body } This CL enables the prove pass to handle cases where one if block uses two induction variables. Updates #45078 Change-Id: I8b8dc8b7b2d160a796dab1d1e29a00ef4e8e8157 Reviewed-on: https://go-review.googlesource.com/c/go/+/757700 Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-27cmd/compile: use prove to remove no-op OrsJorropo
This is hit 3 times (unique by LOC) when building the std. Change-Id: Ic1fc7b60a129e73470d9bc4f603f4be12d154b0f Reviewed-on: https://go-review.googlesource.com/c/go/+/750342 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-03-27cmd/compile: remove 68857 And flowLimit workaround in proveJorropo
Change-Id: Id8baeb89e6e11a01d53cd63c665f0b2966f50392 Reviewed-on: https://go-review.googlesource.com/c/go/+/750341 Reviewed-by: Mark Freeman <markfreeman@google.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-27cmd/compile: use prove to remove no-op AndsJorropo
This is hit 308 times (unique by LOC) when building the std. There are many hits in defer generated code. My original intent was to optimize cryptographic code that uses And to implement modulus by a power of two but the number is always smaller than the modulus, it also works there but there (unsurprisingly) far fewer hits. Change-Id: Ia7a9a57099b98de966673c6e8231ef09f7c80964 Reviewed-on: https://go-review.googlesource.com/c/go/+/750200 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-26cmd/link: group gcmask symbols, move them to noptrbssIan Lance Taylor
Also take them out of the symbol table. A new symbol runtime.gcmask.* marks where they start in BSS, and can be used to find them if anybody cares. Also stop checking for gcprog symbols that we no longer define. Change-Id: I4060d8e9350c20568f020172caacd0439337cd2d Reviewed-on: https://go-review.googlesource.com/c/go/+/729880 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org>
2026-03-26cmd/compile/internal/noder: set hasShape for shaped functionsMark Freeman
A signature with a shape will be overwritten using shapeSig, but it arguably still has a shape because it's using a shaped dictionary. This mimics the approach for ObjType. Change-Id: I4646cd73129606772a9218662de76a37217366b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/759721 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-03-26cmd/compile/internal/noder: shapeSig must return shaped signaturesMark Freeman
Suppose a signature f[P any]() shaped to f[go.shape.int](). This function does not flag f[go.shape.int]() as having a shape because it does not mention a shaped type in its parameter or return fields. This doesn't seem right. Change-Id: I87c4e3b259328b7d27ff0a98d65ed400b4895a69 Reviewed-on: https://go-review.googlesource.com/c/go/+/759660 Auto-Submit: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-03-26cmd/compile: on ARM64 merge SRA into TBZ & TBNZJorropo
Change-Id: I9596dbca8991c93c7543d10dc1b155056dfa7db3 Reviewed-on: https://go-review.googlesource.com/c/go/+/759500 Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@google.com>
2026-03-26cmd/compile: on ARM64 merge ROR into TBZ & TBNZJorropo
Change-Id: Ib37b35dfff6236c59c0242c3b7d979c95aefbb8b Reviewed-on: https://go-review.googlesource.com/c/go/+/750321 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
2026-03-26cmd/compile: on ARM64 merge shifts into TBZ & TBNZJorropo
Change-Id: I4dff3ba1462848f408257cbadedf202e62d1ea69 Reviewed-on: https://go-review.googlesource.com/c/go/+/750320 Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2026-03-26cmd/compile: skip incomplete types in needWrapperCuong Manh Le
A recursive pointer type *T may still be a TFORW when the compiler determines if method wrappers are needed. This leads to an incorrect decision and triggers an internal compiler error. Fix this by skipping incomplete types during the method wrapper generation check. Fixes #78295 Change-Id: I4005e525e9b076c6656aed5419283c0418edcac6 Reviewed-on: https://go-review.googlesource.com/c/go/+/758922 Reviewed-by: Jakub Ciolek <jakub@ciolek.dev> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-03-26cmd/compile: do not invert loops that would overflow or underflowJorropo
On the final iteration we need space below start (which becomes end) such that i-step does not overflow or underflow. In other words the code used to assume that the last time the loop header execute `start < i - step` (or `<=`, `>` `>=` based on the loop) is always false. And it seems correct since by definition the only way for it to be the last's loop header execution is when the condition becomes false. However here is an example with uint (even tho the code doesn't already support them) to make things simpler: start = 1 i = 2 step = 100 We do 2 - 100 which should give us 1 < -98 == false breaking the loop; Instead we get 18446744073709551518 which gives 1 < 18446744073709551518 == true which keeps the loop going. This patch fixes this issue by ensuring that in the last execution of a loop header the induction variable does not underflow or overflow. Fixes #78303 Change-Id: I64e8e8592b023d79fdbc7f1598d584726ed601f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/758801 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Jakub Ciolek <jakub@ciolek.dev> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-26cmd/compile: fix missing walk for OAS2RECV nodeCuong Manh Le
When channel receive operator is used in the context that requires conversion to destination type, there's an implicit conversion operator inserted by typecheck. This typecheck-ed node is un-walked, then passing to the backend as-is, causing the ICE. Fixes #78313 Change-Id: Ibbc70cbd2d8069cc7cf81934406aa68c4da2686a Reviewed-on: https://go-review.googlesource.com/c/go/+/758660 Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Jakub Ciolek <jakub@ciolek.dev> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-25cmd/compile: preserve variadic signature on range-over-funcCuong Manh Le
When rewriting range-over-func loops, copy the variadic bit from the original function type into the synthesized body closure's type info. This keeps the generated closure signature aligned with the source function and avoids losing variadic-ness during rewrite. Fixes #78314 Change-Id: I4b5f4628e8c8c14d4ff89dd6b996837264c5cb61 Reviewed-on: https://go-review.googlesource.com/c/go/+/758041 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jakub Ciolek <jakub@ciolek.dev> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-03-25cmd/compile: ppc64 fold (x+x)<<c into x<<(c+1)Jayanth Krishnamurthy jayanth.krishnamurthy@ibm.com
On ppc64/ppc64le, rewrite (x + x) << c to x << (c+1) for constant shifts. This removes an ADD, shortens the dependency chain, and reduces code size. Add rules for both 64-bit (SLDconst) and 32-bit (SLWconst), and extend test/codegen/shift.go with ppc64x checks to assert a single SLD/SLW and forbid ADD. Aligns ppc64 with other architectures that already assert similar codegen in shift.go. Change-Id: Ie564afbb029a5bd48887b82b0c455ca1dddd5508 Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-ppc64_power8,gotip-linux-ppc64le_power8,gotip-linux-ppc64le_power9,gotip-linux-ppc64le_power10 Reviewed-on: https://go-review.googlesource.com/c/go/+/712000 Reviewed-by: Archana Ravindar <aravinda@redhat.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-03-24cmd/compile: handle string literals in FIPS mode consistentlyCherry Mui
There are different code paths for compiling a composite literal, e.g. small vs. large, fully static vs. partially static. Following CL 755600, we need to apply the condition for string literals in FIPS mode consistently in all places. Enhance the test to check that not only does the code compile, the same code inside and outside of FIPS mode produce the same result. If the condition is not consistent in the compiler, it may compile the code, but not all the fields are actually assigned. Fixes #78173. Change-Id: Icaf673bd4798d4312d86c39b147d7fd33b9dae2c Reviewed-on: https://go-review.googlesource.com/c/go/+/756260 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
2026-03-24internal/abi, cmd/link: centralize type descriptor size calculationJake Bailey
The linker hardcoded the calculation for some types, which caused me some annoyance in CL 711560 because I didn't know it needed to be updated (and it took me a long time to find the hardcoded value). Move this calculation over to the abi package, similar to other funcs. Then update rttype.Init to also check that the function works, like again like other funcs in this package. This actually caught a latent bug; decodetypeMethods was incorrectly calculating the size for the Interface case! Change-Id: Iaa66055061b68ec93c9912ae6aa6e605260f52a8 Reviewed-on: https://go-review.googlesource.com/c/go/+/749961 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-03-24internal/runtime/maps: add GOEXPERIMENT=mapsplitgroup for KKKKVVVV slot orderJake Bailey
Map groups are currently: type group struct { ctrl uint64 slots [8]slot } type slot struct { key K elem E } If the element type is struct{}, the slot will be padded so that the address of the elem is unique rather than pointing outside the alloc. This has the effect of map[K]struct{} wasting space due to the extra byte and padding, making it no better than map[K]bool. This CL changes the group layout to instead place keys and elems together, as they used to be before swiss maps: type group struct { ctrl uint64 keys [8]K elems [8]V } This is an alternative to CL 701976, which I suspect will have better performance. Keys placed together should lead to better cache behavior, at the cost of more expensive elem lookups, since the elems are not a fixed offset from their keys. This change is locked behind GOEXPERIMENT=mapsplitgroup. Updates #70835 Updates #71368 Change-Id: Ide8d1406ae4ab636f86edc40e0640cc80653197c Reviewed-on: https://go-review.googlesource.com/c/go/+/711560 Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-03-20Revert "runtime, cmd/compile: use preemptible memclr for large pointer-free ↵Michael Pratt
clears" This reverts CL 750480. Reason: Adding preemptible memclrNoHeapPointers exposes existing unsafe use of notInHeapSlice, causing crashes. Revert the memclr stack until the underlying issue is fixed. We keep the test added in CL 755942, which is useful regardless. For #78254. Change-Id: I8be3f9a20292b7f294e98e74e5a86c6a204406ae Reviewed-on: https://go-review.googlesource.com/c/go/+/757343 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
2026-03-20cmd/compile/internal/noder: don't shoot oneself (fix silly mistake)Robert Griesemer
When reading multiple promoted fields in a struct literal from UIR, don't overwrite the (top-level) struct literal type needed for the next field. Fixes #78262. For #9859. Change-Id: Ifac64537bebcb7dbb79a6173d0cd032cbf0b8ed8 Reviewed-on: https://go-review.googlesource.com/c/go/+/757225 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
2026-03-20Revert "cmd/compile: don't call memclrNoHeapPointersPreemptible from nosplit ↵Michael Pratt
functions" This reverts CL 756123. Reason: Adding preemptible memclrNoHeapPointers exposes existing unsafe use of notInHeapSlice, causing crashes. Revert the memclr stack until the underlying issue is fixed. For #78254. Change-Id: Ic5e6eee8e87f219e06bec8610fcc85cd52d634b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/757341 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-20cmd/compile: on arm64 pair a load with a load in a subsequent blockKeith Randall
Look into the following block(s) for a load that can be paired with the load we're trying to pair up. This particularly helps the generated equality functions. Instead of doing MOVD x(R0), R2 MOVD x(R1), R3 CMP R2, R3 BNE noteq MOVD x+8(R0), R2 MOVD x+8(R1), R3 CMP R2, R3 BNE noteq we do LDP x(R0), (R2, R4) LDP x(R1), (R3, R5) CMP R2, R3 BNE noteq CMP R4, R5 BNE noteq Removes 5296 bytes of code from cmd/go. Change-Id: I6368686892ac944783c8b07ed7252126d1ef4031 Reviewed-on: https://go-review.googlesource.com/c/go/+/740741 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-20cmd/compile: elide sign-extend after zero-extend for wasmGeorge Adams
Add rules to eliminate sign-extension of values that have already been zero-extended from fewer bits via an I64And mask: (I64Extend32S x:(I64And _ (I64Const [c]))) && c >= 0 && int64(int32(c)) == c => x (I64Extend16S x:(I64And _ (I64Const [c]))) && c >= 0 && int64(int16(c)) == c => x (I64Extend8S x:(I64And _ (I64Const [c]))) && c >= 0 && int64(int8(c)) == c => x When a value has been masked to fit within the non-negative range of the sign-extension width, the upper bits are already zero and sign- extending is a no-op. For example, (I64Extend32S (I64And x 0xff)) can be elided because 0xff fits in a signed int32, so bit 31 is guaranteed to be zero and sign-extending from 32 bits is identity. Cq-Include-Trybots: luci.golang.try:gotip-wasip1-wasm_wasmtime,gotip-wasip1-wasm_wazero Change-Id: Ia54d67358756e47ca7635a6a8ca4beadb003820a Reviewed-on: https://go-review.googlesource.com/c/go/+/756320 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org>
2026-03-20cmd/compile: (mips64x) optimize float32(abs|sqrt64(float64(x)))Julian Zhu
Absorb unnecessary conversion between float32 and float64 if both src and dst are 32 bit. Ref: CL 733621 Updates #75463 Change-Id: I439f92aa3d940fa4979e76845c0893e43bf584af Reviewed-on: https://go-review.googlesource.com/c/go/+/739520 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Joel Sing <joel@sing.id.au>
2026-03-19cmd/compile: enable promoted field selectors as keys in struct literalsRobert Griesemer
Switch the generated UIR version from V2 to V3. Adjust cmd/compile/internal/types to accept promoted field selectors in composite literals. Fixes #9859. Change-Id: Ie314e28567cfa6cf4c9e962a07b32dd05b06bf5e Reviewed-on: https://go-review.googlesource.com/c/go/+/755740 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Mark Freeman <markfreeman@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2026-03-19cmd/compile: skip race detector test failure for unsupported VMAGuoqi Chen
Fixes #78219 Updates #77597 Change-Id: I021df668bfc18081e71faaab2e4bad607873bf4d Reviewed-on: https://go-review.googlesource.com/c/go/+/756780 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Meidan Li <limeidan@loongson.cn> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-03-19cmd/compile/internal/noder: encode promoted struct fields for composite ↵Robert Griesemer
literals in UIR This change requires an encoding format change for struct literals. Introduce a new UIR version (V3) and use the opportunity to encode all composite literals more compactly: specifically, when we know that (composite literal) keys are always present, avoid encoding a bool value for each key. Do not yet enable the new format. For #9859. Change-Id: Ic6dc9adb1aa494e923eadaf578f8cfc61efd5ea4 Reviewed-on: https://go-review.googlesource.com/c/go/+/754664 Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-03-19go/types, types2: allow promoted field names as keys in struct literalsRobert Griesemer
For #9859. Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873 Reviewed-on: https://go-review.googlesource.com/c/go/+/751702 Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-03-18cmd/compile: simplify the implementation of LoweredMoveLoop on loong64Guoqi Chen
Removes 632 instructions from the go binary on loong64. before after delta asm 560709 560673 -36 cgo 478565 478545 -20 compile 2883165 2883089 -76 cover 528213 528189 -24 fix 848253 848249 -4 link 725957 725901 -56 preprofile 240245 240241 -4 vet 821569 821569 0 go 1633241 1632833 -408 gofmt 318281 318277 -4 Change-Id: I4eebdc5261507a9c9e3a053a417b0bc41a2727da Reviewed-on: https://go-review.googlesource.com/c/go/+/755880 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Meidan Li <limeidan@loongson.cn>
2026-03-18cmd/link: modify the register used in trampolinelimeidan
R30 is the callee's saved register; using it requires saving and then restoring. Therefore, we replace it with a register saved by the caller. R4~R19 are argument registers on loong64, and R20 is the only remaining usable caller saved register. To use R20 in trampoline, we modified the registers used by the LoweredMove/LoweredMoveLoop operations (originally using r20 and r21, now changed to R23 and R24). Change-Id: Ie7bba0caa30a764a45bcb47635c35c829036c5a2 Reviewed-on: https://go-review.googlesource.com/c/go/+/726140 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: abner chenc <chenguoqi@loongson.cn> Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-03-18cmd/compile: allow multiple induction variables in one block in proveYoulin Feng
In this CL, the restriction that each block can only have one induction variable has been removed. This reduces missed optimizations. Fixes #76269 Change-Id: I14043182a40cc7887c5b6d9c1a5df8ea3a1bfedc Reviewed-on: https://go-review.googlesource.com/c/go/+/719881 Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
2026-03-18cmd/compile: allow halt flag to run concurrentlyDaniel Morsing
During the investigation for #78081, I found it helpful to use the -h flag to get a compiler core dump. I don't see any reason why it would need to clamp concurrency down. We have pretty good support for not interleaving log lines and if people really need it, they can always pass -c=1. Change-Id: Ic6425fc0da63e7ac42e0821f3d40ec4c6a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/756321 Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Daniel Morsing <daniel.morsing@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com>
2026-03-17cmd/compile: simplify the implementation of LoweredZeroLoop on loong64Guoqi Chen
Removes 6484 instructions from the go binary on loong64. before after delta asm 561517 561225 -292 cgo 480929 480493 -436 compile 2887121 2886277 -844 cover 530429 530125 -304 fix 851649 851093 -556 link 728361 727813 -548 preprofile 240713 240545 -168 vet 824869 824297 -572 go 1638645 1636053 -2592 gofmt 320213 320041 -172 Change-Id: I15da6e94a4166aed03373657fa4785063aa32f35 Reviewed-on: https://go-review.googlesource.com/c/go/+/754000 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Meidan Li <limeidan@loongson.cn>
2026-03-17cmd/compile: don't call memclrNoHeapPointersPreemptible from nosplit functionsKeith Randall
That function will allow preemption, which could subsequently allow for a stack copy (from shrinking). We can't let that happen inside a nosplit function. Update #78081 Change-Id: I12e77b50bbdcdd1e08e505a863b13cd9e1f814ee Reviewed-on: https://go-review.googlesource.com/c/go/+/756123 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Keith Randall <khr@golang.org>
2026-03-17go/types, types2: handle unconstrained type parameters correctly in a few placesRobert Griesemer
When iterating over a type set via a range clause, am unconstrained type set produces a single (nil, nil) result. This was not properly accounted for in a few places: - In the code for the append and copy built-in, handle the (nil, nil) case. - Likewise, in NewSignatureType, panic with the correct (string) error in this case. Check all remaining places where we iterate over type sets with range for correctness. Fixes #78163. Change-Id: If0f33f43dad59b4b5ef4c310f80522c25c6e251f Reviewed-on: https://go-review.googlesource.com/c/go/+/755941 Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Mark Freeman <markfreeman@google.com> Auto-Submit: Robert Griesemer <gri@google.com>
2026-03-17cmd/compile: use 128-bit arm64 vector ops for Move expansionAlexander Musman
Update Move rewrite rules to use FMOVQload/store and FLDPQ/FSTPQ for medium-sized copies (16-64 bytes). This generates fewer and wider instructions than the previous approach using LDP/STP pairs. Executable Base .text go1 Change ---------------------------------------------------- asm 2112308 2105732 -0.31% cgo 1826132 1823172 -0.16% compile 10474868 10460644 -0.14% cover 1990036 1985748 -0.22% fix 3234116 3226340 -0.24% link 2702628 2695316 -0.27% preprofile 947652 947028 -0.07% vet 3140964 3133524 -0.24% Performance effect on OrangePi 6 plus: │ orig.out │ movq.out │ │ sec/op │ sec/op vs base │ CopyFat16 0.4711n ± 0% 0.3852n ± 0% -18.23% (p=0.000 n=10) CopyFat17 0.7705n ± 0% 0.7705n ± 0% ~ (p=0.984 n=10) CopyFat18 0.7703n ± 0% 0.7703n ± 0% ~ (p=0.771 n=10) CopyFat19 0.7703n ± 0% 0.7703n ± 0% ~ (p=0.637 n=10) CopyFat20 0.7703n ± 0% 0.7704n ± 0% ~ (p=0.103 n=10) CopyFat21 0.7703n ± 0% 0.7708n ± 0% ~ (p=0.505 n=10) CopyFat22 0.7704n ± 0% 0.7705n ± 0% ~ (p=0.589 n=10) CopyFat23 0.7703n ± 0% 0.7703n ± 0% ~ (p=0.347 n=10) CopyFat24 0.7704n ± 0% 0.7703n ± 0% ~ (p=0.383 n=10) CopyFat25 0.8385n ± 0% 0.6589n ± 0% -21.41% (p=0.000 n=10) CopyFat26 0.8386n ± 0% 0.6590n ± 0% -21.42% (p=0.000 n=10) CopyFat27 0.8385n ± 0% 0.6590n ± 0% -21.41% (p=0.000 n=10) CopyFat28 0.8386n ± 0% 0.6571n ± 0% -21.65% (p=0.000 n=10) CopyFat29 0.8385n ± 0% 0.6590n ± 0% -21.41% (p=0.000 n=10) CopyFat30 0.8387n ± 0% 0.6591n ± 0% -21.42% (p=0.000 n=10) CopyFat31 0.8385n ± 0% 0.6589n ± 0% -21.42% (p=0.000 n=10) CopyFat32 0.8318n ± 0% 0.4969n ± 0% -40.26% (p=0.000 n=10) CopyFat33 1.1550n ± 0% 0.7705n ± 0% -33.29% (p=0.000 n=10) CopyFat34 1.1560n ± 0% 0.7703n ± 0% -33.37% (p=0.000 n=10) CopyFat35 1.1550n ± 0% 0.7705n ± 0% -33.29% (p=0.000 n=10) CopyFat36 1.1550n ± 0% 0.7704n ± 0% -33.30% (p=0.000 n=10) CopyFat37 1.1555n ± 0% 0.7704n ± 0% -33.33% (p=0.000 n=10) CopyFat38 1.1550n ± 0% 0.7704n ± 0% -33.30% (p=0.000 n=10) CopyFat39 1.1560n ± 0% 0.7703n ± 0% -33.36% (p=0.000 n=10) CopyFat40 1.0020n ± 0% 0.7705n ± 0% -23.10% (p=0.000 n=10) CopyFat41 1.2060n ± 0% 0.7703n ± 0% -36.12% (p=0.000 n=10) CopyFat42 1.2060n ± 0% 0.7704n ± 0% -36.12% (p=0.000 n=10) CopyFat43 1.2060n ± 0% 0.7705n ± 0% -36.11% (p=0.000 n=10) CopyFat44 1.2060n ± 0% 0.7704n ± 0% -36.12% (p=0.000 n=10) CopyFat45 1.2060n ± 0% 0.7704n ± 0% -36.12% (p=0.000 n=10) CopyFat46 1.2060n ± 0% 0.7703n ± 0% -36.13% (p=0.000 n=10) CopyFat47 1.2060n ± 0% 0.7703n ± 0% -36.12% (p=0.000 n=10) CopyFat48 1.2060n ± 0% 0.7703n ± 0% -36.13% (p=0.000 n=10) CopyFat49 1.3620n ± 0% 0.8622n ± 0% -36.70% (p=0.000 n=10) CopyFat50 1.3620n ± 0% 0.8621n ± 0% -36.70% (p=0.000 n=10) CopyFat51 1.3620n ± 0% 0.8622n ± 0% -36.70% (p=0.000 n=10) CopyFat52 1.3620n ± 0% 0.8623n ± 0% -36.69% (p=0.000 n=10) CopyFat53 1.3620n ± 0% 0.8621n ± 0% -36.70% (p=0.000 n=10) CopyFat54 1.3620n ± 0% 0.8622n ± 0% -36.70% (p=0.000 n=10) CopyFat55 1.3620n ± 0% 0.8620n ± 0% -36.71% (p=0.000 n=10) CopyFat56 1.3120n ± 0% 0.8622n ± 0% -34.28% (p=0.000 n=10) CopyFat57 1.5905n ± 0% 0.8621n ± 0% -45.80% (p=0.000 n=10) CopyFat58 1.5830n ± 1% 0.8622n ± 0% -45.53% (p=0.000 n=10) CopyFat59 1.5865n ± 1% 0.8621n ± 0% -45.66% (p=0.000 n=10) CopyFat60 1.5720n ± 1% 0.8622n ± 0% -45.15% (p=0.000 n=10) CopyFat61 1.5900n ± 1% 0.8621n ± 0% -45.78% (p=0.000 n=10) CopyFat62 1.5890n ± 0% 0.8622n ± 0% -45.74% (p=0.000 n=10) CopyFat63 1.5900n ± 1% 0.8620n ± 0% -45.78% (p=0.000 n=10) CopyFat64 1.5440n ± 0% 0.8568n ± 0% -44.51% (p=0.000 n=10) geomean 1.093n 0.7636n -30.13% Kunpeng 920C: goos: linux goarch: arm64 pkg: runtime │ orig.out │ movq.out │ │ sec/op │ sec/op vs base │ CopyFat16 0.4892n ± 1% 0.5072n ± 0% +3.68% (p=0.000 n=10) CopyFat17 0.6394n ± 0% 0.4638n ± 0% -27.47% (p=0.000 n=10) CopyFat18 0.6394n ± 0% 0.4638n ± 0% -27.46% (p=0.000 n=10) CopyFat19 0.6395n ± 0% 0.4638n ± 0% -27.48% (p=0.000 n=10) CopyFat20 0.6393n ± 0% 0.4638n ± 0% -27.45% (p=0.000 n=10) CopyFat21 0.6394n ± 0% 0.4637n ± 0% -27.48% (p=0.000 n=10) CopyFat22 0.6395n ± 0% 0.4638n ± 0% -27.47% (p=0.000 n=10) CopyFat23 0.6395n ± 0% 0.4638n ± 0% -27.47% (p=0.000 n=10) CopyFat24 0.6091n ± 0% 0.4639n ± 0% -23.84% (p=0.000 n=10) CopyFat25 0.9109n ± 0% 0.4674n ± 0% -48.69% (p=0.000 n=10) CopyFat26 0.9107n ± 0% 0.4674n ± 0% -48.68% (p=0.000 n=10) CopyFat27 0.9108n ± 0% 0.4674n ± 0% -48.69% (p=0.000 n=10) CopyFat28 0.9109n ± 0% 0.4674n ± 0% -48.69% (p=0.000 n=10) CopyFat29 0.9110n ± 0% 0.4673n ± 0% -48.70% (p=0.000 n=10) CopyFat30 0.9109n ± 0% 0.4673n ± 0% -48.70% (p=0.000 n=10) CopyFat31 0.9110n ± 0% 0.4674n ± 0% -48.69% (p=0.000 n=10) CopyFat32 0.6845n ± 0% 0.4845n ± 1% -29.21% (p=0.000 n=10) CopyFat33 0.9130n ± 0% 0.9117n ± 0% -0.14% (p=0.000 n=10) CopyFat34 0.9131n ± 0% 0.9118n ± 0% -0.14% (p=0.001 n=10) CopyFat35 0.9131n ± 0% 0.9117n ± 0% -0.15% (p=0.001 n=10) CopyFat36 0.9129n ± 0% 0.9117n ± 0% -0.14% (p=0.003 n=10) CopyFat37 0.9129n ± 0% 0.9117n ± 0% -0.14% (p=0.000 n=10) CopyFat38 0.9130n ± 0% 0.9118n ± 0% -0.14% (p=0.000 n=10) CopyFat39 0.9131n ± 0% 0.9118n ± 0% -0.15% (p=0.000 n=10) CopyFat40 0.9112n ± 0% 0.9118n ± 0% +0.07% (p=0.027 n=10) CopyFat41 1.1390n ± 0% 0.9118n ± 0% -19.95% (p=0.000 n=10) CopyFat42 1.1390n ± 0% 0.9118n ± 0% -19.95% (p=0.000 n=10) CopyFat43 1.1390n ± 0% 0.9116n ± 0% -19.96% (p=0.000 n=10) CopyFat44 1.1390n ± 0% 0.9119n ± 0% -19.94% (p=0.000 n=10) CopyFat45 1.1390n ± 0% 0.9118n ± 0% -19.95% (p=0.000 n=10) CopyFat46 1.1390n ± 0% 0.9118n ± 0% -19.95% (p=0.000 n=10) CopyFat47 1.1390n ± 0% 0.9117n ± 0% -19.96% (p=0.000 n=10) CopyFat48 0.9111n ± 0% 0.9116n ± 0% +0.06% (p=0.002 n=10) CopyFat49 1.2160n ± 0% 0.9292n ± 0% -23.59% (p=0.000 n=10) CopyFat50 1.2160n ± 0% 0.9302n ± 0% -23.50% (p=0.000 n=10) CopyFat51 1.2160n ± 0% 0.9292n ± 0% -23.59% (p=0.000 n=10) CopyFat52 1.2160n ± 0% 0.9302n ± 0% -23.50% (p=0.000 n=10) CopyFat53 1.2160n ± 0% 0.9293n ± 0% -23.58% (p=0.000 n=10) CopyFat54 1.2160n ± 0% 0.9302n ± 0% -23.50% (p=0.000 n=10) CopyFat55 1.2160n ± 0% 0.9292n ± 0% -23.59% (p=0.000 n=10) CopyFat56 1.1480n ± 0% 0.9303n ± 0% -18.96% (p=0.000 n=10) CopyFat57 1.3690n ± 0% 0.9293n ± 0% -32.12% (p=0.000 n=10) CopyFat58 1.3690n ± 0% 0.9303n ± 0% -32.05% (p=0.000 n=10) CopyFat59 1.3690n ± 0% 0.9293n ± 0% -32.12% (p=0.000 n=10) CopyFat60 1.3690n ± 0% 0.9303n ± 0% -32.05% (p=0.000 n=10) CopyFat61 1.3690n ± 0% 0.9293n ± 0% -32.12% (p=0.000 n=10) CopyFat62 1.3690n ± 0% 0.9303n ± 0% -32.05% (p=0.000 n=10) CopyFat63 1.3690n ± 0% 0.9293n ± 0% -32.12% (p=0.000 n=10) CopyFat64 1.1470n ± 0% 0.5742n ± 0% -49.94% (p=0.000 n=10) geomean 0.9710n 0.7214n -25.70% Change-Id: Iecfe52fde1d431a1e4503cd848813a67f3896512 Reviewed-on: https://go-review.googlesource.com/c/go/+/738261 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2026-03-17cmd/compile: don't treat string literal as static data in FIPS modeCherry Mui
Reference a string literal requires a relocation, which is not allowed in static data in FIPS mode, as this would be an absolute relocation, and cannot be properly hashed at both link time and run time. Also, make sure the symbol's FIPS type is set before writing. This ensures relocations are checked in FIPS RODATA symbols. Currently we only call setFIPSType in prewrite if we change the type from a BSS type to a DATA type. But it is possible that the compiler sets the symbol type to RODATA and start writing to it. For #78173. Change-Id: I120a3b28ee3f38e9024479344565f54dff87d430 Reviewed-on: https://go-review.googlesource.com/c/go/+/755600 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Russ Cox <rsc@golang.org>
2026-03-17cmd/compile: eliminate redundant sign-extensions for wasmGeorge Adams
Add rules to eliminate redundant I64Extend sign-extension operations in the wasm backend: Idempotent (applying the same extend twice is redundant): (I64Extend32S (I64Extend32S x)) => (I64Extend32S x) (I64Extend16S (I64Extend16S x)) => (I64Extend16S x) (I64Extend8S (I64Extend8S x)) => (I64Extend8S x) Narrower-subsumes-wider (a narrower sign-extend already determines all the bits that a wider one would set): (I64Extend32S (I64Extend16S x)) => (I64Extend16S x) (I64Extend32S (I64Extend8S x)) => (I64Extend8S x) (I64Extend16S (I64Extend8S x)) => (I64Extend8S x) These patterns arise from nested sub-word type conversions. For example, converting int8 -> int16 -> int32 -> int64 lowers to I64Extend8S -> I64Extend16S -> I64Extend32S, but the I64Extend8S alone is sufficient since it already sign-extends from 8 to 64 bits. Cq-Include-Trybots: luci.golang.try:gotip-wasip1-wasm_wasmtime,gotip-wasip1-wasm_wazero Change-Id: I1637687df31893b1ffa36915a3bd2e10d455f4ef Reviewed-on: https://go-review.googlesource.com/c/go/+/754040 Reviewed-by: Carlos Amedee <carlos@golang.org> Auto-Submit: Keith Randall <khr@golang.org> 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>
2026-03-16cmd/compile: (riscv64) optimize float32(abs|sqrt64(float64(x)))Meng Zhuo
Absorb unnecessary conversion between float32 and float64 if both src and dst are 32 bit. Updates #75463 Change-Id: Ia71941223b5cca3fea66b559da7b8f916e63feaf Reviewed-on: https://go-review.googlesource.com/c/go/+/733621 Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Julian Zhu <jz531210@gmail.com> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-16cmd/compile/internal/noder: factor out common UIR versionRobert Griesemer
Ensure that the writers and readers use the same UIR version by defining the currently used version in one place rather than setting it in two places which might diverge. Change-Id: Iae139e08c3c01e553250ba6f4f171132b06eb8c9 Reviewed-on: https://go-review.googlesource.com/c/go/+/754662 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Mark Freeman <markfreeman@google.com> Auto-Submit: Robert Griesemer <gri@google.com>
2026-03-13cmd/compile: keep blank nodes alive in b.loopJunyang Shao
The current bloop pass implementation skips blank nodes silently. This CL makes it aware of that and keep them alive in temps. Fixes #77654. Change-Id: Iaffa5194ba1f0fe8d7c80a4c8e5c9a65a47bf534 Reviewed-on: https://go-review.googlesource.com/c/go/+/754920 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org>
2026-03-10cmd/compile: unwrap OCONVIFACE in staticinit for OAS2Oliver Eikemeier
Static initialization only expected OCONVNOP wrappings. Unwrap OCONVIFACE too, since it occurs when multiple return values of an OAS2FUNC are implicitly converted to an interface. Fixes #78016 Change-Id: Ic3fd6151403aabfc087d3240c1fcfabe7108cc0e GitHub-Last-Rev: 98976d9e64baa85f4f3181764308566aae991bbf GitHub-Pull-Request: golang/go#78017 Reviewed-on: https://go-review.googlesource.com/c/go/+/752780 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
2026-03-10cmd/compile: add double-mask elimination rule for wasmGeorge Adams
Add a rule to collapse cascaded I64And operations with constant masks into a single mask: (I64And (I64And x (I64Const [c1])) (I64Const [c2])) => (I64And x (I64Const [c1 & c2])) This pattern arises from sub-word comparisons. For example, (Eq32 x y) lowers to (I64Eq (ZeroExt32to64 x) (ZeroExt32to64 y)), which becomes (I64Eq (I64And x 0xffffffff) (I64And y 0xffffffff)). If x or y is the result of another sub-word operation that already inserted a mask, the masks cascade and this rule collapses them. Cq-Include-Trybots: luci.golang.try:gotip-wasip1-wasm_wasmtime,gotip-wasip1-wasm_wazero Change-Id: Id7856b391be3ac20f1bc9eee40995b52c0754aed Reviewed-on: https://go-review.googlesource.com/c/go/+/753620 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Mark Freeman <markfreeman@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2026-03-10cmd/compile: fix mips64 CALLtailinter argument countKeith Randall
It should be 2, not 1. Fixes #78013 Change-Id: If1c48c84c324a3fd50e9f4b43cca2ea62a995dc5 Reviewed-on: https://go-review.googlesource.com/c/go/+/752740 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Mark Freeman <markfreeman@google.com> Auto-Submit: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2026-03-10cmd/compile: forward small Load through Move to avoid redundant copiesdorbmon
Fixes #77720 Add a generic SSA rewrite that forwards `Load` from a `Move` destination back to the `Move` source when it is provably safe, so field reads like `s.h.Value().typ` don’t force a full struct copy. - Add `Load <- Move` rewrite in `generic.rules` with safety guard: non-volatile source - Tweak `fixedbugs/issue22200*` so that it can still trigger the "stack frame too large" error. - Regenerate `rewritegeneric.go`. - Add `test/codegen/moveload.go` to assert no `MOVUPS` and direct `MOVBLZX` in both direct and inlined forms. Benchmark results (linux/amd64, i7-14700KF): $ go test cmd/compile/internal/test -run='^$' -bench='MoveLoad' -count=20 Before: BenchmarkMoveLoadTypViaValue-20 ~76.9 ns/op BenchmarkMoveLoadTypViaPtr-20 ~1.97 ns/op After: BenchmarkMoveLoadTypViaValue-20 ~1.894 ns/op BenchmarkMoveLoadTypViaPtr-20 ~1.905 ns/op The rewrite removes the redundant struct copy in `s.h.Value().typ`, bringing it in line with the direct pointer form. Change-Id: Iddf2263e390030ba013e0642a695b87c75f899da Reviewed-on: https://go-review.googlesource.com/c/go/+/748200 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Mark Freeman <markfreeman@google.com>