hanchenye-llvm-project/llvm
Nicolai Haehnle 870bf1788c [InstCombine] try to fold (select C, (sext A), B) into logical ops
Summary:
Turn (select C, (sext A), B) into (sext (select C, A, B')) when A is i1 and
B is a compatible constant, also for zext instead of sext. This will then be
further folded into logical operations.

The transformation would be valid for non-i1 types as well, but other parts of
InstCombine prefer to have sext from non-i1 as an operand of select.

Motivated by the shader compiler frontend in Mesa for AMDGPU, which emits i32
for boolean operations. With this change, the boolean logic is fully
recovered.

Reviewers: majnemer, spatel, tstellarAMD

Subscribers: llvm-commits

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

llvm-svn: 277801
2016-08-05 08:22:29 +00:00
..
bindings
cmake Remove LLVM_ENABLE_LIBCXXABI 2016-08-04 10:24:48 +00:00
docs [llvm-cov] Add some documentation for the -tab-size option 2016-08-04 18:00:42 +00:00
examples [ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol. 2016-08-01 20:49:11 +00:00
include IR: Provide an IRBuilder Inserter that calls a callback after insertion 2016-08-04 23:41:01 +00:00
lib [InstCombine] try to fold (select C, (sext A), B) into logical ops 2016-08-05 08:22:29 +00:00
projects
resources
runtimes
test [InstCombine] try to fold (select C, (sext A), B) into logical ops 2016-08-05 08:22:29 +00:00
tools [CodeView] Use llvm::Error instead of std::error_code. 2016-08-04 19:39:55 +00:00
unittests GlobalISel: refuse to halve size of 1-byte & odd-sized LLTs. 2016-08-04 20:54:05 +00:00
utils build_llvm_package.bat: try tests three times 2016-07-27 20:38:01 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.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 Adding RELEASE_TESTERS.TXT 2016-07-21 16:46:44 +00:00
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.