llvm-capstone/llvm
Craig Topper 70046438d0 [RISCV] Only try LUI+SH*ADD+ADDI for int materialization if LUI+ADDI+SH*ADD failed.
There's an assert in LUI+SH*ADD+ADDI materialization that makes sure the
lower 12 bits aren't zero since that case should have been handled as
LUI+ADDI+SH*ADD. But nothing prevented the LUI+SH*ADD+ADDI checks from
running after the earlier code handled it.

The sequence would be the same length or longer so it wouldn't replace
the earlier sequence, but the assert happened before that was checked.

The vector holding the sequence also wasn't reset before the second
check so that guaranteed the sequence would never be found to be
shorter.

This patch fixes this by only trying the second expansion when the
earlier fails.

Fixes PR54812.

Reviewed By: benshi001

Differential Revision: https://reviews.llvm.org/D123406
2022-04-09 08:52:15 -07:00
..
benchmarks
bindings
cmake Bump minimum toolchain version 2022-04-08 09:05:33 +02:00
docs Fix Sphinx build 2022-04-08 07:12:08 -04:00
examples Reland "[ELF] Enable new passmanager plugin support for LTO" 2022-03-24 16:29:18 +01:00
include [clang][OpenMP5.1] Initial parsing/sema for has_device_addr 2022-04-08 21:19:38 -07:00
lib [RISCV] Only try LUI+SH*ADD+ADDI for int materialization if LUI+ADDI+SH*ADD failed. 2022-04-09 08:52:15 -07:00
projects
resources
runtimes Revert "[runtimes] Create Tests.cmake if it does not exist" 2022-04-01 09:29:54 -07:00
test [RISCV] Only try LUI+SH*ADD+ADDI for int materialization if LUI+ADDI+SH*ADD failed. 2022-04-09 08:52:15 -07:00
tools [memprof] Deduplicate and outline frame storage in the memprof profile. 2022-04-08 09:15:20 -07:00
unittests [RGT] Use GTEST_SKIP() in more places where we skip a test 2022-04-08 15:20:53 -07:00
utils [gn build] Port a96443edde 2022-04-09 14:04:27 +00:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [cmake] Remove LLVM_ENABLE_NEW_PASS_MANAGER cmake option 2022-04-06 09:52:21 +02:00
CODE_OWNERS.TXT
configure
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
README.txt
RELEASE_TESTERS.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.