[all-commits] [llvm/llvm-project] 88c965: BreakCriticalEdges for callbr indirect dests

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Wed Jun 17 11:45:31 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 88c965ba14cff1e04ccb4237966a9fefe902b1f4
      https://github.com/llvm/llvm-project/commit/88c965ba14cff1e04ccb4237966a9fefe902b1f4
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2020-06-17 (Wed, 17 Jun 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
    A llvm/test/Transforms/CallSiteSplitting/callsite-split-callbr.ll

  Log Message:
  -----------
  BreakCriticalEdges for callbr indirect dests

Summary:
llvm::SplitEdge was failing an assertion that the BasicBlock only had
one successor (for BasicBlocks terminated by CallBrInst, we typically
have multiple successors).  It was surprising that the earlier call to
SplitCriticalEdge did not handle the critical edge (there was an early
return).  Removing that triggered another assertion relating to creating
a BlockAddress for a BasicBlock that did not (yet) have a parent, which
is a simple order of operations issue in llvm::SplitCriticalEdge (a
freshly constructed BasicBlock must be inserted into a Function's basic
block list to have a parent).

Thanks to @nathanchance for the report.
Fixes: https://github.com/ClangBuiltLinux/linux/issues/1018

Reviewers: craig.topper, jyknight, void, fhahn, efriedma

Reviewed By: efriedma

Subscribers: eli.friedman, rnk, efriedma, fhahn, hiraditya, llvm-commits, nathanchance, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81607




More information about the All-commits mailing list