aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils
AgeCommit message (Collapse)AuthorFilesLines
45 hours[lit] Remove support for %TAiden Grossman3-3/+19
This patch removes support for %T from llvm-lit. For now we mark the test unresolved and add an error message noting the substitution is deprecated. This is exactly the same as the error handling for other substitution failures. We intend to remove support for the nice error message once 22 branches as users should have moved over by the they are upgrading to v23. Reviewers: petrhosek, jh7370, ilovepi, pogo59, cmtice Reviewed By: cmtice, jh7370, ilovepi Pull Request: https://github.com/llvm/llvm-project/pull/160028
48 hours[lit] Remove %T from testsAiden Grossman1-28/+28
This patch removes %T from tests in preparation for removing the substitution completely. Splitting this off from the actual removal to make it easier to revert the removal of %T in case I missed something. Reviewers: RKSimon, jh7370, cmtice, petrhosek, ilovepi, pogo59 Reviewed By: cmtice, RKSimon, jh7370 Pull Request: https://github.com/llvm/llvm-project/pull/160027
2 daysFix the formatting script: do not try to update a GitHub PR without checking ↵Mehdi Amini1-1/+2
for should_update_gh (#159276)
2 days[Intrinsic] Unify IIT_STRUCT{2-9} into ITT_STRUCT to support upto 257 return ↵Michael Liao2-16/+10
values - Currently, Intrinsic can only have up to 9 return values. In case new intrinsics require more than 9 return values, additional ITT_STRUCTxxx values need to be added to support > 9 return values. Instead, this patch unifies them into a single IIT_STRUCT followed by a BYTE specifying the minimal 2 (encoded as 0) and maximal 257 (encoded as 255) return values.
2 days[gn build] Port 0e35f56d40d3LLVM GN Syncbot1-0/+1
2 days[NFC][LLVM] Pass/return SMLoc by value instead of const reference (#160797)Rahul Joshi1-1/+1
SMLoc itself encapsulates just a pointer, so there is no need to pass or return it by reference.
3 days[gn build] Port 85aeb6ab7778LLVM GN Syncbot1-0/+1
3 days[gn build] Port 0e17fcf93b6cLLVM GN Syncbot1-0/+1
3 days[gn build] Port b86aaacf28b3LLVM GN Syncbot1-2/+0
3 days[gn build] Port 0f1a952399b8LLVM GN Syncbot2-1/+1
3 days[workflows] Update commit access request PR links (#146169)David Peixotto1-1/+4
This PR updates the links used to show the PR contribution stats of the user requesting commit access to the LLVM project. Previously we would only show the PRs that were currently opened by the user because the `/pulls/<username>` endpoint automatically applies the `is:open` filter. The contribution guidelines suggest that the user should have at least 3 merged PRs to be considered for commit access so this seems like a relevant data point to add. We now show all PRs that a user has created (not just the open ones) and a separate link for the PRs that are merged.
3 days[TableGen, CodeGen, CHERI] Add support for the cPTR wildcard value type. ↵Owen Anderson5-8/+66
(#158426) cPTR is a wildcard CHERI capability value type, used analogously to iPTR. This allows TableGen patterns to abstract over CHERI capability widths. Co-authored-by: Jessica Clarke <jrtc27@jrtc27.com>
4 days[gn build] Port 833d5f0cd8beLLVM GN Syncbot1-0/+2
4 days[gn build] Port aa6a33ae6556LLVM GN Syncbot1-1/+0
4 days[lit] Allow retries for readfile tests (#160600)Aiden Grossman2-0/+6
This patch allows for two retry attempts for the readfile tests. This is intended as a stop-gap until I have time to do proper investigation into why exactly the tests are failing.
4 days[llvm][mustache] Add support for Triple Mustache (#159183)Paul Kirth1-14/+0
We extend the logic in tokenize() to treat the `{{{}}}` delimiters to treat it like other unescaped HTML. We do this by updating the tokenizer to treat the new tokes the same way we do for the `{{&variable}}` syntax, which avoid the need to change the parser. We also update the llvm-test-mustache-spec tool to no longer mark Triple Mustache as XFAIL.
4 days[lit] [test] Fix the shtest-readfile test on Python 3.13 on Windows (#160503)Martin Storsjö1-1/+1
Python 3.13 considers "/file/does/not/exist" to not be an absolute path on Windows, so the test runner does os.path.join(cwd, filePath), which can end up with an output path such as "D:/file/does/not/exist". Accept a potential prefix before the missing path here. This fixes running the lit tests on Windows with Python 3.13.
4 days[AIX] Fix AIX failures due to switch to internal shell (#160566)Mark Danial2-2/+2
This PR fixes a bunch of failures on AIX that occurred due to the switch to lit internal shell by default. The failures deal with the following: 1. unset not being supported by lit internal shell 2. A bug with echo -n on AIX when there are multiple pipes in the RUN command 3. ulimit test case not supported on AIX due to the -v option 4. platform specific error message for missing file
4 days[gn build] Port 6e6a3d83245eLLVM GN Syncbot1-0/+1
5 days[UpdateTestChecks] Don't fail silently when conflicting CHECK lines means no ↵Alex Bradbury1-20/+45
checks are generated for some functions (#159321) There is a warning that triggers if you (for instance) run `update_llc_test_checks.py` on an input where _all_ functions have conflicting check lines and so no checks are generated. However, there are no warnings emitted at all for the case where some functions have non-conflicting check lines but others don't. This is a source of frustration because running update_llc_test_checks can result in all check lines being removed for certain functions when such a conflict exists with no warning, meaning we have to be extra vigilant inspecting the diff. I've also personally wasted time tracking down the source of the dropped lines assuming that update_test_checks would emit a warning in such cases. This change adds logic to emit warnings on a function-by-function basis for any RUN that has conflicting prefixes meaning no output is generated. This subsumes the previous warning for when _all_ functions conflict.
5 days[NFC][MC][CodeEmitterGen] Extract error reporting into a helper function ↵Rahul Joshi2-20/+8
(#159778) Extract error reporting code emitted by CodeEmitterGen into MCCodeEmitter static members functions. Additionally, remove unused ErrorHandling.h header from several files.
5 days[gn build] Port c1720822b634LLVM GN Syncbot1-0/+1
6 days[TableGen][DecoderEmitter][RISCV] Always handle `bits<0>` (#159951)Sergei Barannikov2-2/+8
Previously, `bits<0>` only had effect if `ignore-non-decodable-operands` wasn't specified. Handle it even if the option was specified. This should allow for a smoother transition to the option removed. The change revealed a couple of inaccuracies in RISCV compressed instruction definitions. * `C_ADDI4SPN` has `bits<5> rs1` field, but `rs1` is not encoded. It should be `bits<0>`. * `C_ADDI16SP` has `bits<5> rd` in the base class, but it is unused since `Inst{11-7}` is overwritten with constant bits. We should instead set `rd = 2` and `Inst{11-7} = rd`. There are a couple of alternative fixes, but this one is the shortest.
6 days[gn build] Port ac69f9d9bba4LLVM GN Syncbot2-1/+1
7 days[Github][CI] fix invalid path in clang-tidy helper (#160014)Baranov Victor1-1/+1
This path was left untouched after refactoring made in https://github.com/llvm/llvm-project/pull/159967 which broke clang-tidy runner.
7 days[gn build] Port 2bcccdddc8cbLLVM GN Syncbot2-1/+1
7 days[gn build] Port 096c62cf21adLLVM GN Syncbot2-1/+1
8 days[gn build] Port 4cabd1efb9cbLLVM GN Syncbot1-0/+1
8 days[ProfCheck] Add three new tests to XFail List (#159969)Aiden Grossman1-0/+3
We have not gotten to LoopVectorize or SROA yet. The phase ordering pass issue is probably the result of another pass that we have not gotten to yet.
8 days[IR] Fix a few implicit conversions from TypeSize to uint64_t. NFC (#159894)Craig Topper1-2/+3
8 days[GitHub][CI] Add clang-tidy premerge workflow (#154829)Baranov Victor3-0/+654
**KEY POINTS** - MVP workflow to automatically lint C++ files, located **only** in `clang-tools-extra/clang-tidy`. It's chosen this way as `clang-tools-extra/clang-tidy` is almost 100% `clang-tidy` complaint, thus we would automatically enforce a [high quality standard for clang-tidy source code](https://discourse.llvm.org/t/rfc-create-hardened-clang-tidy-config-for-clang-tidy-directory/87247). (https://github.com/llvm/llvm-project/pull/147793) - Implementation is very similar to code-format job, but without the ability to run `code-lint-helper.py` locally. **FOUND ISSUES** + open questions - Speed: it takes ~ 1m40sec to download and unpack `clang-tidy` plus additional ~4 mins to configure and CodeGen targets. I see that `premerge.yaml` runs on special `llvm-premerge-linux-runners` runners which can use `sccache` for speed. Can we use the same runners for this job? Exact timings can be found [here](https://github.com/llvm/llvm-project/actions/runs/17135749067/job/48611150680?pr=154223). **TO DO** - Place common components from `code-lint-helper.py` and `code-format-helper.py` into a separate file and reuse it in both CI's. - Compute CodeGen targets based on `projects_to_build`, for now `clang-tablegen-targets` is hardcoded for `clang-tools-extra/`. - Automatically generate and upload `.yaml` for `clang-apply-replacements` - Create an RFC with a plan how to enable `clang-tidy` in other projects so that Maintainers of LLVM components could choose if they want `clang-tidy` or not. - Add more linters like `pylint`, `ruff` in the future.
8 days[gn] port bf835169a52b7Nico Weber1-4/+1
8 days[gn] port 60bdf0965441Nico Weber1-0/+2
9 days[lit] Add support for deleting symlinks to directories without -rAiden Grossman4-1/+24
Before this change, rm would assume that a symlink to a directory was actually a directory and require the recursive flag to be passed, differing from other shells. Given the change in lit is about the same length as the test change would be (minus tests), I think it makes sense to just support this in the internal shell. Reviewers: cmtice, petrhosek, ilovepi Reviewed By: petrhosek, cmtice, ilovepi Pull Request: https://github.com/llvm/llvm-project/pull/158464
9 days[lit] Make builtin cat work with stdinAiden Grossman2-0/+7
cat with no files passed to it is supposed to read from STDIN according to POSIX. The builtin cat lacking this behavior led to the clang test in dev-fd-fs.c to fail because it expected this behavior. This is a simple modification and I do not think it is possible to rewrite the test without this easily while preserving the semantics around named pipes. Reviewers: petrhosek, arichardson, ilovepi, cmtice, jh7370 Reviewed By: jh7370, arichardson, ilovepi, cmtice Pull Request: https://github.com/llvm/llvm-project/pull/158447
9 days[TableGen][DecoderEmitter] Rework table construction/emission (#155889)Sergei Barannikov6-554/+784
### Current state We have FilterChooser class, which can be thought of as a **tree of encodings**. Tree nodes are instances of FilterChooser itself, and come in two types: * A node containing single encoding that has *constant* bits in the specified bit range, a.k.a. singleton node. * A node containing only child nodes, where each child represents a set of encodings that have the same *constant* bits in the specified bit range. Either of these nodes can have an additional child, which represents a set of encodings that have some *unknown* bits in the same bit range. As can be seen, the **data structure is very high level**. The encoding tree represented by FilterChooser is then converted into a finite-state machine (FSM), represented as **byte array**. The translation is straightforward: for each node of the tree we emit a sequence of opcodes that check encoding bits and predicates for each encoding. For a singleton node we also emit a terminal "decode" opcode. The translation is done in one go, and this has negative consequences: * We miss optimization opportunities. * We have to use "fixups" when encoding transitions in the FSM since we don't know the size of the data we want to jump over in advance. We have to emit the data first and then fix up the location of the jump. This means the fixup size has to be large enough to encode the longest jump, so **most of the transitions are encoded inefficiently**. * Finally, when converting the FSM into human readable form, we have to **decode the byte array we've just emitted**. This is also done in one go, so we **can't do any pretty printing**. ### This PR We introduce an intermediary data structure, decoder tree, that can be thought as **AST of the decoder program**. This data structure is **low level** and as such allows for optimization and analysis. It resolves all the issues listed above. We now can: * Emit more optimal opcode sequences. * Compute the size of the data to be emitted in advance, avoiding fixups. * Do pretty printing. Serialization is done by a new class, DecoderTableEmitter, which converts the AST into a FSM in **textual form**, streamed right into the output file. ### Results * The new approach immediately resulted in 12% total table size savings across all in-tree targets, without implementing any optimizations on the AST. Many tables observe ~20% size reduction. * The generated file is much more readable. * The implementation is arguably simpler and more straightforward (the diff is only +150~200 lines, which feels rather small for the benefits the change gives).
9 days[TableGen] Remove unused Target from InstructionEncoding methods (NFC) (#159833)Sergei Barannikov3-32/+23
9 days[lit] Add support for readfile to external shellAiden Grossman4-2/+56
This patch adds support for the new lit %{readfile:<filename>} substitution to the external shell. The implementation currently just appends some test commands to ensure the file exists and uses a subshell with cat. This is intended to enable running tests using the substitution in the external shell before we fully switch over to the internal shell. This code is designed to be temporary with us deleting it once everything has migrated over to the internal shell and we are able to remove the external shell code paths. Reviewers: petrhosek, cmtice, pogo59, ilovepi, arichardson Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/159431
9 days[gn] port a513b701752b1Nico Weber2-2/+4
9 days[lit] Add readfile substitutionAiden Grossman7-0/+80
This patch adds a new %{readfile:<file name>} substitution to lit. This is needed for porting a couple of tests to lit's internal shell. These tests are all using subshells to pass some option to a command are not feasible to run within the internal shell without this functionality. Reviewers: petrhosek, jh7370, ilovepi, cmtice Reviewed By: jh7370, cmtice Pull Request: https://github.com/llvm/llvm-project/pull/158441
9 days[gn] port 584af2f89e95 (clang-tidy custom)Nico Weber2-0/+19
9 daysX86: Switch to RegClassByHwMode (#158274)Matt Arsenault1-2/+2
Replace the target uses of PointerLikeRegClass with RegClassByHwMode
9 daysCodeGen: Add RegisterClass by HwMode (#158269)Matt Arsenault16-90/+491
This is a generalization of the LookupPtrRegClass mechanism. AMDGPU has several use cases for swapping the register class of instruction operands based on the subtarget, but none of them really fit into the box of being pointer-like. The current system requires manual management of an arbitrary integer ID. For the AMDGPU use case, this would end up being around 40 new entries to manage. This just introduces the base infrastructure. I have ports of all the target specific usage of PointerLikeRegClass ready.
10 days[gn build] Port b59d410202d1LLVM GN Syncbot1-0/+1
10 daysTableGen: Replace assertion with error for unexpected pattern inputs (#159687)Matt Arsenault1-1/+5
10 days[IntrinsicEmitter] Make AttributesMap PackedID type-adaptive (#158383)Elvin Wang1-22/+33
10 days[llvm][clang] Pass VFS to `llvm::cl` command line handling (#159174)Jan Svoboda2-1/+2
This PR passes the VFS down to `llvm::cl` functions so that they don't assume the real file system.
10 days[gn build] Port 6b99a7bbed8dLLVM GN Syncbot1-0/+1
10 days[IntrinsicEmitter] Make AttributesMap bound inclusive (#158714)Elvin Wang1-2/+2
This is a minor fix from comment https://github.com/llvm/llvm-project/pull/157965/files#r2347317186 introduced in #157965.
10 days[gn build] Port 902ddda120a5LLVM GN Syncbot1-0/+1