Commit Graph

409446 Commits

Author SHA1 Message Date
Esme-Yi b28e8abfd0 [NFC][XCOFF][llvm-readobj] replace binaries with YAMLs (only tests for Symbols).
Summary: Since yaml2obj now supports converting AuxSymbols, we can use YAMLs as input for symbol-related tests of llvm-readobj instead of binaries.

Reviewed By: jhenderson, shchenz

Differential Revision: https://reviews.llvm.org/D114434
2022-01-11 06:17:16 +00:00
John Regehr 4eec1710c5 allow llvm-reduce, if asked, to run its set of passes more than once, taking longer to finish but also potentially resulting in a smaller reduced file. 2022-01-10 22:24:23 -07:00
Fangrui Song 5dbbd4eeb8 [ELF] Move OffsetGetter before some static functions. NFC
to prepare for D116881.
2022-01-10 20:16:02 -08:00
Fangrui Song 477bc36d3b [lld-macho] Change some global pointers to unique_ptr
Similar to D116143. My x86-64 `lld` is ~8KiB smaller.

Reviewed By: keith

Differential Revision: https://reviews.llvm.org/D116902
2022-01-10 19:39:14 -08:00
Fangrui Song 2968467e39 [lld-macho][test] Add missing coverage for archive/dylib resolution after D115092
When `file->fetch(sym)` is replaced with a no-op, no test fails.

The new test catches the case.

Reviewed By: #lld-macho, oontvoo

Differential Revision: https://reviews.llvm.org/D116916
2022-01-10 19:36:24 -08:00
Chenbing.Zheng 9ea772ff81 [RISCV] Block vmsgeu.vi with 0 immediate in Isel
For vmsgeu.vi with 0, we know this is always true. So we can replace
it with vmset.m (unmasked) or vmset.m+vmand.mm (masked).

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D116584
2022-01-11 03:04:44 +00:00
jacquesguan d0554ae4cf [RISCV] Select vl op to X0 when it is equal to ~0.
Now the backend will select ~0 vl to a register and load instruction, we could use X0 to replace it.

Differential Revision: https://reviews.llvm.org/D116798
2022-01-11 10:56:25 +08:00
jacquesguan 99c1acf3f1 [RISCV] Add precommit test for select vl op that equal to ~0.
Precommit test for D116798

Differential Revision: https://reviews.llvm.org/D116799
2022-01-11 10:54:50 +08:00
Jim Lin 905ac777d5 [M68k][test][NFC] Reorder the tests for MxBTST_MI and MxBTST_MR
Follow the order of definitions in M68kInstrBits.td
2022-01-11 10:43:35 +08:00
Haocong.Lu bd653f6406 [RISCV] Use shift for zero extension when Zbb and Zbp are not enabled
Now AND is used for zero extension when both Zbb and Zbp are not enabled.
It may be better to use shift operation if the trailing ones mask exceeds simm12.

This patch optimzes LUI+ADDI+AND to SLLI+SRLI.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D116720
2022-01-11 02:37:03 +00:00
Nick Desaulniers 649b11ef8b git-clang-format HEAD~ 2022-01-10 18:34:30 -08:00
Nick Desaulniers 301e911740 [TargetLowering] precommit refactor from D115688 NFC
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2022-01-10 18:32:13 -08:00
jacquesguan b607cd3928 [RISCV] Use vmv.s.x to build one element splat vector.
When we want to create an splat vector that only the first element is initialized, we could use vmv.s.x or vfmv.s.f to build it.

Differential Revision: https://reviews.llvm.org/D116277
2022-01-11 10:21:18 +08:00
Philip Reames f62f47f5e1 Partial revert of 82fb4f4
Two crashes have been reported.  This change disables the new logic while leaving the new node in tree.  Hopefully, that's enough to allow investigation without breakage while avoiding massive churn.
2022-01-10 18:18:34 -08:00
Philip Reames abc787fbf3 Delete a stale comment 2022-01-10 18:18:34 -08:00
Chuanqi Xu d9d63fc108 [AST] lookup in parent DeclContext for transparent DeclContext
The compiler would crash if we lookup for name in transparent decl
context. See the tests attached for example.

I think this should make sense since the member declared in transparent
DeclContext are semantically defined in the enclosing (non-transparent)
DeclContext, this is the definition for transparent DeclContext.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D116792
2022-01-11 10:16:26 +08:00
Craig Topper 9ef2175f81 [SelectionDAG] Add additional documentation to FP_TO_S/UINT_SAT to justify D116870. NFC
As noted in post-commit review, the value of the bits between
the saturating type and result type were not defined defined. Define
them to be sign extended for FP_TO_SINT_SAT and zero extended for
FP_TO_UINT_SAT.
2022-01-10 18:08:39 -08:00
Chuanqi Xu 86c5b870b2 [AST] Don't consider 'ExportDecl' when calculating DeclContext 'Encloses'
This mimics the style of 90010c2e1 (Don't consider 'LinkageSpec' when
calculating DeclContext 'Encloses'). Since ExportDecl and LinkageSpec
are transparent DeclContext, they share some similarity.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D116911
2022-01-11 09:54:57 +08:00
Mehdi Amini 63f0c00d38 Add a `qualified` directive to the Op, Attribute, and Type declarative assembly format
This patch introduces a new directive that allow to parse/print attributes and types fully
qualified.
This is a follow-up to ee0908703d which introduces the eliding of the `!dialect.mnemonic` by default and allows to force to fully qualify each type/attribute
individually.

Differential Revision: https://reviews.llvm.org/D116905
2022-01-11 01:30:19 +00:00
Jennifer Yu 140a6b1e5c [clang][OpenMP5.1] Initial parsing/sema for 'indirect' clause
Differential Revision: https://reviews.llvm.org/D116764
2022-01-10 16:58:56 -08:00
Sam McCall 4258d68dc7 [Tooling] When transferring compile commands between files, always use '--'
"driver <flags> -- <input>" is a particularly convenient form of the
compile command to manipulate, with fewer special cases to handle.

Guaranteeing that the output command is of that form is cheap and makes
it easier to consume the result in some cases.

Differential Revision: https://reviews.llvm.org/D116721
2022-01-11 01:41:42 +01:00
Wolfgang Pieb d789ea7133 [Diagnostics] Don't drop a statically set NoWarningAsError flag during option processing
When a -W<diag> option is given on the command line, and the corresponding diagnostic has
the NoWarnOnError flag set, prevent the flag from being dropped when the severity is reevaluated.
This fixes PR51837.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D109981
2022-01-10 16:38:01 -08:00
Casey Carter 1d3964d2ad [libcxx][test] Make LIBCPP_STATIC_ASSERT usable at namespace scope
... even when `!defined(_LIBCPP_VERSION)`. (Note that the previous definition for this case - `((void)0);` - is ill-formed at namespace scope.) Ditto for `LIBCPP_ASSERT`, `LIBCPP_ASSERT_NOEXCEPT`, `LIBCPP_ASSERT_NOT_NOEXCEPT`, and `LIBCPP_ONLY`.

Differential Revision: https://reviews.llvm.org/D116880
2022-01-10 16:35:31 -08:00
Adrian Prantl eb200e584e Emit the C++ dialect in -gmodules .pcm files.
Because of commit: https://reviews.llvm.org/D104291 the -gmodules .pcm
files do not have the same DW_AT_language dialect as the .o file. This
was a simple matter of passing the DebugStrictDwarf flag to the
PCHContainerGenerator object's CodeGenOpts from the CompilerInstance
passed in to it.

Before this change if you ran dwarfdump on the gmodule cache folder
you would get DW_AT_language (DW_LANG_C_plus_plus) even when using
-std=c++14 with clang

Patch by Shubham Rastogi!

Differential Revision: https://reviews.llvm.org/D116790
2022-01-10 16:13:40 -08:00
Keith Smiley bfeb92cb9c docs: update some bug tracker references (NFC)
Fixes https://github.com/llvm/llvm-project/issues/53091

Differential Revision: https://reviews.llvm.org/D116898
2022-01-10 15:59:08 -08:00
Sam McCall bbf234b56a [CodeCompletion] Complete designators for fields in anonymous structs/unions
Fixes https://github.com/clangd/clangd/issues/836

Differential Revision: https://reviews.llvm.org/D116717
2022-01-11 00:58:49 +01:00
Philip Reames ed7ae1af72 Add coverage of GlobalsModRef's indirect global case 2022-01-10 15:54:26 -08:00
Siva Chandra 371779fac1 [libc] Add linux aarch64 syscall implementation.
Add mmap and munmap to the linux aarch64 entrypoint list as the first
user of these syscalls.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D116949
2022-01-10 15:53:17 -08:00
Mircea Trofin b191c1f0f9 [NFC][regalloc] Pull out some AllocationOrder/CostPerUseLimit eviction logic
We are reusing that logic in the ML implementation.

Differential Revision: https://reviews.llvm.org/D116075
2022-01-10 15:47:31 -08:00
Philip Reames 5265ac72c6 [MemoryBuiltin] Add an API for checking if an unused allocation can be removed [NFC]
Not all allocation functions are removable if unused.  An example of a non-removable allocation would be a direct call to the replaceable global allocation function in C++.  An example of a removable one - at least according to historical practice - would be malloc.
2022-01-10 15:43:39 -08:00
Craig Topper 38b30eb2b2 [LowerMatrixIntrinsics] Call getRegisterClassForType before getNumberOfRegisters.
getNumberOfRegisters takes a ClassID as it's argument. It shouldn't be passed a bool. Assuming the bool meant vector or not, we should call getRegisterClassForType first.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D116903
2022-01-10 15:32:13 -08:00
Richard a2c33b0ec9 [clang-tidy] Refactor: Extract Class CheckRunner on check_clang_tidy.py
Break up the huge function by extracting a class, storing intermediate
state as class members and breaking up the big function into a group
of class methods all at the same level of abstraction.

Differential Revision: https://reviews.llvm.org/D56343
2022-01-10 15:44:12 -07:00
Yaxun (Sam) Liu 98ab43a1d2 [HIP] Fix device only linking for -fgpu-rdc
Currently when -fgpu-rdc is specified, HIP toolchain always does host linking even
if --cuda-device-only is specified.

This patch fixes that. Only device linking is performed when --cuda-device-only
is specified.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D116840
2022-01-10 17:38:02 -05:00
Lirong Yuan 1267506ea5 [lldb] fix memory leak in "GetGDBServerRegisterInfoXMLAndProcess"
While running heap checker on a test that uses LLDB API, the following memory leak is found:

RAW: HeapChecker started...
RAW: Leak check _main_ detected leaks of 34 bytes in 4 objects
RAW: The 2 largest leaks:
RAW: Leak of 17 bytes in 2 objects allocated from:
@ 0x7fb93bd20166 NewHook()
@ 0x7fb929372a73 absl::base_internal::MallocHook::InvokeNewHookSlow()
@ 0x5600d1046093 libc_malloc
@ 0x7fb974529c03 xmlStrdup
@ 0x7fb9744c2a0b xmlGetProp
@ 0x7fb9749d9ed6 lldb_private::XMLNode::GetAttributeValue()
@ 0x7fb979043001 std::u::function::policy_invoker<>::__call_impl<>()
@ 0x7fb9749da06d lldb_private::XMLNode::ForEachChildElement()
@ 0x7fb97903c54d lldb_private::process_gdb_remote::ProcessGDBRemote::GetGDBServerRegisterInfoXMLAndProcess()
@ 0x7fb97902cfe4 lldb_private::process_gdb_remote::ProcessGDBRemote::GetGDBServerRegisterInfo()
@ 0x7fb97902c1d0 lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo()
@ 0x7fb97902e92a lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo()
@ 0x7fb97902db18 lldb_private::process_gdb_remote::ProcessGDBRemote::DoConnectRemote()
@ 0x7fb97584965e lldb_private::Process::ConnectRemote()
@ 0x7fb975839fa6 lldb_private::Platform::DoConnectProcess()
@ 0x7fb97583a39e lldb_private::Platform::ConnectProcessSynchronous()
@ 0x7fb97545b28b CommandObjectProcessConnect::DoExecute()
@ 0x7fb9755a70c9 lldb_private::CommandObjectParsed::Execute()
@ 0x7fb97559c0e9 lldb_private::CommandInterpreter::HandleCommand()
@ 0x7fb975460145 lldb_private::CommandObjectRegexCommand::DoExecute()
@ 0x7fb9755a72d2 lldb_private::CommandObjectRaw::Execute()
@ 0x7fb97559c0e9 lldb_private::CommandInterpreter::HandleCommand()
@ 0x7fb997a5f22e lldb::SBCommandInterpreter::HandleCommand()
@ 0x7fb997a5ef9b lldb::SBCommandInterpreter::HandleCommand()

This change fixes the memory leaks by freeing memory after it is no
longer in use. Tested with "ninja check-lldb".

Differential revision: https://reviews.llvm.org/D116707
2022-01-10 14:33:09 -08:00
Tyler Augustine 87a9be2a74 Don't fail if unable to promote loops during unrolling
When the unroll factor is 1, we should only fail "unrolling" when the trip count also is determined to be 1 and it is unable to be promoted.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D115365
2022-01-10 22:26:21 +00:00
Nikolas Klauser 2154dbaa59 [libc++][NFC] Use _LIBCPP_DEBUG_ASSERT in <list>
Use `_LIBCPP_DEBUG_ASSERT` in `<list>`

Reviewed By: Quuxplusone, ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D116938
2022-01-10 23:19:16 +01:00
Jon Chesterfield a74826d30a [openmp][amdgpu] Replace unsigned long with uint64_t
Some types need to be 64 bit. Unsigned long is a hazard there.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D116963
2022-01-10 22:19:30 +00:00
Casey Carter a765eea153 [libcxx][test] Auto-detect _LIBCPP_HAS_NO_UNICODE for MSVC STL
... by examining `_MSVC_EXECUTION_CHARACTER_SET` in the force-include header.

