Skip to content

Combining place projections in MIR makes codegen forget that NonNull is nonnull #111518

Open
@saethlin

Description

@saethlin

In #105808 I am adding a hack to prevent combining place projections where one of assignments that would be optimized away contains a niche. This is because optimizing Vec::as_ptr to a single MIR statement that just loads the underlying *const T makes us lose the nonnull LLVM attribute in codegen.

(I am opening this issue early so I can link to it in the PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions