Skip to content

Commit

Permalink
BranchFolding - IsBetterFallthrough - assert non-null pointers. NFCI.
Browse files Browse the repository at this point in the history
Silences static analyzer null dereference warnings.

llvm-svn: 373823
  • Loading branch information
RKSimon committed Oct 5, 2019
1 parent 375a84b commit f609c0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llvm/lib/CodeGen/BranchFolding.cpp
Expand Up @@ -1307,6 +1307,8 @@ static bool IsBranchOnlyBlock(MachineBasicBlock *MBB) {
/// result in infinite loops.
static bool IsBetterFallthrough(MachineBasicBlock *MBB1,
MachineBasicBlock *MBB2) {
assert(MBB1 && MBB2 && "Unknown MachineBasicBlock");

// Right now, we use a simple heuristic. If MBB2 ends with a call, and
// MBB1 doesn't, we prefer to fall through into MBB1. This allows us to
// optimize branches that branch to either a return block or an assert block
Expand Down

0 comments on commit f609c0a

Please sign in to comment.