llvm-project/llvm
Nikolai Bozhenov 4a04fb9e90 [BypassSlowDivision] Use ValueTracking to simplify run-time checks
ValueTracking is used for more thorough analysis of operands. Based on the
analysis, either run-time checks can be simplified (e.g. check only one operand
instead of two) or the transformation can be avoided. For example, it is quite
often the case that a divisor is promoted from a shorter type and run-time
checks for it are redundant.

With additional compile-time analysis of values, two special cases naturally
arise and are addressed by the patch:

 1) Both operands are known to be short enough. Then, the long division can be
    simply replaced with a short one without CFG modification.

 2) If a division is unsigned and the dividend is known to be short then the
    long division is not needed at all. Because if the divisor is too big for
    short division then the quotient is obviously zero (and the remainder is
    equal to the dividend). Actually, the division is not needed when
    (divisor > dividend).

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

llvm-svn: 296832
2017-03-02 22:12:15 +00:00
..
bindings Go binding: Add methods for missing PassManagerBuilder C APIs 2017-02-17 05:41:05 +00:00
cmake CMake: Clean up VersionFromVCS.cmake 2017-03-02 22:05:13 +00:00
docs [XRay][Docs] Update the XRay documentation 2017-02-28 22:01:26 +00:00
examples llvm/examples/Kaleidoscope/BuildingAJIT: More fixup corresponding to r295636. 2017-02-20 10:07:41 +00:00
include Revert "Fix PR 24415 (at least), by making our post-dominator tree behavior sane." 2017-03-02 21:08:37 +00:00
lib [BypassSlowDivision] Use ValueTracking to simplify run-time checks 2017-03-02 22:12:15 +00:00
projects
resources
runtimes
test [BypassSlowDivision] Use ValueTracking to simplify run-time checks 2017-03-02 22:12:15 +00:00
tools [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
unittests [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
utils New tool: opt-diff.py 2017-03-02 17:00:59 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore [.gitignore] Update .gitignore to ignore a nested build directory 2017-02-24 23:09:30 +00:00
CMakeLists.txt [Tablegen] Instrumenting table gen DAGGenISelDAG 2017-02-14 18:32:41 +00:00
CODE_OWNERS.TXT Collapse my two entries in CODE_OWNERS.txt 2017-02-15 23:45:21 +00:00
CREDITS.TXT Revert r294228 2017-02-06 19:40:56 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt Test commit: remove a blank line. 2017-02-03 10:56:57 +00:00
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

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.

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.