Skip to content

MemcpyOpt doesn't strip TBAA correctly #133984

Closed
@gbaraldi

Description

@gbaraldi

While debugging JuliaLang/julia#57959. It got minimized to what looks to be a bug in MemCpyOpt, where it strips the noalias attribute of a memcpy

// As this transformation can cause memory accesses that didn't previously
// alias to begin to alias one another, we remove !noalias metadata from any
// uses of either alloca. This is conservative, but more precision doesn't
// seem worthwhile right now.
for (Instruction *I : NoAliasInstrs)
I->setMetadata(LLVMContext::MD_noalias, nullptr);
but not the other aliasing metadatas (tbaa,tbaa.struct). Probably using combineMetadata as used elsewhere in the pass
@khei4 was the one that originally added this optimization

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions