llvm-project/llvm
Ehsan Amiri b9fcc2b171 Extend trip count instead of truncating IV in LFTR, when legal
When legal, extending trip count in the loop control logic generates better code compared to truncating IV. This is because

(1) extending trip count is a loop invariant operation (see genLoopLimit where we prove trip count is loop invariant).
(2) Scalar Evolution seems to have problems understanding trunc when computing loop trip count. So removing them allows better analysis performed in Scalar Evolution. (In particular this fixes PR 28363 which is the motivation for this change).

I am not going to perform any performance test. Any degradation caused by this should be an indication of a bug elsewhere.

To prove legality, we rely on SCEV to prove zext(trunc(IV)) == IV (or similarly for sext). If this holds, we can prove equivalence of trunc(IV)==ExitCnt (1) and IV == zext(ExitCnt). Simply take zext of boths sides of (1) and apply the proven equivalence.

https://reviews.llvm.org/D23075

llvm-svn: 278334
2016-08-11 13:51:20 +00:00
..
bindings
cmake Remove LLVM_ENABLE_LIBCXXABI 2016-08-04 10:24:48 +00:00
docs [LangRef] Fix formatting (no semantic change) 2016-08-10 21:48:24 +00:00
examples [ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol. 2016-08-01 20:49:11 +00:00
include Revert "Resolution-based LTO API." 2016-08-11 13:03:56 +00:00
lib Extend trip count instead of truncating IV in LFTR, when legal 2016-08-11 13:51:20 +00:00
projects
resources
runtimes
test Extend trip count instead of truncating IV in LFTR, when legal 2016-08-11 13:51:20 +00:00
tools Revert "Resolution-based LTO API." 2016-08-11 13:03:56 +00:00
unittests Fix UB in APInt::ashr 2016-08-10 19:50:14 +00:00
utils [vim] Update the llvm.vim syntax file 2016-08-09 18:34:19 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt Remove LLVM_ENABLE_LIBCXXABI 2016-08-04 10:24:48 +00:00
CODE_OWNERS.TXT test commit 2016-08-02 19:25:17 +00:00
CREDITS.TXT Shamelessly add myself to CREDITS.TXT 2016-08-04 16:28:22 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt Revert rL277454 2016-08-02 13:26:07 +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.