Skip to content

cmd/compile: migrate amd64-specific optimizations to generic optimizations #16270

Closed
@josharian

Description

@josharian

There are many optimizations in amd64.rules that apply to many architectures. As we add architectures, it'd be nice not to repeat discovering and encoding these rules.

To pick an example at random:

(ANDLconst [c] (ANDLconst [d] x)) -> (ANDLconst [c & d] x)

This could probably be done in generic.rules by introducing generic AndNNconst ops.

In some cases, we'd still need the arch-specific rules because optimizable patterns are introduced during lowering. If there are enough of those cases, it might be worth introducing common lowered ops and common lowered optimizations. The best way to find out it to start migrating rules and see.

cc @cherrymui @dr2chase @randall77 @brtzsnr

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.early-in-cycleA change that should be done early in the 3 month dev cycle.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions