Commit Graph

11936 Commits

Author SHA1 Message Date
Nicolai Hähnle 1743052a1d Add update_any_test_checks.py convenience utility
Given a list of test files, this utility will run (optionally in
parallel) the corresponding update_*_test_checks tool for all given
tests that have automatically generated assertions.

Differential Revision: https://reviews.llvm.org/D139100
2022-12-01 17:25:53 +01:00
LLVM GN Syncbot e1da0e9ce0 [gn build] Port 89f36dd8f3 2022-12-01 11:19:48 +00:00
LLVM GN Syncbot 9b8eb0cf05 [gn build] Port 65d6d67fc9 2022-12-01 11:19:48 +00:00
LLVM GN Syncbot 0926035ed5 [gn build] Port b95646fe70 2022-11-30 22:46:01 +00:00
LLVM GN Syncbot b802b537f8 [gn build] Port 77b2205245 2022-11-30 14:41:02 +00:00
LLVM GN Syncbot 9fa65ba155 [gn build] Port d3c851d3fc 2022-11-30 13:51:23 +00:00
Nicolai Hähnle cba252de08 update_test_checks: fix typos
Found by our downstream CI.
2022-11-29 23:08:47 +01:00
LLVM GN Syncbot 1114d1a976 [gn build] Port 185d4964a1 2022-11-29 20:47:01 +00:00
Mateja Marjanovic 68057c2b8d Add new vector types for LLVM
Add v9i32, v9f32, v10i32, v10f32, v11i32, v11f32, v12i32 and v12f32.

Differential Revision: https://reviews.llvm.org/D138136
2022-11-29 17:02:04 +01:00
Mircea Trofin 255e7e1c21 [UpdateTestChecks] Fix `update_*_test_checks.py` to add "unused" prefixes
The support introduced in D124306 was only added to
update_llc_test_checks.py, but the motivating usecases (see
https://lists.llvm.org/pipermail/llvm-dev/2021-February/148326.html)
cover update_test_checks.py, update_cc_test_checks.py, and
update_analyze_test_checks.py, too.

Issue #59220.

Differential Revision: https://reviews.llvm.org/D138836
2022-11-28 13:24:32 -08:00
Arthur Eubanks 16312c5d7a [MCJIT][test] Use new pass manager API 2022-11-28 12:23:42 -08:00
Kazu Hirata a677afd3c1 [TableGen] Use std::size (NFC)
std::size, introduced in C++17, allows us to directly obtain the
number of elements of an array.
2022-11-26 10:47:22 -08:00
LLVM GN Syncbot eddcc01f35 [gn build] Port ed34590c1a 2022-11-25 13:20:54 +00:00
Ivan Kosarev fce7a7aa9f [AMDGPU][AsmParser] Refine parsing instruction operands.
Eliminates the need for working around optional and token operands being
mistakenly parsed as expressions.

Reviewed By: dp

Differential Revision: https://reviews.llvm.org/D138492
2022-11-24 10:50:26 +00:00
Nico Weber 4ffc6f3b83 [bolt] Stop setting config.llvm_plugin_ext in lit.site.cfg.py.in
config.llvm_plugin_ext is used by lit to set the %pluginext
substitution. bolt's tests don't use %pluginext, so they don't
need to set config.llvm_plugin_ext.

Differential Revision: https://reviews.llvm.org/D138325
2022-11-22 20:29:14 -05:00
Sami Tolvanen cacd3e73d7 Add generic KCFI operand bundle lowering
The KCFI sanitizer emits "kcfi" operand bundles to indirect
call instructions, which the LLVM back-end lowers into an
architecture-specific type check with a known machine instruction
sequence. Currently, KCFI operand bundle lowering is supported only
on 64-bit X86 and AArch64 architectures.

As a lightweight forward-edge CFI implementation that doesn't
require LTO is also useful for non-Linux low-level targets on
other machine architectures, add a generic KCFI operand bundle
lowering pass that's only used when back-end lowering support is not
available and allows -fsanitize=kcfi to be enabled in Clang on all
architectures.

This relands commit eb2a57ebc7 with
fixes.

Reviewed By: nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D135411
2022-11-22 23:01:18 +00:00
David Tenty 2edc54eded [lit][AIX] Add LIBPATH to pass through env vars
AIX uses LIBPATH to specify the library search path in addition to
LD_LIBRARY_PATH, and a lot of users / tooling will use it
preferentially. In lit we currently pass through LD_LIBRARY_PATH but not
LIBPATH in the env on AIX, this patch corrects this inconsistency.

Differential Revision: https://reviews.llvm.org/D138510
2022-11-22 17:22:52 -05:00
dbakunevich 073aebc431 [Utils] Improved chunk-print-before-all.py script
As part of this patch, the ability to work with dump files
containing ir after passes received using the -print-after-all
option was added to script chunk-print-before-all.py.
The names of the output files have also been changed.
	Before: chunk-NUM.ll
	Now: NUM-STAGE-PASS_NAME.ll
NUM - sequence number of the pass operation.
STAGE - stage of the pass operation (for example: before, after, dump).
PASS_NAME - the name of the pass.
2022-11-23 01:11:54 +07:00
Dmitry Bushev 95ef005230 [RISCV][NFC] Mark rs1 in most memory instructions as memory operand.
Marking rs1 (memory offset base) as memory operand provides additional
semantic value to this operand that can be used by different tools
(e.g. llvm-exegesis).

This change does not affect neigther Isel nor assembler. However it
required some tweaks in tablegen compressed inst emmiter.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D136847
2022-11-22 16:42:44 +03:00
Nico Weber edbfb829ba [gn build] Add missing dep from check-bolt on llvm-bat-dump 2022-11-21 20:48:46 -05:00
Nico Weber 6bb781fa9a [gn build] Add build files for //bolt
Adds build files for libraries, tools, and tests -- everything except
the runtime.

Doesn't hook up bolt in the main BUILD.gn file yet -- I want to verify
that it builds on Linux, macOS, Windows before doing that. (I've only
checked on macOS so far.)

`ninja check-bolt` passes on macOS with this.
(I locally bumped the deployment target to macOS 10.12 for that. bolt/ uses
std::mutex quite a bit, which requires 10.12.)

Differential Revision: https://reviews.llvm.org/D138355
2022-11-21 19:45:54 -05:00
Nico Weber 281a5c7ef1 [llvm,polly,clang] Stop setting config.enable_shared in most places
Clang's lit.cfg.py reads this to add an "enable-shared" feature that
three of clang's lit tests use. Nothing else reads enable_shared, so
remove it from most lit.site.cfg.py.in files.

Differential Revision: https://reviews.llvm.org/D138301
2022-11-21 08:54:14 -05:00
Bjorn Pettersson 294fdd9903 [TableGen] Fix SubRegIndex size computation for concatenated subregs of unknown size
When calculating the size of concatenated subregisters, and at least
one of the subregisters involved has an unknown size (-1), then the
concatenated size should be set to -1 as well.

This bug was found for an out-of-tree target.

Looking at lib/Target the only in-tree target that has a subregister
with unknown size is X86:
  X86RegisterInfo.td:  def sub_mask_0   : SubRegIndex<-1>;

But it looks like sub_mask_0 don't result in any concatenated subreg
index with faulty size if looking at X86SubRegIdxRanges[].

Differential Revision: https://reviews.llvm.org/D138341
2022-11-20 20:52:13 +01:00
Bjorn Pettersson a6cb924abc [TableGen] Let -register-info-debug dump Offset/Size for each SubRegIndex
This patch adds dumping of the Offset and Size info for each
SubRegIndex printed when using
  llvm-tblgen -gen-register-info -register-info-debug

It also updates the ConcatenatedSubregs.td to check those printouts,
including some new subreg definitions that show short-comings in
how the size is calculated when concatenating subregisters and at
least one has an incomplete size (-1). Today TableGen will just add
sizes together, resulting in MCRegisterInfo::getSubRegIdxSize()
returning a value that isn't -1 even if the combined subregister size
is unknown.

Differential Revision: https://reviews.llvm.org/D138340
2022-11-20 20:52:13 +01:00
Nico Weber 3b48a97b19 [gn build] port af8c49dc1e 2022-11-20 12:02:33 -05:00
Nico Weber 7c188afde1 [gn build] Reformat all build files
Ran:

    git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
2022-11-19 11:54:55 -05:00
Simon Pilgrim 5acc03cdf3 [TableGen] SubtargetEmitter.cpp - clang-format includes sorting. NFC. 2022-11-19 16:49:10 +00:00
Nico Weber 63f79fe2eb [gn build] port 7059a6c32c 2022-11-18 06:48:51 -05:00
Fangrui Song fc91c70593 Revert D135411 "Add generic KCFI operand bundle lowering"
This reverts commit eb2a57ebc7.

llvm/include/llvm/Transforms/Instrumentation/KCFI.h including
llvm/CodeGen is a layering violation. We should use an approach where
Instrumementation/ doesn't need to include CodeGen/.
Sorry for not spotting this in the review.
2022-11-17 22:45:30 +00:00
Sami Tolvanen eb2a57ebc7 Add generic KCFI operand bundle lowering
The KCFI sanitizer emits "kcfi" operand bundles to indirect
call instructions, which the LLVM back-end lowers into an
architecture-specific type check with a known machine instruction
sequence. Currently, KCFI operand bundle lowering is supported only
on 64-bit X86 and AArch64 architectures.

As a lightweight forward-edge CFI implementation that doesn't
require LTO is also useful for non-Linux low-level targets on
other machine architectures, add a generic KCFI operand bundle
lowering pass that's only used when back-end lowering support is not
available and allows -fsanitize=kcfi to be enabled in Clang on all
architectures.

Reviewed By: nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D135411
2022-11-17 21:55:00 +00:00
LLVM GN Syncbot ed4943d560 [gn build] Port 332c4af35d 2022-11-16 15:19:13 +00:00
Muhammad Omair Javaid 332c4af35d Revert "[NFC] Make format() more amenable to format attributes"
This reverts commit cf239c2f17.
It has broken tools/llvm-dwarfdump/X86/simplified-template-names.s on
following buildbot:
https://lab.llvm.org/buildbot/#/builders/178/builds/3148
2022-11-16 19:09:49 +04:00
Paul Robinson 56470b72f1 [lit] Add `target=<triple>` as a feature keyword
As proposed first in D107162 and later in discourse at
https://discourse.llvm.org/t/rfc-lits-requires-and-triples/66041

Modified a couple of lit's own tests to use this; left others as-is,
because for now triple substrings still work in UNSUPPORTED/XFAIL.

Differential Revision: https://reviews.llvm.org/D137434
2022-11-16 05:50:45 -08:00
LLVM GN Syncbot e611d41143 [gn build] Port 617277e7cb 2022-11-16 06:08:50 +00:00
Woody Lin 409eaff5dd [AArch64InstPrinter] Print TargetAddress as an uint64_t
Outputs readable addresses by printed 'TargetAddress' as an uint64_t
value.

`bl     -0x37efd56628` => `bl     0xffffffc8102a99d8`

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D137260
2022-11-16 13:34:22 +08:00
LLVM GN Syncbot 8d0b2f09a2 [gn build] Port a16bd4f9f2 2022-11-15 22:46:53 +00:00
LLVM GN Syncbot b7d9310128 [gn build] Port 4be39288f5 2022-11-15 22:46:52 +00:00
Nico Weber 20b0e0a71a [gn build] Stop defining GTEST_LANG_CXX11, pass /Zc:__cplusplus with msvc
Ports:
* https://reviews.llvm.org/D84023
* https://reviews.llvm.org/rG4f5ccc72f6a6e
  (but see https://reviews.llvm.org/rG4901199f5b84b223)

No intended behavior change.
2022-11-15 10:56:53 -05:00
Nico Weber 1b829c3d3a [gn build] Make libcxx_enable_debug_mode work better, maybe
Refer to _LIBCPP_ENABLE_DEBUG_MODE instead of the old _LIBCPP_DEBUG
in a comment, and write that to __config_site correctly too.

See 13ea134323 and the comments in https://crbug.com/1358646.

Also change the default of libcxx_enable_debug_mode to false for now.
Since we used to not write _LIBCPP_ENABLE_DEBUG_MODE, the previous
default of true had no effect (except for compiling debug.cpp and
legacy_debug_handler.cpp, which we now no longer build by default).
So this (mostly) preserves previous behavior.
2022-11-15 10:45:41 -05:00
Martin Storsjö b95f54350c [lit] [Windows] Print exit codes > 255 as hex too
891bb4872c made negative exit codes
be printed as hex, which makes it easier to recognize e.g.
0xC0000005 instead of -1073741819. However, current Python versions
(at least the ones I'm using) seem to end up with positive unsigned
return codes, so that again ends up printed as 3221225477.

Print any return code over 255 as a hexadecimal number instead.

Differential Revision: https://reviews.llvm.org/D137771
2022-11-15 12:09:32 +02:00
LLVM GN Syncbot a4ae029b08 [gn build] Port 1ebfe9b264 2022-11-15 09:07:55 +00:00
Matt Arsenault a583654a8b GlobalISel: Add debug print for applied rule in generated combiner 2022-11-14 15:59:05 -08:00
LLVM GN Syncbot c83c69dd0d [gn build] Port d52e2839f3 2022-11-14 14:05:19 +00:00
LLVM GN Syncbot 7e4cfcdb6f [gn build] Port dd46a08008 2022-11-14 10:12:18 +00:00
Nikita Popov feda983ff8 [TableGen] Use MemoryEffects to represent intrinsic memory effects (NFCI)
The TableGen implementation was using a homegrown implementation of
FunctionModRefInfo. This switches it to use MemoryEffects instead.
This makes the code simpler, and will allow exposing the full
representational power of MemoryEffects in the future. Among other
things, this will allow us to map IntrHasSideEffects to an
inaccessiblemem readwrite, rather than just ignoring it entirely
in most cases.

To avoid layering issues, this moves the ModRef.h header from IR
to Support, so that it can be included in the TableGen layer.

Differential Revision: https://reviews.llvm.org/D137641
2022-11-14 10:52:04 +01:00
Nico Weber 6e8f8b1964 [gn build] Extract gen_arch_intrinsics() template to remove some duplication
No behavior change.

Differential Revision: https://reviews.llvm.org/D137784
2022-11-13 09:38:53 -05:00
Fangrui Song ff1ebcc5fe DecoderEmitter: Simplify addOneOperandFields. NFC
Follow-up to d1fbdf5bf7
2022-11-13 01:15:54 -08:00
Fangrui Song dc4a7293a8 [TableGen] Remove unneeded flush and add missing newline 2022-11-13 00:48:47 -08:00
Tom Stellard a7ba84a39d cmake: Inline the add_llvm_symbol_exports.py script
This fixes stand-alone builds.

Reviewed By: andrewng

Differential Revision: https://reviews.llvm.org/D137611
2022-11-10 13:18:47 -08:00
Konrad Kleine fd8ba4f537 [release] Add third-party tarball to release for standalone builds
With the advent of https://reviews.llvm.org/D131919 and
a11cd0d94e
 the third-party directory is required to build LLVM and other packages and in standalone
builds the third-party directory is not available from the llvm tarball anymore.

Differential Revision: https://reviews.llvm.org/D137777
2022-11-10 20:55:19 +01:00