Skip to content

Enhancement: "notnull" modifier for a value #11596

@llvmbot

Description

@llvmbot
Bugzilla Link 11224
Version trunk
OS All
Reporter LLVM Bugzilla Contributor

Extended Description

Iave a language feature called "auto class creation". when a pointer is null and i access this field, the field is filled with values.
One problem i have is that this check is done every time i access a field
The problem is that a allocated memory is not null, but llvm dosent know that
So it checks it against 0 again and again
The other problem is the allocation. in some cases (the start of a function), the probability that the mem should be allocated is 100%, in other cases the probability is very low. so the allocation should not be inlined
(and maybe the basic block for the mem allocation should be at the end of the function so that no jump is required)

So the solution is a "notnull" flag to constant fold "icmp eq %type* %value, null" to "i1 0"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions