13352 Commits

Author SHA1 Message Date
Nico Weber
ed6560240d [gn] add a bunch of missing libc++ headers
Ports:
* fcaccf817d31d (mdspan)
* 73d94b1916135 (source_location)
* b77e50e6aef56 (stop_token)
* 7cc72a0a2ec22 (syncstream)
2023-11-28 08:40:19 +09:00
Nico Weber
8cd7184dc0 [gn] port 12bb2910c3e3 2023-11-28 08:33:41 +09:00
Nick Desaulniers
c0fe0719df
[vim] set commentstring (#71838)
I recently moved from using vim to lunarvim. I noticed that `gcc` (lol)
wasn't able to comment out lines, because commentstring is not set.

Thanks to Chase Colman for the suggestion in
https://github.com/LunarVim/LunarVim/issues/4394.
2023-11-27 14:46:09 -08:00
Nico Weber
344b5346a0 Revert "[gn] port 92b821f2dcdd"
This reverts commit 580858ad0accee171256d720cff465e7016f018d.
92b821f2dcdd was reverted in ea5de6021cf69a23
2023-11-27 19:44:43 +09:00
LLVM GN Syncbot
681d02d09e [gn build] Port f8afc53d641c 2023-11-27 06:00:31 +00:00
Wang Pengcheng
2e6c01be0d
[SelectionDAG] Add instantiated OPC_EmitInteger and OPC_EmitStringInteger (#73241)
These two opcodes are used to be followed by a MVT operand, which is
always one of i8/i16/i32/i64.

We add instantiated `OPC_EmitInteger` and `OPC_EmitStringInteger` with
i8/i16/i32/i64 so that we can reduce one byte.

We reserve `OPC_EmitInteger` and `OPC_EmitStringInteger` in case that
we may need them someday, though I haven't found one usage after this
change.

Overall this reduces the llc binary size with all in-tree targets by
about 200K.
2023-11-27 11:08:28 +08:00
Nico Weber
acdd3cc178 [gn] manually re-sync llvm-exegesis tool deps
As far as I can tell, the non-lib part never depended on MCJIT,
so I'm not sure why I added that. While here, re-sync some other
deps.

Since there's no shared library build for the gn build, no real
behavior change.
2023-11-27 06:42:55 +09:00
Nico Weber
580858ad0a [gn] port 92b821f2dcdd 2023-11-27 06:34:18 +09:00
Da-Viper
dc8b055c71
[GitHub] Update bot message to suggest GitHub pull requests (#65914)
Fixes #65890.

---------

Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2023-11-26 16:53:37 +01:00
Tom Stellard
79a2cf5da3
test-release.sh: Default to letting ninja select the number of build jobs (#73187)
ninja defaults to using ncpus + 2 build jobs, and this extra parallelism
helps the script complete faster in my testing on the GitHub runners.
2023-11-26 07:48:51 -08:00
LLVM GN Syncbot
a0a41d106d [gn build] Port 1a3b14d26152 2023-11-25 00:24:03 +00:00
LLVM GN Syncbot
da85160e75 [gn build] Port 28233b11ac0e 2023-11-24 10:29:53 +00:00
Timm Baeder
81761bd0f1
Try to fix good-first-issue bot (#71816)
The previous code was just overriding the `comment` variable. Fix this by writing two comments if necessary instead.
2023-11-24 07:57:14 +01:00
Shengchen Kan
8c2537fde6
[X86][MC] Support encoding/decoding for PUSH2[P]/POP2[P] (#73233)
PUSH2 and POP2 are two new instructions for (respectively)
pushing/popping 2 GPRs at a time to/from
the stack. The opcodes of PUSH2 and POP2 are those of “PUSH r/m” and
“POP r/m” from legacy map 0, but we
require ModRM.Mod = 3 in order to disallow memory operand. 

The 1-bit Push-Pop Acceleration hint described in #73092 applies to
PUSH2/POP2 too, then we have PUSH2P/POP2P.

For AT&T syntax, PUSH2[P] pushes the registers from right to left onto
the stack. POP2[P] pops the stack to registers from right to left. Intel
syntax has the opposite order - from left to right.

The assembly syntax is aligned with GCC & binutils
https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637718.html
2023-11-24 12:29:56 +08:00
Shengchen Kan
dab7684ad1
[NFC][X86] Clang-format X86RecognizableInstr.h (#73279) 2023-11-24 11:56:57 +08:00
Shengchen Kan
39124f525a
[NFC][X86] Clang-format X86RecognizableInstr.cpp (#73278) 2023-11-24 11:45:23 +08:00
LLVM GN Syncbot
b90eba4e8b [gn build] Port aea7929b0a04 2023-11-23 20:32:40 +00:00
LLVM GN Syncbot
0d1b220f36 [gn build] Port b61ac4a88f93 2023-11-23 10:56:54 +00:00
Louis Dionne
6772c4f248
[libc++] Remove the ignore_format.txt file (#73135)
The ignore_format.txt file and the associated checks have been causing a
lot of confusion since we introduced them. Formatting becomes one of the
main hurdle for contributors (especially new contributors), and that is
not great.

The original goal of ignore_format.txt was to enforce clang-format only
in a subset of the files of the project. In practice, we have now
shifted to a model where we have a Github action that checks whether new
code surrounding edits is formatted. In that context, it probably
doesn't make sense to keep having a ignore list for formatting files.

After this patch, the clang-format job will enforce that all new code is
formatted properly, and that all edits to existing files are formatted
properly, regardless of which files the edits are in. This seems
reasonable and I believe will lead to much less confusion than our
current setup.

In the future, we could consider clang-formatting the whole code base
once and for all but this requires a bit of upfront technical work to
put in place a merge driver to help resolve merge conflicts across
formatting changes.
2023-11-22 15:21:01 -05:00
Louis Dionne
3e28e1ec56
[code-format] Also include libc++ extensionless headers and .inc and .cppm (#73142)
These headers were skipped by the job because they didn't have an
extension. However, such headers are extremely common in libc++.

As a drive-by change, also include `.cppm` and `.inc` extensions since
those are also common in libc++.
2023-11-22 13:03:05 -05:00
Shengchen Kan
42d484082c
[X86][MC] Support encoding/decoding for JMPABS (#72835)
JMPABS is a 64-bit only ISA extension, and acts as a near-direct branch
with an absolute target. The 64-bit immediate operand is treated an as
absolute effective address, which is subject to canonicality checks. It
is in legacy map 0 and requires REX2 prefix with `REX2.M0=0` and
`REX2.W=0`. All other REX2 payload bits are ignored.

blog: https://kanrobert.github.io/rfc/All-about-APX-JMPABS/

This patch
1. Extends `ExplicitVEXPrefix` to `ExplicitOpPrefix` for instrcutions
requires explicit `REX2` or `EVEX`
2. Adds `ATTR_REX2` and `IC_64BIT_REX2` to put `JMPABS` , `MOV EAX,
moffs32` in different tables to avoid opcode conflict

NOTE:
1. `ExplicitREX2Prefix` can be reused by the following PUSHP/POPP
instructions.
2. `ExplicitEVEXPrefix` will be used by the instructions promoted to
EVEX space for EGPR.
2023-11-22 10:26:23 +08:00
Matthias Braun
331111277a
Support BranchProbabilityInfo in update_analyze_test_checks.py (#72943)
- Change `BranchProbabilityPrinterPass` output to match expectations of `update_analyze_test_checks.py`.
- Add `Branch Probability Analysis` to list of supported analyses.
- Process `llvm/test/Analysis/BranchProbabilityInfo/basic.ll` with `update_analyze_test_checks.py` as proof of concept. Leaving the other tests unchanged to reduce the amount of churn.
2023-11-21 17:08:44 -08:00
Tom Stellard
907ed77ad1
test-release.sh: Only build the clang target in stage 1 and 2 (#72703)
This skips the build of all the unittests and llvm/clang tools, reducing
the number of ninja targets from 4,826 to 3,816 in phase 1 and phase 2.
2023-11-21 13:15:47 -08:00
Arthur Eubanks
e02b85bef7
[gn build] Add a generic compiler_wrapper gn arg (#72757)
Since goma is going away soon, we need to experiment with other
wrappers.

We can clean up the goma stuff once it's fully non-functional.
2023-11-21 09:25:07 -08:00
Nico Weber
9250fbd2a1 [gn] port e6ef31524729fc 2023-11-21 09:28:25 -05:00
LLVM GN Syncbot
a243128ed6 [gn build] Port 527fcb8e5d6b 2023-11-21 13:21:21 +00:00
Aiden Grossman
56d0e8ccf4
[Github] Print diff in code format helper (#72742)
Currently, when the code format action fails, it leaves no log of the
diff in the output within the action itself. This has caused confusion
for some users of the action, especially when the comment becomes buried
in a 100+ comment review and someone isn't super familiar with the inner
workings of the CI. This patch prints the diff produced by the code
formatter to stdout so that it is viewable by clicking on the failed
action. This should have very little cost and make things slightly less
confusing for those that run into this situation.
2023-11-18 01:06:40 -08:00
LLVM GN Syncbot
33e41c457a [gn build] Port ff219ea9ca80 2023-11-17 16:33:49 +00:00
LLVM GN Syncbot
b469d1d620 [gn build] Port f049395fc8d6 2023-11-17 16:33:48 +00:00
LLVM GN Syncbot
9edc0f592d [gn build] Port 7f28e8ced7ef 2023-11-16 14:50:00 +00:00
Nico Weber
5a3399c496 [gn] port ec64af599421 2023-11-15 13:33:37 -05: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
Nico Weber
f2c5355314 [gn] port 3dc098d39215 2023-11-14 20:54:06 -05: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
Hans
060af2697b
Use PGO for x86_64 windows release packaging (#71067)
Applying this to 17.0.4 makes the toolchain 22% faster (as measured by building clang).
2023-11-14 18:45:03 +01:00
LLVM GN Syncbot
d29d4cb4ab [gn build] Port d9ec4b24a84a 2023-11-14 02:10:41 +00:00
Nikita Popov
0a0e06f291
[TableGen] Fix prefix detection with anchor (NFC) (#71379)
instregex uses an optimization, where the constant prefix of the regex
is extracted to perform a binary search first. However, this
optimization currently mainly fails to apply, because most instregex
uses have an explicit ^ anchor, which gets counted as a meta char and
disables the optimization.

Make sure the anchor is skipped when determining the prefix. Also fix an
implementation bug this exposes, where the pick a too long prefix if the
first meta character is a quantifier.

This cuts the time needed to generate files like X86GenInstrInfo.inc by
half.
2023-11-13 15:47:15 +01:00
Henrik G. Olsson
e6eda66cbc
Recommit changes to global checks (#71171)
Recommits the changes from https://reviews.llvm.org/D148216.
Explicitly named globals are now matched literally, instead of emitting
a capture group for the name. This resolves #70047.
Metadata and annotations, on the other hand, are captured and matched
against by default, since their identifiers are not stable.

The reasons for revert (#63746) have been fixed:
The first issue, that of duplicated checkers, has already been resolved
in #70050.
This PR resolves the second issue listed in #63746, regarding the order
of named and unnamed globals. This is fixed by recording the index of
substrings containing global values, and sorting the checks according to
that index before emitting them. This results in global value checks
being emitted in the order they were seen instead of being grouped
separately.
2023-11-13 14:45:27 +01:00
Nico Weber
81330286f1 [gn] port a207e6307a58 (LLVMFrontendDriver) 2023-11-13 08:42:39 -05:00
Kazu Hirata
fcb160eabc [llvm] Stop including llvm/ADT/DenseMap.h (NFC)
Identified with clangd.
2023-11-11 22:46:28 -08:00
Kazu Hirata
01702c3f7f [llvm] Stop including llvm/ADT/SmallSet.h (NFC)
Identified with clangd.
2023-11-11 12:32:15 -08:00
Kazu Hirata
2ca3b6f6b7 [TableGen] Include <set> (NFC)
This patch adds "#include <set>" to several files that are relying on
transitive includes of <set>.  It in turn unblocks the removal of
unnecessary includes of llvm/ADT/SmallSet.h in several other files.
2023-11-11 12:14:24 -08:00
LLVM GN Syncbot
ccb77728d0 [gn build] Port 0255b217c376 2023-11-10 09:02:30 +00:00
LLVM GN Syncbot
34d712243f [gn build] Port f7d784709673 2023-11-10 07:55:02 +00:00
LLVM GN Syncbot
444cb2f332 [gn build] Port f6d525f8d8c8 2023-11-10 00:47:26 +00:00
LLVM GN Syncbot
4f12fd54ba [gn build] Port b002b38fd9f9 2023-11-10 00:47:26 +00:00
Arthur Eubanks
542592586e [gn build] Properly set _LIBCPP_HARDENING_MODE_DEFAULT 2023-11-09 16:46:09 -08:00
Nico Weber
acd7b7743a [gn] port 64d413efdd76 (hardening mode) 2023-11-09 22:08:00 +01:00
Thurston Dang
0be4c6b948
[sanitizer_common] Add experimental flag to tweak dlopen(<main program>) (#71715)
This introduces an experimental flag 'test_only_replace_dlopen_main_program'. When enabled, this will replace dlopen(main program,...) with dlopen(NULL,...), which is the correct way to get a handle to the main program.

This can be useful when ASan is statically linked, since dladdr((void*)pthread_join) or similar will return the path to the main program.

Note that dlopen(main program,...) never ends well:
- PIE in recent glibc versions (glibc bugzilla 24323), or non-PIE: return an error
- PIE in current GRTE and older glibc: attempt to load the main program again, leading to reinitializing ASan and failing to remap the shadow memory.

---------

Co-authored-by: Thurston Dang <thurston@google.com>
2023-11-09 12:53:06 -08:00
Florian Hahn
24839c3253
[UTC] Escape multiple {{ or }} in input for check lines. (#71790)
SCEV expressions may contain multiple {{ or }} in the debug output,
which needs escaping.

See
llvm/test/Analysis/LoopAccessAnalysis/loops-with-indirect-reads-and-writes.ll
for a test that needs escaping.
2023-11-09 17:18:11 +00:00