llvm-project/llvm
David Bolvansky dbcdad51ff [InstCombine] (1 << (C - x)) -> ((1 << C) >> x) if C is bitwidth - 1
Summary:
```
%a = sub i32 31, %x
%r = shl i32 1, %a
  =>
%d = shl i32 1, 31
%r = lshr i32 %d, %x

Done: 1
Optimization is correct!
```

https://rise4fun.com/Alive/btZm

Reviewers: spatel, lebedev.ri, nikic

Reviewed By: lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 364073
2019-06-21 16:25:32 +00:00
..
benchmarks
bindings [bindings/go][NFC] Format code with go fmt 2019-06-12 11:59:09 +00:00
cmake Specify log level for CMake messages (less stderr) 2019-06-19 15:25:32 +00:00
docs [docs][llvm-objdump] Fix bad merge of docs 2019-06-21 14:41:36 +00:00
examples
include Fix a crash with assembler source and -g. 2019-06-21 13:10:19 +00:00
lib [InstCombine] (1 << (C - x)) -> ((1 << C) >> x) if C is bitwidth - 1 2019-06-21 16:25:32 +00:00
projects
resources
runtimes Setup testing target dependencies for default runtimes 2019-06-11 00:25:57 +00:00
test [InstCombine] (1 << (C - x)) -> ((1 << C) >> x) if C is bitwidth - 1 2019-06-21 16:25:32 +00:00
tools [MCA][Bottleneck Analysis] Teach how to compute a critical sequence of instructions based on the simulation. 2019-06-21 13:32:54 +00:00
unittests TargetParserTest.ARMExtensionFeatures run out of memory on 32-bit (PR42316) 2019-06-20 09:33:11 +00:00
utils [GN] Fix check-clang by disabling plugins 2019-06-21 09:54:32 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore gitignore: Ignore Qt Creator project configuration files. NFC 2019-06-12 08:28:31 +00:00
CMakeLists.txt build: extract LLVM distribution target handling 2019-06-14 18:28:57 +00:00
CODE_OWNERS.TXT
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.