1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
Go to file
Craig Topper 1ba8be4314 [LoopIdiomRecognize] Only convert loops to ctlz if we can prove that the input is non-negative.
Summary:
Loop idiom recognize tries to convert loops like

```
int foo(int x) {
  int cnt = 0;
  while (x) {
    x >>= 1;
    ++cnt;
  }
  return cnt;
}
```

into calls to ctlz, but if x is initially negative this loop should be infinite.

It happens that the cases that motivated this change have an absolute value of x before the loop. So this patch restricts the transform to cases where we know x is positive. Note: We are relying on the absolute value of INT_MIN to be undefined so we can assume that the result is always positive.

Fixes PR37479

Reviewers: spatel, hfinkel, efriedma, javed.absar

Reviewed By: efriedma

Subscribers: dmgreen, llvm-commits

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

llvm-svn: 333702
2018-05-31 22:16:55 +00:00
bindings [LLVM-C] [OCaml] Remove LLVMAddBBVectorizePass 2018-05-28 16:58:10 +00:00
cmake Use -Wextra spelling instead of -W 2018-05-31 13:41:04 +00:00
docs [lit] Report line number for failed RUN command 2018-05-31 00:55:32 +00:00
examples [ORC] Update JITCompileCallbackManager to support multi-threaded code. 2018-05-30 01:57:45 +00:00
include [WebAssembly] Add Wasm exception handling prepare pass 2018-05-31 22:02:34 +00:00
lib [LoopIdiomRecognize] Only convert loops to ctlz if we can prove that the input is non-negative. 2018-05-31 22:16:55 +00:00
projects [cmake] Support moving debuginfo-tests to llvm/projects 2017-12-12 17:06:08 +00:00
resources
runtimes [CMake] Pass Clang defaults to runtimes builds 2018-05-22 00:43:04 +00:00
test [LoopIdiomRecognize] Only convert loops to ctlz if we can prove that the input is non-negative. 2018-05-31 22:16:55 +00:00
tools [WebAssembly] Add Wasm exception handling prepare pass 2018-05-31 22:02:34 +00:00
unittests [GISel]: Pattern matchers for GFSUB, GFNEG 2018-05-31 19:30:01 +00:00
utils [MCSchedule] Add the ability to compute the latency and throughput information for MCInst. 2018-05-31 13:30:42 +00:00
.arcconfig [llvm] Set up .arcconfig to point to Diffusion L repository 2018-01-12 15:37:41 +00:00
.clang-format
.clang-tidy
.gitattributes [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
.gitignore
CMakeLists.txt [cmake] Add a switch to enable/disable bindings. 2018-05-20 08:37:54 +00:00
CODE_OWNERS.TXT [CODE_OWNERS] Update my email address. 2018-04-23 19:09:49 +00:00
configure
CREDITS.TXT Update my information in the CREDITS file. 2018-05-23 14:44:42 +00:00
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT Update my email addresses, NFC. 2017-10-26 10:16:54 +00:00

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.