Skip to content

[very low priority, upstream?] Relax away addi/cincoffset-0 resulting from highly aligned addresses? #154

@nwf

Description

@nwf

Consider the construction of an address from a symbolic value, something like

1:
  lui %0, %hi(__export_mem_uart)
  addi %0, %0, %lo(1b)

If the value of __export_mem_uart has all of its 12 least significant bits zero, then the lui has done all the necessary work and the addi is going to be a no-op. Presently, AFAICT, the linker relaxation will leave the no-op in place, as they consider the zero-ness of %hi, but not of %lo.

While this is not likely to happen "by chance" given a random symbol, almost all of our MMIO addresses (__export_mem_) are sufficiently aligned for such a relaxation to fire.

Similar considerations apply for auipcc- and auicgp-based constructions (see also #153).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions