15085 Commits

Author SHA1 Message Date
LLVM GN Syncbot
e2092a430a [gn build] Port da69eb75cbc6 2025-04-04 18:29:23 +00:00
LLVM GN Syncbot
22921540cd [gn build] Port 7d3dfc862d28 2025-04-04 18:29:22 +00:00
LLVM GN Syncbot
1d88cfcbb8 [gn build] Port 46e2c07fa28b 2025-04-04 18:29:21 +00:00
Nico Weber
d9bf390852 [gn] port 4a4d41e723a
...and add missing TargetsToBuild dep.
2025-04-04 13:52:09 -04:00
Nico Weber
8f6551935a [gn] Add a missing dependency
Needed after 6ee5e694bff
2025-04-04 13:32:36 -04:00
Nico Weber
6ee5e694bf [gn] port 10c6ebc4271 (-gen-clang-diags-compat-ids) 2025-04-04 13:25:41 -04:00
Fangrui Song
c9f6d26e04
[MC] Merge MCAsmLexer.{h,cpp} into AsmLexer.{h,cpp} (#134207)
2b11c7de4ae182496438e166cb6758d41b6e1740 introduced
`llvm/include/llvm/MC/MCAsmLexer.h` and made `AsmLexer` inherit from
`MCAsmLexer`, likely to allow target-specific parsers to depend solely
on `MCAsmLexer`. However, this separation now seems unnecessary and
confusing.

`MCAsmLexer` defines virtual functions with `AsmLexer` as its only
implementation, and `AsmLexer` itself has few extra public methods.

To simplify the codebase, this change merges MCAsmLexer.{h,cpp} into
AsmLexer.{h,cpp}. MCAsmLexer.h is temporarily kept as a forwarder.

Note: I doubt that a downstream lexer handling an assembly syntax
significantly different from the standard GNU Assembler syntax would
want to inherit from `MCAsmLexer`. Instead, it's more likely they'd
extend `AsmLexer` by adding new states and modifying its internal logic,
as seen with variables for MASM, M68k, and HLASM.
2025-04-03 19:22:45 -07:00
Pengcheng Wang
4986a79648
[TableGen] Emit llvm::is_contained for CheckOpcode predicate (#134057)
When the list is large, using `llvm::is_contained` is of higher
performance than a sequence of comparisons. When the list is small,
the `llvm::is_contained` can be inlined and unrolled, which has the
same effect as using a sequence of comparisons.

And the generated code is more readable.
2025-04-03 11:11:36 +08:00
Jon Roelofs
749c20b3e0
[LIT] Add a test for lit.Test.toMetricValue. NFC 2025-04-02 17:35:14 -07:00
George Burgess IV
a8585654c2
[llvm][utils] skip revert-checking reverts across branches (#134108)
e2ba1b6ffde4ec607342b1b746d1b57f0f04390a references that it reverts a
commit that's not a parent of e2ba1b6ffde4ec607342b1b746d1b57f0f04390a.

Functionally, this can (and demonstrably does) work(*), but from the
standpoint of the revert checker, it's nonsense. Print a `logging.error`
when it's detected.

Tested by running the revert checker against a commit range that
includes the aforementioned commit; the logging.error was fired
appropriately.

(*) - the specifics here are:
- the _SHA_ that was referenced was on a non-main branch, but
- the commit from the non-main branch was merged into the non-main
branch from main
- ...so the _functional_ commit being reverted was originally landed on
main, but the _SHA_ referenced from main was from a branch that was cut
before the reverted-commit was landed on main
2025-04-02 13:44:18 -07:00
Florian Hahn
3bdf9a0880
[EquivalenceClasses] Use SmallVector for deterministic iteration order. (#134075)
Currently iterators over EquivalenceClasses will iterate over std::set,
which guarantees the order specified by the comperator. Unfortunately in
many cases, EquivalenceClasses are used with pointers, so iterating over
std::set of pointers will not be deterministic across runs.

There are multiple places that explicitly try to sort the equivalence
classes before using them to try to get a deterministic order
(LowerTypeTests, SplitModule), but there are others that do not at the
moment and this can result at least in non-determinstic value naming in
Float2Int.

This patch updates EquivalenceClasses to keep track of all members via a
extra SmallVector and removes code from LowerTypeTests and SplitModule
to sort the classes before processing.

Overall it looks like compile-time slightly decreases in most cases, but
close to noise:

https://llvm-compile-time-tracker.com/compare.php?from=7d441d9892295a6eb8aaf481e1715f039f6f224f&to=b0c2ac67a88d3ef86987e2f82115ea0170675a17&stat=instructions

PR: https://github.com/llvm/llvm-project/pull/134075
2025-04-02 20:27:43 +01:00
Craig Topper
e020fc1895
[TableGen] Directly use SDNode functions to implement HasOneUse and HasNoUse. NFC (#133976)
The SDValue functions we were calling wrap SDNode functions we can call
directly.
2025-04-01 22:14:17 -07:00
Nico Weber
7b2b3faeb1 [gn build] Port 676755561d5a (ParseTests) 2025-04-01 15:34:00 -07:00
Nico Weber
86e66d2820 [gn] port 7003f7d23aeca 2025-04-01 14:36:50 -07:00
Matt Arsenault
f60eed9344
llvm-reduce: Add target-features-attr reduction (#133887)
Try to reduce individual subtarget features in the "target-features"
attribute. This attempts a textual removal of the fields in the string,
not a semantic removal. Typically there's a lot of redundant feature spam
in the feature list implied by the target-cpu (which I really wish clang
would stop emitting). If we could parse these out, we could easily drop
the fields without testing anything.
2025-04-02 00:03:43 +07:00
Florian Hahn
9e5bfbf77d
[EquivalenceClasses] Update member_begin to take ECValue (NFC).
Remove a level of indirection and update code to use range-based for
loops.
2025-04-01 09:28:46 +01:00
Craig Topper
40c859a704
[TableGen] Use size returned by encodeULEB128 to simplify some code. NFC (#133750)
We can use the length to insert all the bytes at once instead of
partially decoding them to insert one byte at a time.
2025-03-31 15:58:36 -07:00
LLVM GN Syncbot
b91f978647 [gn build] Port 50949ebf523c 2025-03-31 15:20:59 +00:00
Kazu Hirata
6257621f41
[llvm] Use llvm::append_range (NFC) (#133658) 2025-03-30 18:43:02 -07:00
Kazu Hirata
2c73711995
[TableGen] Use llvm::append_range (NFC) (#133649) 2025-03-30 12:21:38 -07:00
Tim Gymnich
1d0005a69a
[GlobalISel][NFC] Rename GISelKnownBits to GISelValueTracking (#133466)
- rename `GISelKnownBits` to `GISelValueTracking` to analyze more than
just `KnownBits` in the future
2025-03-29 11:51:29 +01:00
LLVM GN Syncbot
4324f236ac [gn build] Port c8a70f4c6e24 2025-03-28 23:58:46 +00:00
Tim Gymnich
049f179606
[Analysis][NFC] Extract KnownFPClass (#133457)
- extract KnownFPClass for future use inside of GISelKnownBits

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2025-03-28 18:10:02 +01:00
Jay Foad
a983c3b209
[TableGen] Make more use of CodeGenRegisterClass::EnumValue. NFC. (#132749) 2025-03-28 15:54:53 +00:00
Kazu Hirata
673f4705a8
[llvm] Use *Set::insert_range (NFC) (#133353)
We can use *Set::insert_range to collapse:

  for (auto Elem : Range)
    Set.insert(E.first);

down to:

  Set.insert_range(llvm::make_first_range(Range));

In some cases, we can further fold that into the set declaration.
2025-03-27 20:44:20 -07:00
Craig Topper
ebe1ece4bb
[TableGen][RISCV] Support sub-operands in CompressInstEmitter.cpp. (#133039)
I'm looking into using sub-operands for memory operands. This would use
MIOperandInfo to create a single operand that contains a register and
immediate as sub-operands. We can treat this as a single operand for
parsing and matching in the assembler. I believe this will provide some
simplifications like removing the InstAliases we need to support "(rs1)"
without an immediate.

Doing this requires making CompressInstEmitter aware of sub-operands.

I've chosen to use a flat list of operands in the CompressPats so each
sub-operand is represented individually.
2025-03-27 19:10:40 -07:00
LLVM GN Syncbot
a42342265f [gn build] Port d8e44a9ab290 2025-03-27 22:51:31 +00:00
LLVM GN Syncbot
64178316cf [gn build] Port 59d06071e9b5 2025-03-27 15:47:30 +00:00
LLVM GN Syncbot
533f85ae05 [gn build] Port 9c18edc62123 2025-03-26 21:47:43 +00:00
Jay Foad
38aac86a24
[TableGen] Speed up inferMatchingSuperRegClass. NFC. (#133060)
SubToSuperRegs was a DenseMap of std::vectors, where the vectors
typically had size 1. Switching to a vector of pairs avoids the overhead
of allocating tiny vectors.

I measured a 1.14x speed-up building AMDGPUGenRegisterInfo.inc with this
patch.
2025-03-26 21:40:58 +00:00
Peter Collingbourne
1c8075c612 gn build: Port 0d2c55cb9682 2025-03-25 18:40:03 -07:00
Midhunesh
d75a40a9c1
Add cmake option to enable/disable searching PATH for symbolizer (#129012)
Introduced a cmake option that is disabled by default that suppresses
searching via the PATH variable for a symbolizer. The option will be
enabled for downstream builds where the user will need to specify the
symbolizer path more explicitly, e.g., by using ASAN_SYMBOLIZER_PATH.
2025-03-25 16:29:35 -07:00
Pete Chou
a074831cd9
[TableGen] Inherit properties from the nearest allocatable superclass. (#127018)
Previously isAlocatable was updated to allow inheritance from any
superclass for a generated register class, but other properties are
still inherited from its nearest superclass. This could cause
a generated regclass inherit undesired properties, e.g., tsflags, from
an unallocatable superclass due to the topological inheritance order.

This change updates to inherit properties from the nearest allocatable
superclass if possible and includes a test to demonstrate a potential
incorrect inheritance of tsflags.
2025-03-25 15:54:06 -05:00
LLVM GN Syncbot
0adc672ed4 [gn build] Port 9a82f742b497 2025-03-24 21:56:36 +00:00
Min-Yih Hsu
7fa104ed20
[TableGen][MCSched] Update error messages on the range of Acquire/ReleaseAtCycle (#131908)
I was looking at the value range of AcquireAtCycle / ReleaseAtCycle, and
I noticed that while the TableGen error messages said AcquireAtCycle has
to be less than ReleaseAtCycle, in reality they are actually allowed to
be the same. This patch fixes it and add more test cases.
2025-03-24 13:42:28 -07:00
Peter Collingbourne
11044de3dc Reapply "lit: Move RUN at line comment after the command."
This reverts commit 57e89c97c2c1b4e41f07a90c2f4d36649696e619.

Updated lit tests.
2025-03-24 12:01:49 -07:00
LLVM GN Syncbot
a76f678849 [gn build] Port f7a32b85b56b 2025-03-24 18:53:27 +00:00
LLVM GN Syncbot
d319cc84e4 [gn build] Port 7f920e2e5f70 2025-03-24 18:53:27 +00:00
LLVM GN Syncbot
9201e4a086 [gn build] Port 30bb0c443e16 2025-03-24 18:53:26 +00:00
LLVM GN Syncbot
590a5978d6 [gn build] Port 2f1416bbcde8 2025-03-24 18:53:25 +00:00
LLVM GN Syncbot
7aab2889d7 [gn build] Port 03557169e0ad 2025-03-24 18:53:24 +00:00
Peter Collingbourne
57e89c97c2 Revert "lit: Move RUN at line comment after the command."
This reverts commit 8d3dc1ed5656a3e69e4195d58684a7f4bf0ff5cc.

Test needs to be updated.
2025-03-24 11:47:56 -07:00
Peter Collingbourne
8d3dc1ed56
lit: Move RUN at line comment after the command.
When a developer copy/pastes a failing command line into their
shell to rerun it, they have to manually delete the "RUN: at line
N:" prefix. To make life easier for such developers, let's make it
possible to copy/paste a command without needing to modify it while
still showing the line number in the output by moving the line number
to a comment at the end of the command line.

Reviewers: jroelofs, MaskRay

Reviewed By: jroelofs, MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/132485
2025-03-24 11:29:57 -07:00
Kazu Hirata
41b76119ec
[llvm] Use range constructors for *Set (NFC) (#132636) 2025-03-23 15:50:34 -07:00
Craig Topper
616737c386 [TableGen] Use std:vector instead of SmallVector for the list of CompressPatterns. NFC
There are very likely more than 4 compress patterns.
2025-03-22 15:33:55 -07:00
Peter Collingbourne
8d67d00a94
gn build: libcxx: Select the std_thread pstl backend.
In the CMake build the default pstl backend for libc++ when threads are
enabled is std_thread. By selecting the wrong backend we were triggering
some transitive_includes test failures.

Reviewers: aeubanks, nico

Reviewed By: aeubanks

Pull Request: https://github.com/llvm/llvm-project/pull/132455
2025-03-21 14:55:30 -07:00
Kazu Hirata
599005686a
[llvm] Use *Set::insert_range (NFC) (#132325)
DenseSet, SmallPtrSet, SmallSet, SetVector, and StringSet recently
gained C++23-style insert_range.  This patch replaces:

  Dest.insert(Src.begin(), Src.end());

with:

  Dest.insert_range(Src);

This patch does not touch custom begin like succ_begin for now.
2025-03-20 22:24:06 -07:00
Arthur Eubanks
8e777ff5bb [gn build] Port 73cd84a90e07 2025-03-20 21:37:22 +00:00
Arthur Eubanks
3dc98087c8 [gn build] Port 08dda4dcbf64 2025-03-20 21:37:21 +00:00
Finn Plummer
ebe5c66060
[DXIL] Remove definition and any uses of DXIL Property (#130796)
- Remove definitions from DXIL.td and any emissions/definitions that
were previously planned to be used

See resolved issue for motivations of deletion

Resolves #126298
2025-03-20 11:30:22 -07:00