71 Commits

Author SHA1 Message Date
Jordan Rupprecht
c05611f191
[bazel] Port #150633 HLSLBinding.h (#151546) 2025-07-31 11:04:14 -05:00
Jordan Rupprecht
86f74c4d01
[bazel] Use rules_cc everywhere and reformat (#149584)
We already use cc rules from `@rules_cc//cc:defs.bzl` in a few files,
but this uses it everywhere. Done automatically by running `buildifier
--lint=fix
--warnings=native-cc-binary,native-cc-library,native-cc-test,load` over
all the files. I also ran `buildifier` once more to ensure there wasn't
any missing formatting, so that caused a few unrelated diffs.
2025-07-29 16:30:25 -05:00
Chenguang Wang
9eb90c2139
[bazel] Fix LLVM plugin tests under Analysis. (#142999)
Those tests were broken on bazel as a side effect of 8830e380.

This commit is tested with this command on Linux:

    bazelisk test \
        @llvm-project//llvm/unittests:analysis_tests \
@llvm-project//llvm/unittests:plugin_inline_advisor_analysis_test \
        @llvm-project//llvm/unittests:plugin_inline_order_analysis_test
2025-06-05 09:58:17 -07:00
Jorge Gorbe Moya
1678f47a91 [bazel] add missing dep for 74ed33484e84a331591fde66f7375c26bbf14672 2025-05-09 15:16:14 -07:00
HighW4y2H3ll
ba273be3bd
[Bazel] Remove redundant gtest_main from codegen_tests, codegen_globalisel_tests, mi_tests (#135316)
For codegen_tests, codegen_globalisel_tests and mi_tests, they already
have their own `main` function defined, so there should be no need to
add `gtest_main` dependency for the main function...

- codegen_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/TargetOptionsTest.cpp#L73
- codegen_globalisel_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp#L978
- mi_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/MI/LiveIntervalTest.cpp#L933
2025-04-18 10:42:49 -07:00
Christian Sigg
9fe6f6a0d4
[bazel] Change gentbl_cc_library(tbl_outs) to dicts (#134349)
Follow up from https://github.com/llvm/llvm-project/pull/134271
2025-04-07 14:23:22 +02:00
Pavel Labath
d200caa521
Revert "[bazel] Temporarily disable a broken LookupAddressRangeWithSt… (#126944)
…mtSequenceOffset debug info test"

This reverts commit 247430e9c41c61b66e2ee95c29a05de3e24c19b9.

The breakage has been fixed by 343bbda140d5a15cd7d7fbfc6041a7506da5cdae.
2025-02-12 19:31:12 +01:00
Haojian Wu
247430e9c4 [bazel] Temporarily disable a broken LookupAddressRangeWithStmtSequenceOffset debug info test 2025-02-07 17:13:37 +01:00
Jordan Rupprecht
a643e44974
[bazel] Replace gentbl with gentbl_cc_library (#124996)
LLVM has two tablegen generators: one in llvm/tblgen.bzl (`gentbl`,
macro-based) and one in mlir/tblgen.bzl (`gentbl_cc_library`,
rule-based). The `gentbl_cc_library` generator in MLIR has some
advantages to being a rule, and at any rate, it seems better to just use
the same tablegen rule everywhere instead of competing implementations.
2025-01-30 11:00:19 -06:00
Jorge Gorbe Moya
b108fbe6ea [bazel] Fixes for 7f37b34, 0165e33 and 3c64f86 2025-01-28 10:42:46 -08:00
Benjamin Kramer
c3d1a50d6a [bazel] Add missing dependency for b79ed8729b3d6d5482481c41a7de2cd75b0f61df 2025-01-09 13:22:02 +01:00
Angus Lees
bca92b1258
[bazel] Allow SupportTests to be built remotely and cached (#121375)
`SupportTests` fails in the bazel macOS sandbox, because
`FileSystemTest.permissions` expects to be able to modify file
permissions on some otherwise protected files.

Previously this test was marked `local` in bazel, which has
additional undesirable effects such as skipping remote build and cache.

Tighten the bazel tags to just `no-sandbox`.  Note in particular, that
this allows the test to build, execute, and cache remotely (if
configured).

Testing:
- Verified this test fails (as expected) on macOS with no tags, and
  passes with `no-sandbox`.
- Verified this test passes when executed remotely (using an Engflow RBE
  setup) with `no-sandbox`.
2025-01-02 11:33:06 -06:00
Pranav Kant
c8221359f0
[bazel] Add dep on Analysis to fix build break (#115033) 2024-11-05 09:44:29 -08:00
Keith Smiley
8cd2f75173
[bazel] Port df4d7d3b29b073e24a5ebb8302e7a1ac873a5cde (#110395) 2024-09-28 18:45:15 -07:00
Jorge Gorbe Moya
a82fd981d8
[bazel][SandboxIR] Add cc_test rule for SandboxIR tests. (#110184) 2024-09-26 16:18:14 -07:00
Jordan Rupprecht
feeb6aa303
[bazel] Add CGData targets/deps (#108070)
This is newly used as of 0f525452896771cc8c579eb362dc7645e38fd0b9.

The bulk of the targets were added earlier in
9bb555688caf6ae4ba89fee5baa3dc29fec6a9b1.
2024-09-10 13:40:39 -05:00
Jordan Rupprecht
c1a4896070
[bazel][test] Add missing transforms test dep (#106323)
For 73c3b7337b0a3a8cb447f9801341d5648aebe9b2
2024-08-27 20:26:11 -05:00
Benjamin Kramer
019e1a3a42 [bazel] Add missing dependencies for c8a678b1e4863df2845b1305849534047f10caf1 2024-08-20 23:58:20 +02:00
Keith Smiley
1c4091053a
[bazel] Port cc7308a1563e5ebab4dffeb85deefdde61e6711a (#100163) 2024-07-23 09:58:12 -07:00
Keith Smiley
c63eaddb62
[bazel] Port #96805 (#96988) 2024-06-27 17:08:41 -07:00
Keith Smiley
d471860f2d
[bazel] Port #92983 (#93874) 2024-05-30 13:35:03 -07:00
Keith Smiley
00179e92c1
[bazel] Add new dependencies (#92323)
This also fixes building ... on Linux. Seems like target_compatible_with
isn't enough but you also need a manual tag.
2024-05-15 15:23:29 -07:00
Christian Sigg
e8cda376a7 [llvm][bazel] Fix BUILD after dcf376aae738252fb52a73bcf7f58fd030e15ee2. 2024-05-03 08:19:12 +02:00
Aiden Grossman
90a959a8c9
[Bazel] Add llvm-mca unittests (#90309)
This patch refactors the llvm-mca rules slightly so that the source
files within the tool source directory but not the library source
directory are included in a separate cc_library. This patch also adds
the llvm-mca unittests.
2024-04-26 22:09:34 -07:00
Keith Smiley
f530eee448
[bazel] Fix minor buildifier warnings (NFC) (#86566) 2024-03-25 12:44:58 -07:00
Jordan Rupprecht
2ad970667f [bazel] Add missing MachO dep for ORC test 2024-03-14 18:08:17 -07:00
Pranav Kant
8371cdca12 Disable ConstraintSystemTest for now
as it started failing after 8e514c572e

Above commit enables llvm::DebugFlag which is a global variable.
2024-01-17 04:04:16 +00:00
Dmitry Chernenkov
076eb4c79e [bazel] Add dependencies for 8e514c572e44eda237417236b4c92176dfce9cd9 2024-01-16 11:19:25 +00:00
Fangrui Song
fa131ae3bd [bazel,unittest] Export llvm_orc_registerJITLoaderGDBWrapper 2023-12-12 10:27:38 -08:00
Fangrui Song
6e761f3a04 [bazel] Port #73257 54397f9ac128568838f2ac7bfc8e1f94b3eb264d 2023-12-11 13:45:57 -08:00
Benjamin Kramer
2fc5649ccf [bazel] Add missing dependency for 5d2a7101b72a8cae8c4c1f7a11ede7f656efd583 2023-10-07 09:55:23 +02:00
Haojian Wu
8aa8604d29 [bazel] Fix build breakage after 315a407086b0ab302d0293b720d7f9b3e8f6ffa9 2023-09-28 09:36:32 +02:00
Haojian Wu
6bb4d9f93b [bazel] Fix the build breakage after e705b37a77c635a2cb7c9f5933805a82c6892e8c 2023-09-28 09:23:43 +02:00
Krasimir Georgiev
4d4ed5b215 [bazel] keep args one-per-line
Allows more easily to manage custom additions and removals.
2023-08-23 08:44:13 +00:00
Benjamin Kramer
f586face79 [bazel] Turn off layering_check for //llvm/unittests:target_aarch64_tests
llvm/unittests/Target/AArch64/AArch64SVESchedPseudoTest.cpp:38:10: error: module @llvm-project//llvm/unittests:target_aarch64_tests does not depend on a module exporting 'AArch64GenInstrInfo.inc'

Test was added in 57329ca94630742ce3b0f6b239b263d757a9eb4a
2023-07-24 19:16:26 +02:00
Haojian Wu
163268ada0 [bazel] add missing dep for llvm/unittests:frontend_tests 2023-07-21 10:10:15 +02:00
Benjamin Kramer
9846b9e2ca [bazel] Add missing dependency for d9d9be63a52dc6e908dba8f87d44192ee47ac5f8 2023-07-04 13:34:03 +02:00
Fangrui Song
19e9b9b589 [bazel] Add includes after 5a63b2b3049e06d83c43c037aab36e9bc3e797cb 2023-06-26 12:55:48 -07:00
Mikhail Goncharov
b28614c4fc [bazel] format bazel files NFC 2023-06-09 12:13:07 +02:00
Benjamin Kramer
ba8c0bf37e [bazel] Port 1117b9a284aa6e4b1f3cbde31825605bd07a2384 2023-06-06 22:47:17 +02:00
Wenzhi Cui
af202eaa9d Update BUILD file for bazel.
llvm::CodeGen was missing so add them to deps

Reviewed By: csigg

Differential Revision: https://reviews.llvm.org/D149720
2023-05-03 08:09:50 +02:00
NAKAMURA Takumi
631bfdbee5 Switch llvm/CodeGen/MachineValueType.h to the generated one
Prune `SupportTests/MVTTest` since it is no longer needed.

Depends on D148769

Differential Revision: https://reviews.llvm.org/D148770
2023-05-03 00:13:20 +09:00
NAKAMURA Takumi
5d71ec6e44 Split out CodeGenTypes from CodeGen for LLT/MVT
This reduces dependencies on `llvm-tblgen` so much.

`CodeGenTypes` depends on `Support` at the moment.
Be careful to append deps on this, since Targets' tablegens
depend on this.

Depends on D149024

Differential Revision: https://reviews.llvm.org/D148769
2023-05-03 00:13:20 +09:00
NAKAMURA Takumi
243e8f8d23 Introduce llvm-min-tblgen to build public header files
`llvm-min-tblgen` is capable of building `llvm/include/llvm`;

- `-gen-attrs`
- `-gen-directive-*`
- `-gen-intrinsics-*`
- `-gen-riscv-target-def`

`llvm-min-tblgen` is built and used only when `llvm-tblgen` is built in-tree.
This is not installed.

`llvm-tblgen` is built with complete set and may be installed.
`check-llvm` uses not `llvm-min-tblgen` but `llvm-tblgen`.

`LLVM_TABLEGEN_PROJECT` overrides the definition of `tablegen(project)`.
`LLVM_HEADERS` is used as the overridden prefix for LLVM header generators.

If `EXPORT` is not specified in `add_tablegen`, its tablegen is treated as internal.

Let `llvm-tblgen` depend on `intrinsics_gen`

Depends on D149072

Differential Revision: https://reviews.llvm.org/D146352
2023-05-02 11:32:22 +09:00
NAKAMURA Takumi
d01641b509 [Bazel] Rename LLVMTableGenGlobalISel to TableGenGlobalISel 2023-04-23 11:32:34 +09:00
NAKAMURA Takumi
fcc5f9ef50 Generate staging MachineValueType.h (partially) from ValueTypes.td
- Implement `VTEmitter` as `llvm-tblgen -gen-vt`.
- Create a copy of `llvm/Support/MachineValueType.h` into `unittests/Support`.
  It includes `GenVT.inc` generated by `VTEmitter`.
- Implement `MVTTest` in `SupportTests`. It checks equivalence between
  `llvm/Support/MachineValueType.h` and the generated header.

Differential Revision: https://reviews.llvm.org/D146906
2023-04-14 08:41:44 +09:00
Fangrui Song
da5bea948d [bazel] Disable layering_check for llvm/unittests:mi_tests after D145707 2023-04-11 14:44:43 -07:00
NAKAMURA Takumi
3f2dbcc27d [Bazel] Rework //llvm:llvm-tblgen and //llvm/unittests:tablegen_tests
`llvm/utils/TableGen/GlobalISel` should be exported.

FYI, after D144351,`tablegen_tests` behaved same
as `llvm-tblgen -print-records`.
It suceeded because stdin is `/dev/null`.
2023-03-23 22:14:26 +09:00
Fangrui Song
9e57a5739d [bazel] Fix {clang,llvm}/unittests 2023-02-10 14:41:21 -08:00
Guillaume Chatelet
1842b5885b [bazel] Fix build and make all target respect layering_check
Tested with `bazelisk-linux-amd64 query //... + @llvm-project//... | xargs bazelisk-linux-amd64 test --config=ci --features=layering_check`
2023-02-10 11:41:19 +00:00