/
githubmirror
/
go
Обзор
Документация
Войти
/
githubmirror
/
go
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/codegen/memcse.go
26 строк
548 B
Alexander Musman
cmd/compile: recognize OpVarDef and OpZero in cse isMemDef
23 апр 2026, 18:12
23 апр 2026, 18:12
13cab13
Код
Авторство
О чём код?
// asmcheck // Copyright 2025 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test common subexpression elimination of loads around other operations. package codegen func loadsAroundMemEqual(p *int, s1, s2 string) (int, bool) { x := *p eq := s1 == s2 y := *p // arm64:"MOVD ZR, R0" return x - y, eq } func loadsAroundVarDefAndZero(p *int) (int, *int) { x := *p var s [2]*int s[0] = p y := *p // arm64:"MOVD ZR, R0" return x - y, s[0] }