Go to file
Jun Bum Lim 2a58933519 Add CallSiteSplitting pass
Summary:
This change add a pass which tries to split a call-site to pass
more constrained arguments if its argument is predicated in the control flow
so that we can expose better context to the later passes (e.g, inliner, jump
threading, or IPA-CP based function cloning, etc.).
As of now we support two cases :

1) If a call site is dominated by an OR condition and if any of its arguments
are predicated on this OR condition, try to split the condition with more
constrained arguments. For example, in the code below, we try to split the
call site since we can predicate the argument (ptr) based on the OR condition.

Split from :
      if (!ptr || c)
        callee(ptr);
to :
      if (!ptr)
        callee(null ptr)  // set the known constant value
      else if (c)
        callee(nonnull ptr)  // set non-null attribute in the argument

2) We can also split a call-site based on constant incoming values of a PHI
For example,
from :
      BB0:
       %c = icmp eq i32 %i1, %i2
       br i1 %c, label %BB2, label %BB1
      BB1:
       br label %BB2
      BB2:
       %p = phi i32 [ 0, %BB0 ], [ 1, %BB1 ]
       call void @bar(i32 %p)
to
      BB0:
       %c = icmp eq i32 %i1, %i2
       br i1 %c, label %BB2-split0, label %BB1
      BB1:
       br label %BB2-split1
      BB2-split0:
       call void @bar(i32 0)
       br label %BB2
      BB2-split1:
       call void @bar(i32 1)
       br label %BB2
      BB2:
       %p = phi i32 [ 0, %BB2-split0 ], [ 1, %BB2-split1 ]

Reviewers: davidxl, huntergr, chandlerc, mcrosier, eraman, davide

Reviewed By: davidxl

Subscribers: sdesmalen, ashutosh.nema, fhahn, mssimpso, aemerson, mgorny, mehdi_amini, kristof.beyls, llvm-commits

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

llvm-svn: 317351
2017-11-03 19:01:57 +00:00
clang Move Extract.cpp that wasn't moved in r317343 2017-11-03 18:21:06 +00:00
clang-tools-extra Use ToolExecutor framework in the sample tool-template. 2017-11-03 16:03:56 +00:00
compiler-rt [fuzzer] Fix nested mallocs 2017-11-02 04:12:10 +00:00
debuginfo-tests Revert r313600 due to bot failures on Green Dragon. 2017-09-19 14:51:37 +00:00
libclc tgamma: Use unary_decl instead of custom inc file 2017-11-02 19:49:00 +00:00
libcxx Change a bunch of comments from C++1z to C++17. NFC 2017-11-02 15:03:25 +00:00
libcxxabi Fix ASAN build with older compiler-rt versions. 2017-09-14 22:37:34 +00:00
libunwind Fix building for ARM with dwarf exception handling 2017-11-02 08:16:16 +00:00
lld [ELF] - Remove excessive field initialization. NFC. 2017-11-03 13:19:41 +00:00
lldb Add float/vector registers for ppc64le 2017-11-03 15:22:36 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm Add CallSiteSplitting pass 2017-11-03 19:01:57 +00:00
openmp Revert "Rename fields of ompt_frame_t" 2017-11-03 18:28:25 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [ZoneAlgo/ForwardOpTree] Normalize PHIs to their known incoming values. 2017-10-31 16:11:46 +00:00
README.md Add an svn project to contain the files that appear at the root of the 2017-10-19 21:09:49 +00:00

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.