llvm-project/llvm
Kazu Hirata 53b68e676f Resubmit: [JumpThreading] Thread jumps through two basic blocks
This reverts commit 2d258ed931.  This
revision fixes the Windows build and adds a testcase for it, namely
thread-two-bbs3.ll.  My original patch improperly copied EH pads on
Windows.  This patch disregards jump threading opportunities having to
do with EH pads.

[JumpThreading] Thread jumps through two basic blocks

Summary:
This patch teaches JumpThreading.cpp to thread through two basic
blocks like:

  bb3:
    %var = phi i32* [ null, %bb1 ], [ @a, %bb2 ]
    %tobool = icmp eq i32 %cond, 0
    br i1 %tobool, label %bb4, label ...

  bb4:
    %cmp = icmp eq i32* %var, null
    br i1 %cmp, label bb5, label bb6

by duplicating basic blocks like bb3 above.  Once we duplicate bb3 as
bb3.dup and redirect edge bb2->bb3 to bb2->bb3.dup, we have:

  bb3:
    %var = phi i32* [ @a, %bb2 ]
    %tobool = icmp eq i32 %cond, 0
    br i1 %tobool, label %bb4, label ...

  bb3.dup:
    %var = phi i32* [ null, %bb1 ]
    %tobool = icmp eq i32 %cond, 0
    br i1 %tobool, label %bb4, label ...

  bb4:
    %cmp = icmp eq i32* %var, null
    br i1 %cmp, label bb5, label bb6

Then the existing code in JumpThreading.cpp can thread edge
bb3.dup->bb4 through bb4 and eventually create bb3.dup->bb5.

Reviewers: wmi

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70247
2020-01-16 12:33:37 -08:00
..
benchmarks
bindings [NFC] Fix trivial typos in comments 2020-01-06 10:50:26 +00:00
cmake [CMake] Enable -qfuncsect when building with IBM XL 2020-01-15 10:45:50 -05:00
docs Revert "[Support] make report_fatal_error `abort` instead of `exit`" 2020-01-15 17:52:25 -08:00
examples [ORC] Simplify use of lazyReexports with LLJIT. 2020-01-15 08:02:53 -08:00
include Resubmit: [JumpThreading] Thread jumps through two basic blocks 2020-01-16 12:33:37 -08:00
lib Resubmit: [JumpThreading] Thread jumps through two basic blocks 2020-01-16 12:33:37 -08:00
projects
resources
runtimes [llvm/runtimes] Add runtimes as a dependency of clang-bootstrap-deps 2019-12-16 16:58:15 -08:00
test Resubmit: [JumpThreading] Thread jumps through two basic blocks 2020-01-16 12:33:37 -08:00
tools [PowerPC][AIX] Make PIC the default relocation model for AIX 2020-01-16 13:07:36 -05:00
unittests [PowerPC][AIX] Make PIC the default relocation model for AIX 2020-01-16 13:07:36 -05:00
utils TableGen/GlobalISel: Fix srcvalue inputs 2020-01-16 13:49:43 -05:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt Bump the trunk major version to 11 2020-01-15 13:38:01 +01:00
CODE_OWNERS.TXT [VE] Target stub for NEC SX-Aurora 2020-01-09 11:17:35 +01:00
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

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

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.