llvm-project/llvm/lib
Sanjoy Das 74bda4d591 [JumpThreading] Thread through guards
Summary:
This patch allows JumpThreading also thread through guards.
Virtually, guard(cond) is equivalent to the following construction:

  if (cond) { do something } else {deoptimize}

Yet it is not explicitly converted into IFs before lowering.
This patch enables early threading through guards in simple cases.
Currently it covers the following situation:

  if (cond1) {
    // code A
  } else {
    // code B
  }
  // code C
  guard(cond2)
  // code D

If there is implication cond1 => cond2 or !cond1 => cond2, we can transform
this construction into the following:

  if (cond1) {
    // code A
    // code C
  } else {
    // code B
    // code C
    guard(cond2)
  }
  // code D

Thus, removing the guard from one of execution branches.

Patch by Max Kazantsev!

Reviewers: reames, apilipenko, igor-laevsky, anna, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 294617
2017-02-09 19:40:22 +00:00
..
Analysis LVI: Fix use-of-uninitialized-value after r294463 2017-02-09 09:28:05 +00:00
AsmParser Change debug-info-for-profiling from a TargetOption to a function attribute. 2017-02-01 22:45:09 +00:00
Bitcode Fix bitcode upgrade for DIGlobalVariables with a var: field. 2017-02-08 17:44:43 +00:00
CodeGen [SelectionDAG] Fix bugs in inverted condition splitting code. 2017-02-09 18:28:17 +00:00
DebugInfo [MC] Fix some Clang-tidy modernize and Include What You Use warnings in SubtargetFeature; other minor fixes (NFC). 2017-02-09 01:09:54 +00:00
Demangle Add support for demangling C++11 thread_local variables. 2017-01-31 15:56:36 +00:00
ExecutionEngine RuntimeDyldELF/AArch64: Implement basic GOT support 2017-02-06 15:31:28 +00:00
Fuzzer [libFuzzer] Use long long to ensure 64 bits. 2017-02-08 00:03:31 +00:00
IR IR: Consider two DISubprograms to be odr-equal if they have the same template parameters. 2017-02-06 21:23:03 +00:00
IRReader Timer: Track name and description. 2016-11-18 19:43:18 +00:00
LTO fix nullptr Mangler in LTOModule 2017-02-04 01:28:44 +00:00
LibDriver LibDriver: Allow resource files to be archive members. 2016-12-15 19:37:46 +00:00
LineEditor
Linker IRMover: Merge flags LinkModuleInlineAsm and IsPerformingImport. 2017-02-03 17:01:14 +00:00
MC Make it possible to set SHF_LINK_ORDER explicitly. 2017-02-09 14:59:20 +00:00
Object Object: pad out BSD archive members to 8-bytes 2017-02-09 19:29:35 +00:00
ObjectYAML Make this file clang-format friendly and clang-format it. 2017-01-31 21:11:12 +00:00
Option Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
Passes Add PredicateInfo utility and printing pass 2017-02-07 21:10:46 +00:00
ProfileData Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
Support [X86] Remove the HLE feature flag. 2017-02-09 06:51:02 +00:00
TableGen Use print() instead of dump() in code 2017-01-28 02:47:46 +00:00
Target Convert to for-range loop. NFCI. 2017-02-09 18:52:24 +00:00
Transforms [JumpThreading] Thread through guards 2017-02-09 19:40:22 +00:00
XRay [MC] Fix some Clang-tidy modernize and Include What You Use warnings in SubtargetFeature; other minor fixes (NFC). 2017-02-09 01:09:54 +00:00
CMakeLists.txt [XRay] Define the library for XRay trace logs 2017-01-11 06:39:09 +00:00
LLVMBuild.txt Add an c++ itanium demangler to llvm. 2016-09-06 19:16:48 +00:00