Fork of llvm with experimental commits and workarounds for RPCS3
Go to file
Andrea Di Biagio 3813edae72 [DAGcombiner] Fix incorrect sinking of a truncate into the operand of a shift.
This fixes a regression introduced by revision 268094.
Revision 268094 added the following dag combine rule:
// trunc (shl x, K) -> shl (trunc x), K => K < vt.size / 2

That rule converts a truncate of a shift-by-constant into a shift of a truncated
value. We do this only if the shift count is less than half the size in bits of
the truncated value (K < vt.size / 2).

The problem is that the constraint on the shift count is incorrect, so the rule
doesn't work well in some cases involving vector types. The combine rule should
have been written instead like this:
// trunc (shl x, K) -> shl (trunc x), K => K < vt.getScalarSizeInBits()

Basically, if K is smaller than the "scalar size in bits" of the truncated value
then we know that by "sinking" the truncate into the operand of the shift we
would never accidentally make the shift undefined.

This patch fixes the check on the shift count, and adds test cases to make sure
that we don't regress the behavior.

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

llvm-svn: 280482
2016-09-02 11:29:09 +00:00
bindings [OCaml] Add functions for accessing metadata nodes. 2016-06-22 03:30:24 +00:00
cmake [CMake] Revive LLVM_*_DIRS variables 2016-09-01 16:43:39 +00:00
docs Fixed a typo (LLVM/Support/CFG.h -> LLVM/IR/CFG.h) 2016-09-02 11:13:35 +00:00
examples Fix singlton -> singleton typo. 2016-08-26 02:00:21 +00:00
include [Support] - Fix possible crash in match() of llvm::Regex. 2016-09-02 08:44:46 +00:00
lib [DAGcombiner] Fix incorrect sinking of a truncate into the operand of a shift. 2016-09-02 11:29:09 +00:00
projects Remove autoconf support 2016-01-26 21:29:08 +00:00
resources In MSVC builds embed a VERSIONINFO resource in our exe and DLL files. 2015-06-12 15:58:29 +00:00
runtimes [CMake] Connecting check-all and test-depends targets correctly 2016-09-01 18:26:01 +00:00
test [DAGcombiner] Fix incorrect sinking of a truncate into the operand of a shift. 2016-09-02 11:29:09 +00:00
tools [llvm-readobj] - Teach readobj to print DT_AUXILIARY dynamic tag in human readable form. 2016-09-02 07:35:19 +00:00
unittests [PM] Try to fix an MSVC2013 failure due to finding a template 2016-09-02 10:49:58 +00:00
utils [lit] Fail testing if a googletest executable crashes during test discovery 2016-09-02 02:44:07 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.clang-format
.clang-tidy Don't use misc-unused-parameters check on LLVM. 2016-04-13 08:58:52 +00:00
.gitignore [CMake] Add LLVM runtimes directory 2016-06-23 22:07:21 +00:00
CMakeLists.txt [CMake] Connecting check-all and test-depends targets correctly 2016-09-01 18:26:01 +00:00
CODE_OWNERS.TXT test commit 2016-08-02 19:25:17 +00:00
configure Remove autoconf support 2016-01-26 21:29:08 +00:00
CREDITS.TXT Shamelessly add myself to CREDITS.TXT 2016-08-04 16:28:22 +00:00
LICENSE.TXT Remove autoconf references from LICENSE.TXT 2016-08-12 20:11:03 +00:00
llvm.spec.in [Sparc] Implement i64 load/store support for 32-bit sparc. 2015-08-10 19:11:39 +00:00
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

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.