Commit Graph

436398 Commits

Author SHA1 Message Date
Jun Zhang 303526ef3a
[Docs] Add a link that refers to C++ standard modules in Clang modules doc
Currently there're two pages that both talk about "Modules" in clang, but
they're different. The one that describes C++ standard modules explicitly
spells out the difference but the other one which targeting Clang modules
doesn't.

This patch adds a link that refers to the C++ standard modules
one in Clang modules doc, as you usually got the later page when
googling. I believe this will make newcomers less confused.

Signed-off-by: Jun Zhang <jun@junz.org>

Differential Revision: https://reviews.llvm.org/D134105
2022-09-18 18:31:49 +08:00
Phoebe Wang 490de4ab47 [Clang][NFC] update obsolete check predicate 2022-09-18 18:00:36 +08:00
Nikolas Klauser 7afa1598a3 [libc++] Avoid including <tuple> in compressed_pair.h
compressed_pair is widely used in the library, but most of the uses don't use the tuple parts. To avoid including <tuple> everywhere, use the forward declaration instead in compressed_pair.h

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D133331
2022-09-18 10:49:35 +02:00
Chuanqi Xu 762962174e [Modules] Don't judge if we're compiling a module unit by LangOpts::CurrentModule.empty()
Closing https://github.com/llvm/llvm-project/issues/57778.

Previously it judge if we're compiling a module unit by
LangOpts::CurrentModule.empty(). But it is not true since we can specify
the module name by `-fmodule-name` option for arbitrary module unit.
Then this patch adjuest the judgement properly.
2022-09-18 16:43:30 +08:00
Benjamin Kramer b987fe4972 Silence unused variable warning in release builds. NFC 2022-09-18 09:15:32 +02:00
Shivam Gupta 4667821151 [NFC] Typo fix in ARCMTActions.h 2022-09-18 12:34:24 +05:30
Kazu Hirata 284f0397e2 [Transforms] Merge function attributes within InlineFunction (NFC)
In the past, we've had a bug resulting in a compiler crash after
forgetting to merge function attributes (D105729).

This patch teaches InlineFunction to merge function attributes.  This
way, we minimize the "time" when the IR is valid, but the function
attributes are not.

Differential Revision: https://reviews.llvm.org/D134117
2022-09-17 23:10:23 -07:00
Kazu Hirata cf355bf36e [Analysis] Introduce isSoleCallToLocalFunction (NFC)
We check to see if a given CallBase is a sole call to a local function
at multiple places in InlineCost.cpp.  This patch factors out the
common code.

Differential Revision: https://reviews.llvm.org/D134114
2022-09-17 20:59:54 -07:00
Yaxun (Sam) Liu 97b5736975 [SimplifyCFG] add a test for branch folding multiple BB
Reviewed by: Florian Hahn

Differential Revision: https://reviews.llvm.org/D132910
2022-09-17 21:17:55 -04:00
Kai Nacke ae35188f97 [GISel] Fix match tree emitter.
The following changes are necessasy to get the generated tree
matcher to compile:

- In CodeExpansions::declare(), the assert() prevents connecting
  two instructions. E.g. the match code
    (match (MUL $t, $s1, $s2),
           (SUB $d, $t, $s3)),
  results in two declarations of $t, one for the def and one for
  the use. Removing the assertion allows this construct.
  If $t is later used, it is one of the operands, which should be
  perfectly fine.
- The code emitted in GIMatchTreeVRegDefPartitioner::generatePartitionSelectorCode()
  is not compilable:
  - The value of NewInstrID should be emitted, not the name
  - Both calls involving getOperand() end with one parenthesis too many
- Swaps generated condition for the partition code in the latter function

It also changes the rules i2p_to_p2i, fabs_fabs_fold, and fneg_fneg_fold
to use the tree matcher for a linear match. These rules are tested by:

