Skip to content

Why is folding @llvm.assumes into operand bundle assumes behind --enable-knowledge-retention? #168688

@philnik777

Description

@philnik777

Currently you have to pass -mllvm --enable-knowledge-retention for LLVM to fold

  %cmp = icmp ne ptr %ptr, null
  call void @llvm.assume(i1 %cmp)

into

  call void @llvm.assume(i1 true) [ "nonnull"(ptr %ptr) ]

AFAICT the operand bundles seem to be strictly superior for optimization compared to an equivalent instruction based version. Is there a reason this fold isn't enabled by default/unconditionally?

Metadata

Metadata

Assignees

No one assigned

    Labels

    llvm:optimizationsquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions