[all-commits] [llvm/llvm-project] 22a1f9: FunctionPropertiesAnalysis: handle callsite BBs th...

Mircea Trofin via All-commits all-commits at lists.llvm.org
Tue Jun 14 15:20:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 22a1f998f70f4217c9f4f2e820d0c86717d1a3c3
      https://github.com/llvm/llvm-project/commit/22a1f998f70f4217c9f4f2e820d0c86717d1a3c3
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2022-06-14 (Tue, 14 Jun 2022)

  Changed paths:
    M llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
    M llvm/include/llvm/Analysis/MLInlineAdvisor.h
    M llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
    M llvm/lib/Analysis/MLInlineAdvisor.cpp
    M llvm/unittests/Analysis/FunctionPropertiesAnalysisTest.cpp

  Log Message:
  -----------
  FunctionPropertiesAnalysis: handle callsite BBs that lose edges

There could be successors that were reached before but now are only
reachable from elsewhere in the CFG.

Suppose the following diamond CFG (lines are arrows pointing down):
    A
  /   \
 B     C
  \   /
    D
There's a call site in C that is inlined. Upon doing that, it turns out
it expands to:
   call void @llvm.trap()
   unreachable
D isn't reachable from C anymore, but we did discount it when we set up
FunctionPropertiesUpdater, so we need to re-include it here.

The patch also updates loop accounting to use LoopInfo rather than
traverse BBs.

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




More information about the All-commits mailing list