CodeGen/AArch64/GlobalISel/combine-fabs.mir
CodeGen/AArch64/GlobalISel/combine-fneg.mir
CodeGen/AArch64/GlobalISel/combine-ptrtoint.mir
CodeGen/AMDGPU/GlobalISel/combine-add-nullptr.mir

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D133257
2022-09-18 00:00:15 +00:00
Kazu Hirata 6e4fbd2f51 [ModuleInliner] Set Changed earlier (NFC)
It makes more sense to set Changed to true immediately after a
successful inlining.
2022-09-17 14:16:32 -07:00
isuckatcs 6931d311ea [analyzer] Cleanup some artifacts from non-POD array evaluation
Most of the state traits used for non-POD array evaluation were
only cleaned up if the ctors/dtors were inlined, since the cleanup
happened in ExprEngine::processCallExit(). This patch makes sure
they are removed even if said functions are not inlined.

Differential Revision: https://reviews.llvm.org/D133643
2022-09-17 22:46:27 +02:00
Kazu Hirata 0a706be316 [mlir] Don't include SetVector.h (NFC) 2022-09-17 13:36:16 -07:00
Kazu Hirata f46245c3e9 [lld] Don't include SetVector.h (NFC) 2022-09-17 13:36:15 -07:00
Kazu Hirata 8009d236e5 [clang] Don't include SetVector.h (NFC) 2022-09-17 13:36:13 -07:00
LLVM GN Syncbot 51b6dece1e [gn build] Port e5e3dccd07 2022-09-17 19:55:35 +00:00
Aiden Grossman e5e3dccd07 [mlgo] Add in-development instruction based features for regalloc advisor
This patch adds in instruction based features to the regalloc advisor
gated behind a flag so a user can decide at runtime whether or not they
want to enable the feature. The features are only enabled when LLVM is
compiled in MLGO develpment mode (LLVM_HAVE_TF_API) is set to true.

To extract the instruction features, I'm taking a list of segments from
each LiveInterval and noting the start and end SlotIndices. This list is then
sorted based on the start SlotIndex and I iterate through each SlotIndex
to grab instructions, making sure to check for overlaps. This results in
a vector of opcodes and binary mapping matrix that maps live ranges to the
opcodes of the instructions within that LR.

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D131930
2022-09-17 19:54:45 +00:00
Kazu Hirata 20d764aff0 [llvm] Don't including SetVector.h (NFC)
llvm/lib/ProfileData/RawMemProfReader.cpp uses SetVector without
including SetVector.h, so this patch adds an appropriate #include
there.
2022-09-17 12:36:43 -07:00
Fangrui Song 367997d0d6 [Support] Rename llvm::compression::{zlib,zstd}::uncompress to more appropriate decompress
This improves consistency with other places (e.g. llvm::compression::decompress,
llvm::object::Decompressor::decompress, llvm-objcopy).
Note: when zstd::uncompress was added, we noticed that the API `ZSTD_decompress`
is fine while the zlib API `uncompress` is a misnomer.
2022-09-17 12:35:17 -07:00
Kazu Hirata 31b91356bc [ModuleInliner] Don't include SetVector.h (NFC)
We don't use SetVector in the module inliner.
2022-09-17 12:17:52 -07:00
Kazu Hirata 6170437df5 [ModuleInliner] Remove unnecessary #includes (NFC)
While I am at it, this patch removes an unnecessary forward
declaration.
2022-09-17 12:05:35 -07:00
Kazu Hirata 5faf4bf195 [ModuleInliner] Move UseInlinePriority to InlineOrder.cpp (NFC)
UseInlinePriority specifies the priority function.  This patch
simplifies the code by moving UseInlinePriority closer to the actual
consumer -- the switch statement inside getInlineOrder.

Differential Revision: https://reviews.llvm.org/D134100
2022-09-17 11:41:28 -07:00
Sander de Smalen bed214cf0f [AArch64][SME] Add intrinsics for enabling/disabling ZA.
This adds the intrinsics:
* void @llvm.aarch64.sme.za.enable() -> smstart za
* void @llvm.aarch64.sme.za.disable()  -> smstop za

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D133894
2022-09-17 16:41:42 +00:00
Sander de Smalen 5fae000f36 [AArch64][SME] Disable tail-call optimization when streaming mode change or lazy-save may be required.
When a streaming mode change is (or may be) required for a call, it will
need to restore the original mode after the call, which prevents the use of
tail-call optimization. The same holds true for a call that requires the lazy-save
mechanism to be set up before the call, and possibly restored after.

