[Hexagon] assert getRegisterBitWidth returns non-zero value. NFCI.
Fixes scan-build warning.
Mark tests from r361278 as unsupported on Windows.
DWARF: Add debug_ranges/rnglists tests
.debug_ranges parsing is not well tested  because this
section tends to be only used in optimized code, and we don't build
optimized executables in our tests, as they produce unpredictable
This patch aims to add some very simple tests for parsing static range
data, which can serve as a first line of defense in case things break.
I also include one XFAILed test, which demonstrates that we don't
correctly handle mixed DWARF v5 and v4 ranges in a single file.
[ARM][AArch64] Fix incorrect handling of alignment in va_arg code generation
Overaligned and underaligned types (i.e. types where the alignment has been
increased or decreased using the aligned and packed attributes) weren't being
correctly handled in all cases, as the unadjusted alignment should be used.
This patch also adjusts getTypeUnadjustedAlign to correctly handle typedefs of
non-aggregate types, which it appears it never had to handle before.
Differential Revision: https://reviews.llvm.org/D62152
[VirtualFileSystem] Fix uninitialized variable warning. NFCI.
[TargetMachine] error message unsupported code model
When the tiny code model is requested for a target machine that does not
support this, we get an error message (which is nice) but also this diagnostic
and request to submit a bug report:
fatal error: error in backend: Target does not support the tiny CodeModel
[Inferior 2 (process 31509) exited with code 0106]
clang-9: error: clang frontend command failed with exit code 70 (use -v to see invocation)
(gdb) clang version 9.0.0 (http://llvm.org/git/clang.git 29994b0c63a40f9c97c664170244a7bba5ecc15e) (http://llvm.org/git/llvm.git 95606fdf91c2d63a931e865f4b78b2e9828ddc74)
Thread model: posix
clang-9: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-9: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/tiny-dfe1a2.c
clang-9: note: diagnostic msg: /tmp/tiny-dfe1a2.sh
clang-9: note: diagnostic msg:
But this is not a bug, this is a feature. :-) Not only is this not a bug, this
is also pretty confusing. This patch causes just to print the fatal error and
not the diagnostic:
fatal error: error in backend: Target does not support the tiny CodeModel
Differential Revision: https://reviews.llvm.org/D62236
[Driver][Windows] Add dependent lib argument for -fprofile-generate and -fcs-profile-generate
Follows on from r360674 which added it for -fprofile-instr-generate.
Differential Revision: https://reviews.llvm.org/D62200
[llvm-dlltool] Respect NONAME keyword
This adds proper handling of the NONAME-keyword, which makes llvm-dlltool
generate an import using the ordinal instead of the name.
Patch by by Jannik Vogel, test added by Stefan Schmidt.
Differential Revision: https://reviews.llvm.org/D62175
Re-land r361257 "[MergeICmps][NFC] Make BCEAtom move-only.""
[PPC64] Fix PPC64TargetInfo ABI on clang side after D61950
Copy symbol length when we replace a symbol.
Symbol's NameSize is computed lazily. Currently, when we replace a symbol,
a cached length value can be discarded. This patch propagates that value.
Differential Revision: https://reviews.llvm.org/D62234
[PPC64] Fix PPC64TargetInfo after D61950
Add AST logging
Log the AST of the TU associated with LLDB's `expr` command, once a declaration
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, lldb-commits
Differential Revision: https://reviews.llvm.org/D62061
DWARFDebugInfoEntry: remove unused variable
DWARF: Introduce DWARFTypeUnit class
This patch introduces the DWARFTypeUnit class, and teaches lldb to parse
type units out of both the debug_types section (DWARF v4), and from the
regular debug_info section (DWARF v5).
The most important piece of functionality - resolving DW_AT_signatures
to connect type forward declarations to their definitions - is not
implemented here, but even without that, a lot of functionality becomes
available. I've added tests for the commands that start to work after
The changes in this patch were greatly inspired by D61505, which in turn took
over changes from D32167.
Reviewers: JDevlieghere, clayborg, aprantl
Subscribers: mgorny, jankratochvil, lldb-commits
Differential Revision: https://reviews.llvm.org/D62008
[ELF] Improve error message for relocations to symbols defined in discarded sections
Rather than report "undefined symbol: ", give more informative message
about the object file that defines the discarded section.
In particular, PR41133, if the section is a discarded COMDAT, print the
section group signature and the object file with the prevailing
definition. This is useful to track down some ODR issues.
We need to
* add `uint32_t DiscardedSecIdx` to Undefined for this feature.
* make ComdatGroups public and change its type to DenseMap<CachedHashStringRef, const InputFile *>
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D59649
Delete unnecessary copy ctors
[Sanitizer] Add interceptor for wcsdup
Summary: The wide-string equivalent of strdup. Implementation trivial.
Reviewers: vitalybuka, eugenis
Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D62189
[MIR] Add simple PRE pass to MachineCSE
This is the second part of the commit fixing PR38917 (hoisting
partitially redundant machine instruction). Most of PRE (partitial
redundancy elimination) and CSE work is done on LLVM IR, but some of
redundancy arises during DAG legalization. Machine CSE is not enough
to deal with it. This simple PRE implementation works a little bit
intricately: it passes before CSE, looking for partitial redundancy
and transforming it to fully redundancy, anticipating that the next
CSE step will eliminate this created redundancy. If CSE doesn't
eliminate this, than created instruction will remain dead and eliminated
later by Remove Dead Machine Instructions pass.
The third part of the commit is supposed to refactor MachineCSE,
to make it more clear and to merge MachinePRE with MachineCSE,
so one need no rely on further Remove Dead pass to clear instrs
not eliminated by CSE.
First step: https://reviews.llvm.org/D54839
[PPC64] Parse -elfv1 -elfv2 when specified on target triple
For big-endian powerpc64, the default ABI is ELFv1. OpenPower ABI ELFv2 is supported when -mabi=elfv2 is specified. FreeBSD support for PowerPC64 ELFv2 ABI with LLVM is in progress. This patch adds an alternative way to specify ELFv2 ABI on target triple .
The following results are expected:
ELFv1 when using:
-target powerpc64-unknown-freebsd12.0 -mabi=elfv1
ELFv2 when using:
-target powerpc64-unknown-freebsd12.0 -mabi=elfv2
Patch by Alfredo Dal'Ava Júnior!
Differential Revision: https://reviews.llvm.org/D61950
[AArch64] Subtarget crypto extension defaults
The Armv8.2-A crypto extensions all defaulted to true, but should default to
false, like all the other extensions.
Differential Revision: https://reviews.llvm.org/D62180
Fixed a -Wunused-variable warning when assertions are disabled
[X86] Don't compare i128 through vector if construction not cheap (PR41971)
Fix for https://bugs.llvm.org/show_bug.cgi?id=41971. Make the
combineVectorSizedSetCCEquality() transform more conservative by
checking that the bitcast to the vector type will be cheap/free
for both operands. I'm considering it cheap if it's a constant,
a load or already a vector. I've dropped the explicit check for
f128 because it should fall out naturally (in the cases where
it'd be detrimental).
Differential Revision: https://reviews.llvm.org/D62220
Properly categorize llvm-objdump options
Filters out noise, and distinguish Mach-O related options from others.
Differential Revision: https://reviews.llvm.org/D62195
Simplify the logic to instantiate Symbols. Should be NFC.
[NFC] Remove a blank line (test commit)
Speculative fix for std stream destruction order on Windows.
The MSVC CRT uses TLS storage to implement per-thread locales.
This storage gets freed during program termination, and if we attempt
to do any io operations (like flushing the std streams) after this occurs
the program may abort.
This patch is a speculative fix for that issue.
The fix tries forcing the initialization of the locale TLS before
initializing the std streams. This should mean that the TLS is freed
after we destroy the streams.
[PowerPC] use meaningful name for displacement form aligned with x-form - NFC
[PowerPC] [ISEL] select x-form instruction for unaligned offset
Differential Revision: https://reviews.llvm.org/D62173
[docs] Fix troff macro (.F1 -> .Fl) in ld.lld.1
[clang-tidy] remove default header-filter for run-clang-tidy
run-clang-tidy.py was enforcing '-header-filter' parameter with an
unfortunate default value when none was given. Thus, leading to
overwritten clang-tidy configuration (e.g. from .clang-tidy).
This change removes the default value for '-header-filter' resulting in
the default behaviour of clang-tidy itself.
Reviewed By: hintonda
Patch by Torbjörn Klatt!
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D61747
[Docs] Increase Doxygen cache size
When building Doxygen docs for llvm and clang, it helpfully prints a warning at
the end noting that the `LOOKUP_CACHE_SIZE` value was too small to keep all
symbols in memory.
By increasing to the size it recommends, Doxygen builds have greatly improved
performance. On my machine, time to run `doxygen-llvm` changes from 34 minutes
to 22 minutes, which is a decent amount of time saved by changing a single
Reviewed By: hintonda
Patch by J. Ryan Stinnett!
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D62138
[X86] [CET] Deal with return-twice function such as vfork, setjmp when
Return-twice functions will indirectly jump after the caller's position.
So when CET-IBT is enable, we should make sure these is endbr*
instructions follow these Return-twice function caller. Like GCC does.
Patch by Xiang Zhang (xiangzhangllvm)
Differential Revision: https://reviews.llvm.org/D61881
[Docs] fix formatting for bullet list; NFC
[Analysis] Link library dependencies to Analysis plugins
These are needed to avoid undefined symbols which aren't satisfied
by Clang itself.
Differential Revision: https://reviews.llvm.org/D62174
[libFuzzer] Sleep after process exits in merge-sigusr.test.
Ensure that log file has been fully updated before trying to read it.
[InstCombine] fold shuffles of insert_subvectors
This should be a valid exception to the general rule of not creating new shuffle masks in IR...
because we already do it. :)
Also, DAG combining/legalization will undo this by widening the shuffle back out if needed.
Explanation for how we already do this: SLP or vector source can create chains of insert/extract
as shown in 1 of the examples from PR16739:
And we expect instcombine or DAGCombine to clean that up by creating relatively simple shuffles.
Differential Revision: https://reviews.llvm.org/D62024
[Symbol] Remove dead code
[libFuzzer] Kill by session ID in merge-sigusr.test.
Ensures that parent and all child processes are killed at once.
[PragmaHandler] Expose `#pragma` location
Currently, a pragma AST node's recorded location starts at the
namespace token (such as `omp` in the case of OpenMP) after the
`#pragma` token, and the `#pragma` location isn't available. However,
the `#pragma` location can be useful when, for example, rewriting a
directive using Clang's Rewrite facility.
This patch makes `#pragma` locations available in any `PragmaHandler`
but it doesn't yet make use of them.
This patch also uses the new `struct PragmaIntroducer` to simplify
`Preprocessor::HandlePragmaDirective`. It doesn't do the same for
`PPCallbacks::PragmaDirective` because that changes the API documented
in `clang-tools-extra/docs/pp-trace.rst`, and I'm not sure about
backward compatibility guarantees there.
Reviewed By: ABataev, lebedev.ri, aaron.ballman
Differential Revision: https://reviews.llvm.org/D61643
Fix target property to make BUILD_SHARED_LIBS work
Public and Private link libraries get merged in the LINK_LIBRARIES property instead of being kept separate.
With any luck this will get `BUILD_SHARED_LIBS` working again on Linux.
AMDGPU: Assume calls read exec
AMDGPU: Add some tests for inlineasm behavior
AMDGPU: Assume call pseudos are convergent
There should probably be nonconvergent versions, but my guess is it
doesn't matter in practice.
AMDGPU: Fix not marking new gfx10 SGPRs as CSRs
[c++20] P1330R0: permit simple-assignments that change the active member
of a union within constant expression evaluation.
Refactor: split Uninitialized state on APValue into an "Absent" state
representing no such object, and an "Indeterminate" state representing
an uninitialized object. The latter is not yet used, but soon will be.
[WebAssembly] Add the signature for the new llround builtin function
r360889 added new llround builtin functions. This patch adds their
signatures for the WebAssembly backend.
It also adds wasm32 support to utils/update_llc_test_checks.py, since
that's the script other targets are using for their testcases for this
Differential Revision: https://reviews.llvm.org/D62207
[libFuzzer] Ignore exit status of wait in merge-sigusr.test.
If process $PID has already exited, wait will give a non-zero exit
Rename identifiers to spell out analyze; NFC.