Skip to content

LTO scan of module-level inline assembly does not respect CPU #67698

@mysterymath

Description

@mysterymath

The scan of module-level inline assembly performed to extract the referenced symbols does not forward the CPU specified on the clang command line. Because of this, opcodes that are only legal in that CPU will cause the compile to fail in -flto where it would have succeeded without. For example:

asm(".globl func; func: cm.mvsa01 s1, s0; ret");

This succeeds when compiled for RISC-V -march=rv64izcmp (https://godbolt.org/z/8dxT3nxs9), but fails when -flto is added (https://godbolt.org/z/GK5ohKnK9).

See

T->createMCSubtargetInfo(TT.str(), "", ""));

Metadata

Metadata

Assignees

No one assigned

    Labels

    LTOLink time optimization (regular/full LTO or ThinLTO)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions