Skip to content

cmd/compile/internal/ir: reduce size of miniExpr by 8 bytes #71823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cmd/compile/internal/ir/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ type Expr interface {
// A miniExpr is a miniNode with extra fields common to expressions.
// TODO(rsc): Once we are sure about the contents, compact the bools
// into a bit field and leave extra bits available for implementations
// embedding miniExpr. Right now there are ~60 unused bits sitting here.
// embedding miniExpr. Right now there are ~24 unused bits sitting here.
type miniExpr struct {
miniNode
flags bitset8
typ *types.Type
init Nodes // TODO(rsc): Don't require every Node to have an init
flags bitset8
}

const (
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/compile/internal/ir/sizeof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ func TestSizeof(t *testing.T) {
_64bit uintptr // size on 64bit platforms
}{
{Func{}, 184, 312},
{Name{}, 96, 168},
{Name{}, 96, 160},
{miniExpr{}, 32, 48},
}

for _, tt := range tests {
Expand Down