llvm-capstone/llvm
Craig Topper f14e62c9a5 [EarlyCSE] Improve EarlyCSE of some absolute value cases.
Change matchSelectPattern to return X and -X for ABS/NABS in a well defined order. Adjust EarlyCSE to account for this. Ensure the SPF result is some kind of min/max and not abs/nabs in one place in InstCombine that made me nervous.

Prevously we returned the two operands of the compare part of the abs pattern. The RHS is always going to be a 0i, 1 or -1 constant. This isn't a very meaningful thing to return for any one. There's also some freedom in the abs pattern as to what happens when the value is equal to 0. This freedom led to early cse failing to match when different constants were used in otherwise equivalent operations. By returning the input and its negation in a defined order we can ensure an exact match. This also makes sure both patterns use the exact same subtract instruction for the negation. I believe CSE should evebntually make this happen and properly merge the nsw/nuw flags. But I'm not familiar with CSE and what order it does things in so it seemed like it might be good to really enforce that they were the same.

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

llvm-svn: 332865
2018-05-21 18:42:42 +00:00
..
bindings [LLVM-C] Consolidate llgo's DIBuilder Bindings 2018-05-10 21:10:06 +00:00
cmake Revert 332750, llvm part (see comment on D46910). 2018-05-20 23:03:17 +00:00
docs Dissallow non-empty metadata for invariant.group 2018-05-18 23:53:46 +00:00
examples [ORC] Rewrite the VSO symbol table yet again. Update related utilities. 2018-05-16 22:24:30 +00:00
include [EarlyCSE] Improve EarlyCSE of some absolute value cases. 2018-05-21 18:42:42 +00:00
lib [EarlyCSE] Improve EarlyCSE of some absolute value cases. 2018-05-21 18:42:42 +00:00
projects
resources
runtimes [CMake] Support runtimes in distributions 2018-05-17 16:58:44 +00:00
test [EarlyCSE] Improve EarlyCSE of some absolute value cases. 2018-05-21 18:42:42 +00:00
tools MC: Change object writers to use endian::Writer. NFCI. 2018-05-21 18:17:42 +00:00
unittests [DWARF] Refactor callback usage for .debug_line error handling 2018-05-21 15:30:54 +00:00
utils Add Script to match open Phabricator reviews with potential reviewers. 2018-05-18 13:02:32 +00:00
.arcconfig
.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
configure
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
README.txt
RELEASE_TESTERS.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.