More details about the SME attributes and design can be found
in D131562.

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D131579
2022-09-17 16:15:07 +00:00
Nikolas Klauser 87abc5013a [libc++][NFC] Inline the string constructors
This removes a lot of boilerplate code.

Reviewed By: ldionne, #libc

Spies: EricWF, libcxx-commits

Differential Revision: https://reviews.llvm.org/D128081
2022-09-17 18:00:11 +02:00
Evgeny Shulgin 510383626f [Clang] Support label at end of compound statement
Implements paper P2324R2
https://wg21.link/p2324r2
https://github.com/cplusplus/papers/issues/1006

Reviewed By: cor3ntin

Differential Revision: https://reviews.llvm.org/D133887
2022-09-17 15:34:56 +00:00
Dmitry Polukhin 133b6d7db9 [clang][C++20] Fix clang/clangd assert/crash after compilation errors
After compilation errors, expression a transformation result may not be usable.
It triggers an assert in RemoveNestedImmediateInvocation and SIGSEGV in case of
builds without asserts. This issue significantly affects clangd because source
may not be valid during typing. Tests cases that I attached was reduce from huge
C++ translation unit.

Test Plan: check-clang

Differential Revision: https://reviews.llvm.org/D133948
2022-09-17 07:37:19 -07:00
Florian Hahn 7914e53e31
[ConstraintElimination] Fix crash when combining results.
f213128b29 didn't account for the possibility that the result of
decompose may be empty. Fix that by explicitly checking. Use a newly
introduced helper to also reduce some duplication.

Thanks @bjope for finding the issue!
2022-09-17 14:47:38 +01:00
Shivam Gupta 78533528cf [NFC] Fix a comment in InitializePasses.h 2022-09-17 19:09:26 +05:30
Aaron Ballman 7772624f3b Add code examples to the potentially breaking changes
It may help users to better understand the change by showing them a
contrived code example which demonstrates the difference in behavior.
2022-09-17 08:44:13 -04:00
Nikolas Klauser d3a0ac92e9 [libc++] Add test to ensure that type trait aliases in dependent return types can be mangled
Reviewed By: ldionne, #libc

Spies: libcxx-commits, jeroen.dobbelaere

Differential Revision: https://reviews.llvm.org/D133196
2022-09-17 14:25:09 +02:00
Aaron Ballman aa9a656b03 Fix release note formatting and style; NFC
Uses double backticks where appropriate, changes some instances of
GH12345 to be Issue 12345, etc.
2022-09-17 08:21:33 -04:00
Aaron Ballman 1b2efe8d87 Fix this test to be more robust
The test is failing because it lacks a target triple, so the number of
diagnostics differs between Windows and Linux targets.

This should correct the issue found by:
https://lab.llvm.org/buildbot/#/builders/109/builds/46804
2022-09-17 08:06:16 -04:00
Aaron Ballman 5d92d0b0f8 Correctly diagnose use of long long literals w/o a suffix
We would diagnose use of `long long` as an extension in C89 and C++98
modes when the user spelled the type `long long` or used the `LL`
literal suffix, but failed to diagnose when the literal had no suffix
but required a `long long` to represent the value.
2022-09-17 07:55:10 -04:00
Christian Sigg a6e91040ea [Bazel] Allow lit_test() macro to be used from other repos.
Wrap implicit dependencies in Label() so that they refer to @llvm-project, see https://bazel.build/rules/lib/Label#Label.

This change allows lit_test() to be used from other bazel repositories.
2022-09-17 11:06:07 +02:00
Filipp Zhinkin fa67e281b2 [ARM] Add more tests on instructions fusion with comparison with zero; NFC
Baseline tests for D131786
2022-09-17 11:49:58 +03:00
Daniel Bertalan 3493f1a107
[lld-macho] Simplify base address calculation for init offsets (NFC) 2022-09-17 10:23:05 +02:00
Xiang Li 8b2f8b3098 [NFC} update CodeGenHLSL tests to use cc1 instead of driver-mode 2022-09-17 00:11:44 -07:00
Alex Zinenko 83df43f3a2 [mlir] use strided layouts in vector transfer on memrefs
One of the vector transformation patterns has been indiscriminately
converting layouts to affine maps. Leverage the strided form when
possible.

