Skip to content

Partially-undef constants cause a large size regression in src/test/run-make/wasm-panic-small #84565

Closed
@erikdesjardins

Description

@erikdesjardins

Opening this to track a limitation of #83698, which does not generate partially-undef constants (controlled by -Zpartially-uninit-const-threshold=1234) due to this issue.

The root cause is that LLVM is unable to const prop (?) a load from a partially-undef constant, which prevents all the panic formatting code from being removed in the src/test/run-make/wasm-panic-small test, which causes the test to fail.

Minimal repro (from #83698 (comment)): https://godbolt.org/z/3vYqM5865


per nikic:

https://godbolt.org/z/1Mff6zrvd shows one of the ways this could be fixed on the LLVM side. We should be dropping trailing zeros from bitcasted GEPs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.I-heavyIssue: Problems and improvements with respect to binary size of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions