13352 Commits

Author SHA1 Message Date
Michael Maitland
030d334095 [TableGen] Rename ResourceCycles and StartAtCycle to clarify semantics
D150312 added a TODO:

TODO: consider renaming the field `StartAtCycle` and `Cycles` to
`AcquireAtCycle` and `ReleaseAtCycle` respectively, to stress the
fact that resource allocation is now represented as an interval,
relatively to the issue cycle of the instruction.

This patch implements that TODO. This naming clarifies how to use these
fields in the scheduler. In addition it was confusing that `StartAtCycle` was
singular but `Cycles` was plural. This renaming fixes this inconsistency.

Differential Revision: https://reviews.llvm.org/D158568
2023-08-24 11:20:37 -07:00
Yuhao Gu
64425caba2 [llvm-cov] Enable -show-directory-coverage for LLVM itself.
My previous patch D151283 added a new option to llvm-cov to make it generate a hierarchical report for better view. This patch is to enable it for the coverage report of LLVM itself.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D158703
2023-08-24 20:26:12 +08:00
pvanhout
0a59e1a85c [GlobalIsSel] Allow using PatFrags with multiple defs as the root of a combine rule
I had to tighten the restrictions on PatFrags a bit to make it consistent: instructions that
define the root of a PF can only have one def.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D157700
2023-08-24 09:09:24 +02:00
Fangrui Song
3515409012 [Driver] Remove unlikely-working Minix.cpp and Contiki.cpp
Minix is a ToolChain that was added back in 2010 but has been
unmaintained with no test. The constructed command line contains
/usr/gnu/include/c++/4.4.3 and CompilerRT-Generic which are unlikely
working for a long time.

Contiki is a barebone ToolChain that just enables safestack.
This doesn't justify a new ToolChain.

Remove these ToolChains so that their target triples will use Generic_ELF instead.

If these developers feel like having an updated llvm-project is useful,
fixing other build issues and adding a new ToolChain is much better than
having the unmaintained ToolChains.

Reviewed By: brad

Differential Revision: https://reviews.llvm.org/D158461
2023-08-23 23:58:38 -07:00
Craig Topper
8b82ae0b8d [GlobalISel][RISCV][TableGen] Teach GlobalISelEmitter about HwMode.
Similar to SelectionDAG, this patch treats HwMode as an additional
predicate that needs to be satisfied for GIM_CheckFeatures.

The existing predicate passes around Record * that point to predicate
records. While HwMode expansion creates a string that needs to be
checked.

Each HwMode predicate string is uniqued by a new map that assigns
it an index. Each Rule stores the index, or -1 if HwMode doesn't
apply.

The HwMode indices each create a new Predicate feature bit and the
check string from the HwMode is used to set the feature bit.
GIM_CheckFeatures is emitted when the rule has Predicates or the HwModeIdx
is not -1.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D158660
2023-08-23 21:14:16 -07:00
Craig Topper
e1a0e8258f [GlobalISel] Copy the implementation of SubtargetFeature and use it for PredicateBitset.
PredicateBitset currently uses std::bitset, but std::bitset doesn't
have a constexpr constructor or any constexpr methods until C++23.
Each target that supports GlobalIsel has as an array of PredicateBitset
objects that currently use a global constructor.

SubtargetFeature used by the MC layer for feature bits, has its own
implementation of std::bitset that has constexpr constructor and methods
that provides all the capabilities that PredicateBitset needs.

This patch copies the implementation from SubtargetFeature, makes
it a template class, and puts it in ADT. I'll migrate SubtargetFeature
in a separate patch. Adapting all existing users to it being a template
was distracting from the goal of this patch.

This reduces the binary size of llc built with gcc 8.5.0 on my local
build by ~15k.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D158576
2023-08-23 15:55:44 -07:00
Johannes Doerfert
dcd4d0a790 [UTC] Honor global-value-regex in UTC_ARGS
Without this we cannot update various clang OpenMP tests as the UTC_ARGS
version of -global-value-regex is simply ignored. The handling of the
flag should be changed to be in line with others, I left TODOs for now.
2023-08-23 10:40:30 -07:00
Craig Topper
dc6e68a839 [TableGen] Add const to SubtargetFeatures reference in emitSubtargetFeatureBitEnumeration. NFC
emitSubtargetFeatureBitEnumeration doesn't modify the map so we should
use const reference.
2023-08-23 10:21:39 -07:00
Fangrui Song
1c3f7f1748 [X86][GlobalISel] Move GlobalISel source files to a dedicated subdir
Similar to D81116 (AArch64): separate the GISel components for
organization purposes and match other targets ({AArch64,M68k,PowerPC,RISCV,X86}/GISel).

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D158489
2023-08-23 08:58:05 -07:00
LLVM GN Syncbot
fba1fa908d [gn build] Port f94a937cb37a 2023-08-23 15:35:10 +00:00
LLVM GN Syncbot
7a2de9ce17 [gn build] Port eb0e6c3134ef 2023-08-23 14:01:40 +00:00
Nico Weber
ed266e2253 [gn] port d9e3c85f5703 2023-08-22 19:58:51 -04:00
Nico Weber
44ba21e53a [gn] port e280e406c2e3 2023-08-22 19:32:46 -04:00
Craig Topper
a886870bc8 [TableGen] Use std::map::try_emplace to simplify code in GlobalISelEmitter. NFC 2023-08-22 10:10:35 -07:00
Nico Weber
048b506839 [gn] port 23459f13fcd9 2023-08-22 06:25:42 -04:00
LLVM GN Syncbot
6c308085f2 [gn build] Port a7bdaff7cad9 2023-08-21 18:05:47 +00:00
Benjamin Kramer
a4202e65cf Move VTList pointer out of RegClassInfos
Store it in TargetRegisterInfo instead. Worth 54k on llc size.
2023-08-21 17:40:40 +02:00
Benjamin Kramer
11bbfa12bd Make global variable const. NFC. 2023-08-21 17:40:40 +02:00
Qiongsi Wu
3bcce9ca22 [AIX] Limit extract_symbols.py's Pools Size to 8
On AIX, `extract_symbols.py`'s default pool size may be too big for the logical partition(LPAR)'s allocated memory, and may lead to intermittent IO errors. This patch limits the pool size to 8 to avoid such errors.

Reviewed By: daltenty, thieta

Differential Revision: https://reviews.llvm.org/D157884
2023-08-21 09:48:12 -04:00
Luke Lau
b0af89cbda [emacs] Add regexps for defuns
Previously `M-x mark-defun` and friends wouldn't work properly, and would
highlight something at the top of the buffer. This adds a regexp for top-level
functions so the defun functions should work as expected, and also adds a
regexp for extracting their name so which-function-mode should work now too.

Reviewed By: goldstein.w.n

Differential Revision: https://reviews.llvm.org/D158196
2023-08-21 10:43:41 +01:00
LLVM GN Syncbot
ab45b4fef7 [gn build] Port 5f2a7fa67e9b 2023-08-21 09:19:01 +00:00
LLVM GN Syncbot
b064a2ca18 [gn build] Port fab91e950966 2023-08-21 08:42:40 +00:00
LLVM GN Syncbot
94e14b975b [gn build] Port 23c8d3825831 2023-08-21 08:42:39 +00:00
Michał Górny
7ed0f5b6de [lit] Use raw strings for backslash escapes to fix SyntaxWarnings
Use raw strings instead of regular strings when escapes are used for
regex matches or arbitrary letters rather than C-style characters.
This fixes `SyntaxWarning`s:

```
TestRunner.py:205: SyntaxWarning: invalid escape sequence '\c'
  """
TestRunner.py:1566: SyntaxWarning: invalid escape sequence '\s'
  match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln)
```

Differential Revision: https://reviews.llvm.org/D158356
2023-08-21 03:51:10 +02:00
LLVM GN Syncbot
65f2596f79 [gn build] Port 0229dd0626b2 2023-08-19 10:21:24 +00:00
Reid Kleckner
984dc4b9cd [WebAssembly] Create separation between MC and CodeGen layers
Move WebAssemblyUtilities from Utils to the CodeGen library. It
primarily deals in MIR layer types, so it really lives in the CodeGen
library.

Move a variety of other things around to try create better separation.

See issue #64166 for more info on layering.

Move llvm/include/CodeGen/WasmAddressSpaces.h back to
llvm/lib/Target/WebAssembly/Utils.

Differential Revision: https://reviews.llvm.org/D156472
2023-08-18 14:08:37 -07:00
Luke Lau
160ab99539 [emacs] Highlight hexadecimal integer constants
Today I learnt about their existence (D158288), they just need to be prefixed
with a u or s.

Reviewed By: goldstein.w.n

Differential Revision: https://reviews.llvm.org/D158290
2023-08-18 19:54:13 +01:00
LLVM GN Syncbot
18441c5fbd [gn build] Port 25b9696b61e5 2023-08-18 13:40:06 +00:00
Nico Weber
05a6b94835 [gn] port d5ca90041446 (driver_execs for dsymutil, llvm-debuginfod, llvm-ml, llvm-objdump, llvm-symbolizer) 2023-08-18 09:24:35 -04:00
LLVM GN Syncbot
686978667e [gn build] Port 7624de5beae2 2023-08-17 20:10:57 +00:00
LLVM GN Syncbot
e2d06ffe19 [gn build] Port 22b9404f09dc 2023-08-17 19:25:29 +00:00
Arthur Eubanks
2041611931 [gn build] Force clang_enable_per_target_runtime_dir for Android builds
Since it doesn't work yet.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D157901
2023-08-17 11:09:03 -07:00
LLVM GN Syncbot
d5f1ee0983 [gn build] Port f806be5eaae1 2023-08-17 15:50:11 +00:00
LLVM GN Syncbot
71db18a016 [gn build] Port 32484c1724be 2023-08-17 10:54:06 +00:00
LLVM GN Syncbot
240bbb3c13 [gn build] Port 1506e4c77624 2023-08-17 09:02:49 +00:00
LLVM GN Syncbot
329979cf37 [gn build] Port 2459ed67805c 2023-08-16 17:25:23 +00:00
Nico Weber
e87d68ce8f [gn] port 23d1b6577a50 2023-08-16 13:25:02 -04:00
Michael Buch
bb90a5cf20 [llvm][utils] Fix SmallVector formatter when type is a pointer
Previously types such as `SmallVector<clang::Attr, 4> *` would
trigger the assertion inside the `SmallVector` formatter:
```
assert self.type_size != 0
```
This happens because `the_type.GetTemplateArgumentType(0)` returns
`None` (since `the_type` is a pointer to the `SmallVector`).

This patch dereferences `the_type` if it's a pointer type. We do this
for references already.

Differential Revision: https://reviews.llvm.org/D157961
2023-08-15 23:09:59 +01:00
LLVM GN Syncbot
d50b18d3d3 [gn build] Port 3ad618f4aea1 2023-08-15 20:22:12 +00:00
Justin Bogner
dcb6d212fd Reapply "[Option] Add "Visibility" field and clone the OptTable APIs to use it"
This reverts commit 4e3b89483a6922d3f48670bb1c50a37f342918c6, with
fixes for places I'd missed updating in lld and lldb. I've also
renamed OptionVisibility::Default to "DefaultVis" to avoid ambiguity
since the undecorated name has to be available anywhere Options.inc is
included.

Original message follows:

This splits OptTable's "Flags" field into "Flags" and "Visibility",
updates the places where we instantiate Option tables, and adds
variants of the OptTable APIs that use Visibility mask instead of
Include/Exclude flags.

We need to do this to clean up a bunch of complexity in the clang
driver's option handling - there's a whole slew of flags like
CoreOption, NoDriverOption, and FlangOnlyOption there today to try to
handle all of the permutations of flags that the various drivers need,
but it really doesn't scale well, as can be seen by things like the
somewhat recently introduced CLDXCOption.

Instead, we'll provide an additive model for visibility that's
separate from the other flags. For things like "HelpHidden", which is
used as a "subtractive" modifier for option visibility, we leave that
in "Flags" and handle it as a special case.

Note that we don't actually update the users of the Include/Exclude
APIs here or change the flags that exist in clang at all - that will
come in a follow up that refactors clang's Options.td to use the
increased flexibility this change allows.

Differential Revision: https://reviews.llvm.org/D157149
2023-08-15 01:16:58 -07:00
Justin Bogner
4e3b89483a Revert "[Option] Add "Visibility" field and clone the OptTable APIs to use it"
this is failing on bots, reverting to investigate.

This reverts commit a16104e6da6f36f3d72dbf53d10ba56495a0d65a.
2023-08-14 13:31:02 -07:00
Justin Bogner
a16104e6da [Option] Add "Visibility" field and clone the OptTable APIs to use it
This splits OptTable's "Flags" field into "Flags" and "Visibility",
updates the places where we instantiate Option tables, and adds
variants of the OptTable APIs that use Visibility mask instead of
Include/Exclude flags.

We need to do this to clean up a bunch of complexity in the clang
driver's option handling - there's a whole slew of flags like
CoreOption, NoDriverOption, and FlangOnlyOption there today to try to
handle all of the permutations of flags that the various drivers need,
but it really doesn't scale well, as can be seen by things like the
somewhat recently introduced CLDXCOption.

Instead, we'll provide an additive model for visibility that's
separate from the other flags. For things like "HelpHidden", which is
used as a "subtractive" modifier for option visibility, we leave that
in "Flags" and handle it as a special case.

Note that we don't actually update the users of the Include/Exclude
APIs here or change the flags that exist in clang at all - that will
come in a follow up that refactors clang's Options.td to use the
increased flexibility this change allows.

Differential Revision: https://reviews.llvm.org/D157149
2023-08-14 13:24:54 -07:00
Nico Weber
17f331cc64 [gn] port 72a006b33855 2023-08-14 15:35:28 -04:00
Jay Foad
6551cfa8eb [CodeGen] Set regunitmasks for leaf regs to all instead of none
This simplifies every use of MCRegUnitMaskIterator.

Differential Revision: https://reviews.llvm.org/D157864
2023-08-14 15:22:35 +01:00
Karl-Johan Karlsson
01dcad0406 [GlobalISel] Silence gcc warning [NFC]
Without the fix gcc complains with:
../utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp:251:60: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
2023-08-14 13:35:27 +02:00
LLVM GN Syncbot
90320589f4 [gn build] Port 627512a96c2b 2023-08-13 20:12:27 +00:00
LLVM GN Syncbot
b7af329db3 [gn build] Port bec51c907a74 2023-08-11 15:29:29 +00:00
pvanhout
3a1eefae4b [GlobalISel] Do not discard InstructionPattern::checkSemantics result 2023-08-11 11:09:54 +02:00
LLVM GN Syncbot
144477f25b [gn build] Port a563ced78bb4 2023-08-11 07:16:18 +00:00
pvanhout
65336f8070 [GlobalISel] Fix use of std::vector with forward decl
Some implementations of the STL don't allow it.
2023-08-11 09:09:09 +02:00