Skip to content

TargetInstrInfo::AnalyzeBranch can modify the MBB being analyzed #3911

@llvmbot

Description

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

Extended Description

AnalyzeBranch may delete instructions in the MBB if they are after the last unconditional branch.

This may invalidate iterators or client's data structure (e.g. liveintervals maps). The current workaround is to only allow this when the caller explicitly permits so. The only such client is branch folding.

The current fix is to not allow AnalyzeBranch to delete instructions. Instead, branch folding should perform this optimization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions