llvm-project/llvm
Noah Goldstein 0310f7f2d0 [InstCombine] Fold `(add X, (sext/zext (icmp eq X, C)))`
We can convert this to a select based on the `(icmp eq X, C)`, then
constant fold the addition the true arm begin `(add C, (sext/zext 1))`
and the false arm being `(add X, 0)` e.g

    - `(select (icmp eq X, C), (add C, (sext/zext 1)), (add X, 0))`.

This is essentially a specialization of the only case that sees to
actually show up from #89020

Closes #93840
2024-06-01 17:49:15 -05:00
..
benchmarks
bindings
cmake [cmake] Allow multiple LibEdit_LIBRARIES (#93896) 2024-05-31 11:36:33 -07:00
docs AMDGPU: Add gfx12-generic target (#93875) 2024-05-31 12:46:44 -04:00
examples [llvm] Revise IDE folder structure (#89741) 2024-05-25 13:28:30 +02:00
include [DAG] Replace getValid*ShiftAmountConstant helpers with getValid*ShiftAmount helpers to support KnownBits analysis (#93182) 2024-06-01 16:48:26 +01:00
lib [InstCombine] Fold `(add X, (sext/zext (icmp eq X, C)))` 2024-06-01 17:49:15 -05:00
projects
resources
runtimes [llvm] Revise IDE folder structure (#89741) 2024-05-25 13:28:30 +02:00
test [InstCombine] Fold `(add X, (sext/zext (icmp eq X, C)))` 2024-06-01 17:49:15 -05:00
tools [EntryExitInstrumenter] Move passes out of clang into LLVM default pipelines (#92171) 2024-05-31 12:48:45 -07:00
unittests [VPlan] Use ir-bb prefix for VPIRBasicBlock. 2024-05-30 17:43:40 -07:00
utils [gn] port a65771fce4 2024-05-31 13:22:57 -04:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt Reapply "[Support] Remove terminfo dependency (#92865)" (#93889) 2024-05-31 01:29:00 +02:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.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.