Reviewed By: nicolasvasilache, dcaballe

Differential Revision: https://reviews.llvm.org/D134047
2022-09-17 08:11:30 +02:00
Alex Zinenko f3fae035c7 [mlir] use strided layout in structured codegen-related tests
All relevant operations have been switched to primarily use the strided
layout, but still support the affine map layout. Update the relevant
tests to use the strided format instead for compatibility with how ops
now print by default.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D134045
2022-09-17 08:11:28 +02:00
Emmmer edc1c9f610 [LLDB][RISCV] Add RVM and RVA instruction support for EmulateInstructionRISCV
Add:
- RVM and RVA instructions sets.
- corresponding unittests.

Further work:
- implement RVC, RVF, RVD, and RVV extension.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D133670
2022-09-17 12:19:09 +08:00
Kazu Hirata 29c841ce93 Revert "[llvm] Remove llvm::is_trivially_{copy/move}_constructible (NFC)"
This reverts commit 01ffe31cbb.

A build breakage with GCC 7.3 has been reported:

https://reviews.llvm.org/D132311#3797053

FWIW, GCC 7.5 is OK according to Pavel Chupin.  I also personally
tested GCC 8.4.0.
2022-09-16 18:26:20 -07:00
Vladislav Dzhidzhoev 6cf11f4462 [GlobalISel][DebugInfo] Salvage trivially dead instructions
Use salvageDebugInfo for instructions erased as trivially dead in
GlobalISel.

It would be helpful to implement support of G_PTR_ADD and G_FRAME_INDEX
in salvageDebugInfo in future in order to preserve more variable
location.

Reviewed by: arsenm

Differential Revision: https://reviews.llvm.org/D133986
2022-09-17 03:54:55 +03:00
Maksim Panchenko f1a11d770e [BOLT][NFC] Remove unreachable assertion
Reviewed By: ayermolo

Differential Revision: https://reviews.llvm.org/D134094
2022-09-16 17:03:35 -07:00
Aart Bik 30b550f14c [mlir][sparse] add loop simplification to sparsification pass
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D134090
2022-09-16 16:29:47 -07:00
Matheus Izvekov 52dce8900c
[clang] Fix AST representation of expanded template arguments.
Extend clang's SubstTemplateTypeParm to represent the pack substitution index.

Fixes PR56099.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Differential Revision: https://reviews.llvm.org/D128113
2022-09-17 01:24:46 +02:00
Peiming Liu b1d1964771 [mlir][sparse] Only try to compute a better iteraton graph when needed
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D134059
2022-09-16 22:53:32 +00:00
Michael Jones 70f1f302ca [libc][cmake] separate installing headers
Now libc headers can be installed separately from installing the rest of
the libc.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D133960
2022-09-16 15:50:28 -07:00
Kazu Hirata 6e30a9cc08 [Inliner] Retire DefaultInlineOrder (NFC)
DefaultInlineOrder was largely an exercise in generalizing the
traversal order of call sites within the inliner.

Now that the module inliner is starting to form its shape, there is no
point in sharing DefaultInlineOrder between the module inliner and the
CGSCC inliner.  DefaultInlineOrder and all the other inline orders are
mutually exclusive in the following sense:

- The use of DefaultInlineOrder doesn't make sense in the module
  inliner because there is no priority inherent in the order in which
  call sites are added to the list of call sites -- SmallVector.

- The use of any other inline order doesn't make sense in the CGSCC
  inliner because little prioritization can be done within one CGSCC.

This patch essentially reverts the addition of DefaultInlineOrder so
that the loop structure of Inliner.cpp looks like the state just
before we started working on the module inliner (circa June 2021).

At the same time, ww remove the choice of DefaultInlineOrder from
UseInlinePriority.

Differential Revision: https://reviews.llvm.org/D134080
2022-09-16 15:36:40 -07:00
Jacques Pienaar 55e4417bb9 [mlir][emacs] Enable loading bytecode files as text
Use auto-compression-mode to read bytecode files in human readable
manner.

Differential Revision: https://reviews.llvm.org/D133879
2022-09-16 15:08:55 -07:00