Differential Revision: https://reviews.llvm.org/D116883
2022-01-10 13:56:22 -08:00
Nadav Rotem e2cc091a7d Fix a missed opportunity to merge stores.
This commit fixes a missed opportunity in merging consecutive stores.
The code that searches for stores skipped the case of stores that
directly connect to the root. The comment above the implementation lists
this case but the code did not handle it. I found this pattern when
looking into the shared_ptr destructor. GCC generates the right
sequence. Here is a small repo:

    int foo(int* buff) {
        buff[0] = 0;
        int x = buff[1];
        buff[1] = 0;
        return x;
    }

Differential Revision: https://reviews.llvm.org/D116895
2022-01-10 13:49:02 -08:00
Jonas Devlieghere 8bed953782 [llvm] Fix the module build
Fix the module build after 2c0fb96254
2022-01-10 13:40:28 -08:00
John Ericson 847eefe5bf [doc][cmake] Convert read-me for the common CMake utils to reST
@phosek mentioned others might want it reST for consistency. As I
personally do not like Markdown at all and just did the "usual GitHub
read-me thing" out of habit, I am more than happy to oblige.

Also fix the typos found in the original.

Reviewed By: phosek, lebedev.ri

Differential Revision: https://reviews.llvm.org/D116524
2022-01-10 21:36:11 +00:00
Louis Dionne 84654f2733 [libc++] Refactor the tests for std::random_device
That will make it easier to change the behavior of the arc4random()
based implementation. Note that in particular, the eval.pass.cpp test
used to work with non "/dev/random" based implementations because we'd
throw an exception upon constructing the random_device. This patch makes
the intent of the test clearer.
2022-01-10 16:34:16 -05:00
John Ericson 914fffc7f2 [libunwind][cmake] Create `LIBUNWIND_INSTALL_INCLUDE_DIR` CACHE PATH
This is created on analogy with the other CACHE PATHs in this package,
and other `*_INSTALL_INCLUDE_DIR` in other packages.

The branching is adjusted to deduplicate some existing code, and
likewise avoid having to define this new variable more than once.

This will be used for D99484.

Reviewed By: #libunwind, compnerd

Differential Revision: https://reviews.llvm.org/D116873
2022-01-10 21:31:52 +00:00
Arthur O'Dwyer 4d81a46f7f [libc++] Alphabetize header #includes. NFCI.
The NFC part of D116809. We still want to enforce this in CI,
but the mechanism for that is still to-be-determined.

Differential Revision: https://reviews.llvm.org/D116809
2022-01-10 16:30:38 -05:00
Roland McGrath ce167c6fb2 [libcxx] Use Fuchsia-native monotonic clock for std::chrono::steady_clock
Use the zx_clock_get_monotonic system call directly rather than
going through the POSIX clock_gettime function.  The libc function
is a trivial wrapper around the system call, and is not a standard C
function.  Avoiding it reduces the Fuchsia libc ABI surface that
libc++ depends on.

Reviewed By: phosek, ldionne, #libc

Differential Revision: https://reviews.llvm.org/D116606
2022-01-10 13:14:50 -08:00
Arthur O'Dwyer c9f83a8af9 [libc++] Alphabetize CMakeLists.txt and module.modulemap. NFC.
The NFC part of D116958. We still want to enforce this in CI,
but the mechanism for that is still to-be-determined.
2022-01-10 15:38:40 -05:00
Jonas Devlieghere da4b7437f9 [lldb] Remove LLDB_RECORD_DUMMY_* macros 2022-01-10 12:05:54 -08:00
Jonas Devlieghere 69c55d6362 [lldb] Remove LLDB_RECORD_CHAR_PTR_* macros 2022-01-10 11:57:20 -08:00
Mircea Trofin e121269131 [NFC][regalloc] Pass RAGreedy to eviction adviser
This patch simplifies the interface between RAGreedy and the eviction
adviser by passing the allocator to the adviser, which allows the latter
to extract needed information as needed, rather than requiring it be passed
piecemeal at construction time (which would also complicate later
evolution).

Part of this, the patch also moves ExtraRegInfo back to RAGreedy. We
keep the encapsulation of ExtraRegInfo because it has benefits (e.g.
improved readability by abstracting access to the cascade info) and also
simpler re-initialization at regalloc pass re-entry time (we just flush
the Optional).

Differential Revision: https://reviews.llvm.org/D116669
2022-01-10 11:55:16 -08:00
Peter Steinfeld c0add1636d [flang] Fix the documentation on how to build flang
I recently had an email exchange on flang-dev that revealed that the
documentation on how to build flang is incorrect.  This update fixes
that.

Differential Revision: https://reviews.llvm.org/D116566
2022-01-10 11:54:00 -08:00