Commit Graph

480807 Commits

Author SHA1 Message Date
Rik Huijzer
bc38da5d46 [mlir][scf] Add high-level documentation (#72313)
Credits for this description go to @ftynse in
<https://discourse.llvm.org/t/scf-dialect-vs-cfg/3524/2> and
@antiagainst in
<https://www.lei.chat/posts/mlir-codegen-dialects-for-machine-learning-compilers/>!
(Unless it's wrong of course, then it's my bad.)

EDIT: Also related:
<https://discourse.llvm.org/t/codegen-dialect-overview/2723>.

---------

Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
2023-11-15 10:31:37 +01:00
Momchil Velikov
dedf2c6bb5 [AArch64] Refactor allocation of locals and stack realignment (#72028)
Factor out some stack allocation in a separate function. This patch
splits out the generic portion of a larger refactoring done as a part of
stack clash protection support.

The patch is almost, but not quite NFC. The only difference should
be that where we have adjacent allocation of stack space
for local SVE objects and non-local SVE objects the order
of `sub sp, ...` and `addvl sp, ...` instructions is reversed, because now
it's done with a single call to `emitFrameOffset` and it happens
add/subtract the fixed part before the scalable part, e.g.

    addvl sp, sp, #-2
    sub sp, sp, #16, lsl #12
    sub sp, sp, #16

becomes

    sub sp, sp, #16, lsl #12
    sub sp, sp, #16
    addvl sp, sp, #-2
2023-11-15 09:27:01 +00:00
Luke Lau
1b781ee928 [RISCV] Refactor isAllOnesMask. NFC 2023-11-15 17:14:18 +08:00
jeanPerier
aa8af04d0c [flang] Switch lowering to use the HLFIR step by default (#72090)
Patch 3/3 of the transition step 1 described in

https://discourse.llvm.org/t/rfc-enabling-the-hlfir-lowering-by-default/72778/7

This patch changes bbc and flang-new driver to use HLFIR lowering by
default.

`-hlfir=false` can be used with bbc and `-flang-deprecated-no-hlfir`
with flang-new to get the previous default lowering behavior, but these
options will only be available for a limited period of time.

If any user needs these options to workaround bugs, they should open an
issue against flang in llvm github repo so that the regression can be
fixed in HLFIR.
2023-11-15 10:00:34 +01:00
Michael Buch
8e8bad70e6 Revert "[llvm][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (#72234)"
This reverts commit 9a9933fae2.

The OCaml bindings were using `LLVMDIBuilderCreateStaticMemberType`,
causing the API change in `9a9933fae23249fbf6cf5b3c090e630f578b7f98`
to break buildbots that built the bindings. Revert until we figure out
whether to fixup the bindings or just not change the C-API
2023-11-15 08:50:16 +00:00
Nikita Popov
89361007aa [hwasan] Move __hwasan_thread_enter/__hwasan_thread_exit out of namespace (#72123)
Due to a GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25940),
GCC doesn't consider extern "C" functions with the same name but
different namespace to be the same. As such, the default visibility
attribute (on a declaration outside the namespace) doesn't get applied
to the definition in the namespace and the symbol is not exported.

This came up as an ABI diff when switching between gcc and clang for
compiling compiler-rt.
2023-11-15 09:38:24 +01:00
Nikita Popov
261b471015 [FileCheck] Don't use regex to find prefixes (#72237)
FileCheck currently compiles a regular expression of the form
`Prefix1|Prefix2|...` and uses it to find the next prefix in the input.

If we had a fast regex implementation, this would be a useful thing to
do, as the regex implementation would be able to match multiple prefixes
more efficiently than a naive approach. However, with our actual regex
implementation, finding the prefixes basically becomes O(InputLen *
RegexLen * LargeConstantFactor), which is a lot worse than a simple
string search.

Replace the regex with StringRef::find(), and keeping track of the next
position of each prefix. There are various ways this could be improved
on, but it's already significantly faster that the previous approach.

For me, this improves check-llvm time from 138.5s to 132.5s, so by
around 4-5%.

For vector-interleaved-load-i16-stride-7.ll in particular, test time
drops from 5s to 2.5s.
2023-11-15 09:34:52 +01:00
Michael Buch
9a9933fae2 [llvm][DebugInfo] DWARFv5: static data members declarations are DW_TAG_variable (#72234)
This patch adds the LLVM-side infrastructure to implement DWARFv5 issue
161118.1: "DW_TAG for C++ static data members".

The clang-side of this patch will simply construct the DIDerivedType
with a different DW_TAG.
2023-11-15 08:16:24 +00:00
Timm Bäder
5480be13d5 [clang][NFC] Refactor Sema::DiagnoseSentinelCalls
Fix indentation, naming and capitalization to match current style
guides.
2023-11-15 08:37:01 +01:00
Timm Baeder
f5b378b0d6 [clang] Use new interpreter in EvaluateAsConstantExpr if requested (#70763)
EvaluateAsConstantExpr() uses ::EvaluateInPlace() directly, which does
not use the new interpreter if requested. Do it here, which is the same
pattern we use in EvaluateAsInitializer.
2023-11-15 08:29:22 +01:00
Timm Baeder
e2f8ec7255 [clang][Interp] Fix variables referring to their own address (#70587)
This was a combination of issues:
  1) We can subtract pointers that don't point into arrays.
  2) In C, everything is possible.
2023-11-15 08:03:06 +01:00
Shengchen Kan
51c351f49e [X86][MC] Support decoding of EGPR for APX (#72102)
https://github.com/llvm/llvm-project/pull/70958 adds registers R16-R31
(EGPR), this patch


1. Supports decoding of EGPR for instruction w/ REX2 prefix
2. Supports decoding of EGPR for instruction w/ EVEX prefix

For simplicity's sake,  we 
1.  Simulate the REX prefix w/ the 1st payload of REX2
2.  Simulate the REX2 prefix w/ the 2nd and 3rd payloads of EVEX

RFC:

https://discourse.llvm.org/t/rfc-design-for-apx-feature-egpr-and-ndd-support/73031/4

Explanations for some changes:
1. invalid-EVEX-R2.txt is deleted b/c `0x62 0xe1 0xff 0x08 0x79 0xc0` is
valid and decoded to `vcvtsd2usi %xmm0, %r16` now.
2. One line in x86-64-err.txt is removed b/c APX relaxes the limitation
of the 1st and 2nd payloads of EVEX prefix, so the error message changes
2023-11-15 13:52:53 +08:00
Yueh-Ting (eop) Chen
8434b0b9d3 [Clang][RISCV] Introduce tuple types for RVV bfloat16 (#72216)
The first commit extends the capacity from the compiler infrastructure,
and the second commit continues the effort in #71140 to introduce tuple
types for bfloat16.
2023-11-15 13:50:14 +08:00
Kiran Chandramohan
3f743fd3a3 [Flang][Docs] Fix lexer issue in Driver and Trampoline doc (#72322)
Allowed lexers are documented in https://pygments.org/docs/lexers/.
2023-11-15 04:53:42 +00:00
Kiran Chandramohan
d7b8ea63b3 [Flang][Docs] Fix GettingStarted.md with correct depth for in-tree build section (#72268)
Just a minor fix for the section depth for the patch in
https://reviews.llvm.org/D155029.
2023-11-15 04:53:21 +00:00
Vitaly Buka
4c08cbee7b [NFC][msan] Fix typo in comment 2023-11-14 20:52:41 -08:00
Qiu Chaofan
426ad99bb2 [PowerPC] Forbid f128 SELECT_CC optimized into fsel (#71497) 2023-11-15 12:20:06 +08:00
Shengchen Kan
0723d2496b [X86][MC] Remove duplicated code in X86DisassemblerDecoder.h by defining macro helpers (NFCI) (#72341) 2023-11-15 11:50:17 +08:00
Max191
ce6ef990fe [mlir] Remove convertible identity restriction for memref.atomic_rmw to LLVM (#72262)
memref.atomic_rmw will fail to convert for memref types that have an offset because they do not have identity maps. This restriction is overly conservative, so this changes the restriction to only strided memref types.
2023-11-14 22:45:14 -05:00
Mircea Trofin
6c2bde9bb9 [nfc][instr] Encapsulate CFGMST (#72207)
Very little of it needs to be public.
2023-11-14 19:22:21 -08:00
ZhaoQi
f6c4bb07ea [LoongArch][NFC] Pre-commit MCInstrAnalysis tests for instruction 'b' (#71903)
The tests for 'b' which commented with FIXME are incorrect, the
following patch will fix it.
2023-11-15 11:12:30 +08:00
Craig Topper
c44ac52e7d [RISC][GISel] Consider ABI copies when picking register bank for G_LOAD/STORE.
This is partially based on AArch64, but reduced to handle just the case
we currently have a test for.
2023-11-14 18:57:08 -08:00
Chen Zheng
1f6eb3ca5c [XCOFF]refactor isFunction, NFC (#72232)
suggested in review of https://github.com/llvm/llvm-project/pull/69553

This is actually not an NFC as isFunction() does not return false for
some "invalid" object, instead it returns the errors to its caller. But
since there is no such invalid object in the LIT tests, so no case
changes.
2023-11-15 10:41:59 +08:00
Jinyang He
72accbfd0a [lld][LoongArch] Support the R_LARCH_{ADD,SUB}6 relocation type (#72190)
The R_LARCH_{ADD,SUB}6 relocation type are usually used by DwarfCFA to
calculate a tiny offset. They appear after binutils 2.41, with GAS
enabling relaxation by default.
2023-11-15 09:57:45 +08:00
Nico Weber
f2c5355314 [gn] port 3dc098d392 2023-11-14 20:54:06 -05:00
Greg Clayton
beb702c0ad Add support for arm64 registers in minidump core file saving. (#72315)
This patch adds support for saving minidumps with the arm64
architecture. It also will cause unsupported architectures to emit an
error where before this patch it would emit a minidump with partial
information. This new code is tested by the arm64 windows buildbot that
was failing:

https://lab.llvm.org/buildbot/#/builders/219/builds/6868

This is needed following this PR:
https://github.com/llvm/llvm-project/pull/71772
2023-11-14 16:49:44 -08:00
Andres Villegas
3dc098d392 [NFC, sanitizer_symbolizer] Split Fuchsia and Markup. (#72305)
This PR separates parts of the symbolizer markup
implementation that are Fuchsia OS specific. This
is in preparation of enabling symbolizer markup
in other OSs.
2023-11-14 16:39:04 -08:00
Benjamin Kramer
8dfac290a4 [CodeGen] [riscv] Remove no-op ptr-to-ptr bitcasts (NFC) 2023-11-15 01:09:23 +01:00
Michael Maitland
a4f77f1ca3 [RISCV][GISEL] Use MO_PLT when Callee is a Global or Symbol (#71982)
SelectionDAG does the same thing in 74c8364954
2023-11-14 18:55:39 -05:00
Vitaly Buka
77048378ff [NFC][msan] Fix misleading comments
These variables are used by other platforms as well.
2023-11-14 15:42:53 -08:00
Vitaly Buka
60f740a305 [test][msan] Reformat RUN lines 2023-11-14 15:42:53 -08:00
Benjamin Kramer
c66844d629 [CodeGenOpenCL] Remove pointer type caching
This was important when typed LLVM pointers wanted a struct definition
for every type, but that's no longer necessary with opaque pointers.
NFCI.
2023-11-15 00:37:44 +01:00
Aart Bik
a89c15aa2e [mlir][sparse] enable Python BSR test (#72325) 2023-11-14 15:35:03 -08:00
Florian Mayer
8aed91631d [NFC] remove static asserts 2023-11-14 15:27:40 -08:00
Florian Mayer
d1168df2a4 [scudo] change allocation buffer size with env var (#71703)
We don't allow SCUDO_OPTIONS to be preserved across SELinux transitions,
so introducing a more constrained one that we can preserve.
2023-11-14 14:59:25 -08:00
Florian Mayer
a66dc461ac [scudo] allocation_ring_buffer_size <= 0 disables buffer (#71791)
Prevent a null pointer exception for allocation_ring_buffer_size < 0.
2023-11-14 14:58:05 -08:00
Maksim Levental
e35b606280 [mlir][sparsifier] fix isAdmissibleBSR (#72195)
Fixes https://github.com/llvm/llvm-project/issues/72194.
2023-11-14 16:56:34 -06:00
Nikolas Klauser
c81bfc61da [libc++] Optimize for_each for segmented iterators
```
---------------------------------------------------
Benchmark                       old             new
---------------------------------------------------
bm_for_each/1               3.00 ns         2.98 ns
bm_for_each/2               4.53 ns         4.57 ns
bm_for_each/3               5.82 ns         5.82 ns
bm_for_each/4               6.94 ns         6.91 ns
bm_for_each/5               7.55 ns         7.75 ns
bm_for_each/6               7.06 ns         7.45 ns
bm_for_each/7               6.69 ns         7.14 ns
bm_for_each/8               6.86 ns         4.06 ns
bm_for_each/16              11.5 ns         5.73 ns
bm_for_each/64              43.7 ns         4.06 ns
bm_for_each/512              356 ns         7.98 ns
bm_for_each/4096            2787 ns         53.6 ns
bm_for_each/32768          20836 ns          438 ns
bm_for_each/262144        195362 ns         4945 ns
bm_for_each/1048576       685482 ns        19822 ns
```

Reviewed By: ldionne, Mordante, #libc

Spies: bgraur, sberg, arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D151274
2023-11-14 23:55:24 +01:00
Karthika Devi C
6726c99f88 [AArch64] Fix tryMergeAdjacentSTG function in PrologEpilog pass (#68873)
The tryMergeAdjacentSTG function tries to merge multiple
stg/st2g/stg_loop instructions. It doesn't verify the liveness of NZCV
flag before moving around STGloop which also alters NZCV flags. This was
not issue before the patch 5e612bc as these stack tag stores does not
alter the NZCV flags. But after the change, this merge function leads to
miscompilation because of control flow change in instructions. Added the
check to to see if the first instruction after insert point reads or
writes to NZCV flag and it's liveout state. This check happens after the
filling of merge list just before merge and bails out if necessary.
2023-11-14 14:43:33 -08:00
Kiran Chandramohan
d32df98954 [Flang][Docs] Add or exclude documents to the toc (#72302)
This fixes all the warnings of the following type in the CI
(https://lab.llvm.org/buildbot/#/builders/89/builds/50248/steps/5/logs/stdio)
-> WARNING: document isn't included in any toctree.
2023-11-14 22:42:26 +00:00
Valentin Clement (バレンタイン クレメン)
a3700cc29d [flang][openacc] Make implicit declare region unstructured (#71591)
Using an op with a region cause some issue with unstructured code. This
patch make use of acc.declare_enter and acc.declare_exit to represent
the implicit declare region.
2023-11-14 14:42:11 -08:00
Kiran Chandramohan
70150d5d06 [Flang][Doc] Correct section depth in IntrinsicTypes.md (#72271)
Fixes flang documentation CI build.
2023-11-14 22:41:36 +00:00
Kiran Chandramohan
1d60d54a88 [Flang][Doc] Add a FIROperations section (#72252)
Adding this section ensures that the documentation generated by
mlir-tblgen for all the FIR operations are at the correct depth.
FIROperations are at depth 3, the new section is at depth 2. This fixes
the "Non-consecutive header level increase; H1 to H3" warning in
FIRLangRef.md.
2023-11-14 22:41:20 +00:00
Jake Egan
2c2f785a29 [AIX] Disable flaky ClangScanDeps tests (#72304)
These tests are failing intermittently on the AIX bot, possibly due to
some issue with `getpwuid_r`. Disable them for now while they are
investigated.
2023-11-14 17:40:16 -05:00
Peter Klausler
0fdf9123bd [flang] Fold MATMUL() (#72176)
Implements constant folding for matrix multiplication for all four
accepted type categories.
2023-11-14 14:37:23 -08:00
Félix-Antoine Constantin
2602d888d9 [clang-tidy] Improved readability-bool-conversion to be more consistent when using parentheses (#72068)
Provides more consistent suggestions when parentheses are added to the return value.

Fixes #71852
2023-11-14 23:32:58 +01:00
Nicolas van Kempen
2aec86683c [clang-tidy][abseil-string-find-startswith] Add string_view to default string-like classes (#72283)
As per title. A small improvement to this check, `string_view` should
work out of the box.
2023-11-14 22:25:23 +00:00
Max191
dae3c44ce6 [mlir] Add vector.store/maskedstore of memref.subview memref alias folding (#72184)
Fixes https://github.com/openxla/iree/issues/15575
2023-11-14 14:24:54 -08:00
Jacek Caban
c425db2eb5 [lld] Mark target section as code section when merging code sections into a data section. (#72030) 2023-11-14 23:01:59 +01:00
Julian Schmidt
a3d76b3fa3 [clang-tidy] fix match for binaryOperator in ExprMutationAnalyzer for misc-const-correctness (#70559)
The `ExprMutationAnalyzer`s matcher of `binaryOperator`s
that contained the variable expr, were previously narrowing the
variable to be type dependent, when the `binaryOperator` should
have been narrowed as dependent.
The variable we are trying to find mutations for does
not need to be the dependent type, the other operand of
the `binaryOperator` could be dependent.

Fixes #57297
2023-11-14 23:00:18 +01:00