Commit Graph

11173 Commits

Author SHA1 Message Date
LLVM GN Syncbot 5314582407 [gn build] Port 90cb325abd 2022-03-29 06:21:57 +00:00
LLVM GN Syncbot 75c8585ef0 [gn build] Port 2add3fbd97 2022-03-28 23:38:54 +00:00
LLVM GN Syncbot 040c80924c [gn build] Port c5e54e2752 2022-03-28 20:09:41 +00:00
LLVM GN Syncbot 12f0802c93 [gn build] Port c0eb9b4cde 2022-03-28 08:27:36 +00:00
LLVM GN Syncbot f7e3174ec0 [gn build] Port ad57e10dbc 2022-03-28 06:40:50 +00:00
Shengchen Kan 4a48742922 [X86][tablgen] Extract common functions in X86EVEX2VEXTablesEmitter.cpp and X86FoldTablesEmitter.cpp to avoid duplicated code. NFC 2022-03-27 08:47:18 +08:00
Shengchen Kan 460e1bd66e [X86][tablgen] Remove PointerLikeRegClass from isRegisterOperand b/c getRegOperandSize crashes for it. NFCI 2022-03-27 07:35:47 +08:00
LLVM GN Syncbot 139416cb5e [gn build] Port 555214cbcc 2022-03-26 16:10:19 +00:00
Shengchen Kan 3e41917984 [X86][tablgen] Remove useless check in X86FoldTablesEmitter.cpp. NFC
Any `X86Inst` has a name.
2022-03-27 00:09:29 +08:00
Shengchen Kan a86cd3be1c [X86][tablgen] Rename some fields for RecognizableInstrBase to align with fields in TD file. NFC
The comment for `HasVEX_L` is updated.
2022-03-26 23:32:50 +08:00
Shengchen Kan dc68ca3eff [X86][tablgen] Rename field hasREX_WPrefix to hasREX_W for X86Inst. NFC
To make it more like hasVEX_L and hasEVEX_K, etc.
2022-03-26 23:14:08 +08:00
Shengchen Kan 271e8d2495 [X86][tablgen] Refine the class RecognizableInstr. NFCI
1. Add comments to explain why we set `isAsmParserOnly` for XACQUIRE and XRELEASE
2. Check `X86Inst` in the constructor of `RecognizableInstrBase` so that
   we can avoid the case where one of it's field is not initialized but
   accessed by user. (e.g. in X86EVEX2VEXTablesEmitter.cpp)
3. Move `Rec` from `RecognizableInstrBase` to `RecognizableInstr` to reduce
   size of `RecognizableInstrBase`
4. Remove out-of-date comments for shouldBeEmitted() (filter() was removed)
5. Add a basic field `IsAsmParserOnly` and remove the field
   `ShouldBeEmitted` b/c we can deduce it w/ little overhead
2022-03-26 22:41:49 +08:00
Shengchen Kan c8ea732937 [X86][tablgen] Set ShouldBeEmitted to false when isAsmParserOnly is true. NFCI
In fact, an instruction can not be emitted to disassemble table when
`isAsmParserOnly` is true, so `isAsmParserOnly=true` implies
`ShouldBeEmitted=false`.

We check `isAsmParserOnly` in X86FoldTablesEmitter.cpp at a early stage
b/c none of them is foldable.
2022-03-26 19:10:58 +08:00
Shengchen Kan 5f543cb0ef [X86][tablgen] Use initializer list for some fields of RecognizableInstr*. NFC
Also, some code in constructor of `RecognizableInstrBase` is formatted.
2022-03-26 18:03:13 +08:00
Shengchen Kan 7a94fa58c4 [X86][tablgen] Move fields Name, Is64Bit, Is32Bit, Operands from RecognizableInstrBase to RecognizableInstr, NFCI
These four fields are not used by any user of `RecognizableInstrBase`,
so we can move them to `RecognizableInstr` to avoid unnecessary
construction.
2022-03-26 16:43:18 +08:00
Shengchen Kan bf11ed293a [X86][tablgen] Add class RecognizableInstrBase to simplify X86 code, NFCI 2022-03-26 13:03:06 +08:00
Shengchen Kan e13faa40cf [X86][tablgen] Add interface getMnemonic to namespace X86Disassembler, NFCI
Address comments in D122477 b/c `getMnemonic` is common to X86 and may be
used in more than one place.
2022-03-26 09:55:54 +08:00
Maksim Panchenko 4ae9745af1 [Disassember][NFCI] Use strong type for instruction decoder
All LLVM backends use MCDisassembler as a base class for their
instruction decoders. Use "const MCDisassembler *" for the decoder
instead of "const void *". Remove unnecessary static casts.

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D122245
2022-03-25 18:53:59 -07:00
Sam McCall 57ee624d79 [cmake] Provide CURRENT_TOOLS_DIR centrally, replacing CLANG_TOOLS_DIR
CLANG_TOOLS_DIR holds the the current bin/ directory, maybe with a %(build_mode)
placeholder. It is used to add the just-built binaries to $PATH for lit tests.
In most cases it equals LLVM_TOOLS_DIR, which is used for the same purpose.
But for a standalone build of clang, CLANG_TOOLS_DIR points at the build tree
and LLVM_TOOLS_DIR points at the provided LLVM binaries.

Currently CLANG_TOOLS_DIR is set in clang/test/, clang-tools-extra/test/, and
other things always built with clang. This is a few cryptic lines of CMake in
each place. Meanwhile LLVM_TOOLS_DIR is provided by configure_site_lit_cfg().

This patch moves CLANG_TOOLS_DIR to configure_site_lit_cfg() and renames it:
 - there's nothing clang-specific about the value
 - it will also replace LLD_TOOLS_DIR, LLDB_TOOLS_DIR etc (not in this patch)

It also defines CURRENT_LIBS_DIR. While I removed the last usage of
CLANG_LIBS_DIR in e4cab4e24d, there are LLD_LIBS_DIR usages etc that
may be live, and I'd like to mechanically update them in a followup patch.

Differential Revision: https://reviews.llvm.org/D121763
2022-03-25 20:22:01 +01:00
LLVM GN Syncbot a78bd83264 [gn build] Port cef52105bd 2022-03-25 18:54:35 +00:00
LLVM GN Syncbot bb48c3a9e7 [gn build] Port 39b80c8380 2022-03-25 15:50:53 +00:00
Johannes Doerfert a81fff8afd Reapply "[Intrinsics] Add `nocallback` to the default intrinsic attributes"
This reverts commit c5f789050d and
reapplies 7aea3ea8c3 with additional test
changes.
2022-03-25 09:36:50 -05:00
Aakanksha b0225ab8fd Prevent comparison with wider type in loop condition
This change fixes the code violations flagged in AMD compute CodeQL scan - "comparison-with-wider-type"

Differential Revision: https://reviews.llvm.org/D122447
2022-03-25 11:35:18 +00:00
Tom Stellard 3929f91397 Release Workflow: Remove cherry-pick-failed label when pull request is created
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D121032
2022-03-25 00:45:28 -07:00
LLVM GN Syncbot 382797d475 [gn build] Port 75112133b8 2022-03-25 07:28:25 +00:00
Nico Weber c4eae8a4eb Make BLAKE3 a component library
It's unusual that BLAKE3/CMakeLists.txt just defines a list of
files that it injects into its parent scope. The list should either
be defined in llvm/lib/Support/CMakeLists.txt, or
llvm/lib/Support/BLAKE3/CMakeLists.txt should define an object
library.

This does the latter. It makes llvm/lib/Support/BLAKE3/CMakeLists.txt
more self-contained.

No behavior change.

Differential Revision: https://reviews.llvm.org/D122428
2022-03-24 21:16:55 -04:00
Arthur Eubanks df0b893d94 [opt] Remove -analyze option
This is legacy PM-specific, which is deprecated.

Uses of this should be replaced with a corresponding `-passes='print<foo>'`.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D122420
2022-03-24 14:10:57 -07:00
Nico Weber 8705708b6d Revert "[gn build] Manually port llvm/lib/Support/BLAKE3"
This reverts commit 8424d4f641.
That approach doesn't work. I checked in something that kinda
works 30 min ago or so.
2022-03-24 15:24:02 -04:00
LLVM GN Syncbot 1e3713f6df [gn build] Port 2022-03-24 19:11:19 +00:00
Fangrui Song 8424d4f641 [gn build] Manually port llvm/lib/Support/BLAKE3 2022-03-24 12:06:19 -07:00
Johannes Doerfert c5f789050d Revert "[Intrinsics] Add `nocallback` to the default intrinsic attributes"
This reverts commit 7aea3ea8c3 as it
breaks the buildbots.

I didn't see these failures in the pre-merge checks, looking into it.
2022-03-24 14:04:41 -05:00
Nico Weber 973acc3db5 [gn build] ugly hack to work around sync script for now 2022-03-24 14:56:51 -04:00
Nico Weber 0bfa1ab025 [gn build] (manually) port 9aa701984d (BLAKE3) 2022-03-24 14:51:24 -04:00
Johannes Doerfert 7aea3ea8c3 [Intrinsics] Add `nocallback` to the default intrinsic attributes
Most intrinsics, especially "default" ones, will not call back into the
IR module. `nocallback` encodes this nicely. As it was not used before,
this patch also makes use of `nocallback` in the Attributor which
results in many more `norecurse` deductions.

Tablegen part is mechanical, test updates by script.

Differential Revision: https://reviews.llvm.org/D118680
2022-03-24 13:50:54 -05:00
Arthur Eubanks a7ea304f93 [gn build] Manually port 0c86198b2 2022-03-24 10:56:21 -07:00
LLVM GN Syncbot ced9bbe0b2 [gn build] Port 62d5f254cc 2022-03-24 13:50:02 +00:00
Nico Weber 028f9f5b2b [gn build] remove a "from __future__" import not needed after 0ff3cc2087 2022-03-24 09:07:54 -04:00
LLVM GN Syncbot 621cc83fc1 [gn build] Port 406bde9a15 2022-03-24 12:12:11 +00:00
Dávid Bolvanský 3642baf5dd [NFCI] Fix set-but-unused warning in X86DisassemblerTables.cpp 2022-03-24 10:31:29 +01:00
LLVM GN Syncbot bf6f5113bc [gn build] Port 64902d335c 2022-03-24 01:49:33 +00:00
Zequan Wu 0396e229cd Revert "[gn build] Port 9c542a5a4e1b"
This reverts commit e28ace8a97.
2022-03-23 16:11:54 -07:00
Nico Weber 0ff3cc2087 [gn build] Change python run lines to python3
macOS 12.3 no longer ships non-3 python.

Almost all of these scripts were launched by ninja, and the GN files
already told it to run them under python3, so this is a fairly small
change.  The main effect is that if you run them manually, you now
get the same behavior.

(A small set of scripts, gn.py, gen.py, sync_source_lists_from_cmake.py,
are for manual running.  For these, it is an actual change.)

Differential Revision: https://reviews.llvm.org/D122345
2022-03-23 16:42:18 -04:00
Nico Weber 88da78ddd0 Install symlink "otool" if LLVM_INSTALL_CCTOOLS_SYMLINKS is set
Differential Revision: https://reviews.llvm.org/D122313
2022-03-23 16:22:24 -04:00
Nico Weber 69cde915e9 [gn build] add llvm_install_cctools_symlinks arg
It behaves (mostly) like the LLVM_INSTALL_CCTOOLS_SYMLINKS option
in cmake.

The minor difference is that the llvm-objcopy symlinks bitcode_strip
and install_name_tool symlink to llvm-objcopy directly in the GN build,
while it's a bitcode_strip -> llvm-bitcode-strip -> objcopy chain
in the CMake build (and analogous for install_name_tool).

The implementation is very similar to the implementation of the
existing llvm_install_binutils_symlinks arg.

Differential Revision: https://reviews.llvm.org/D122312
2022-03-23 16:19:54 -04:00
Nico Weber f9889dd28a [gn build] (manually) port b0fd9497af 2022-03-23 16:16:53 -04:00
Nico Weber e85aee06d8 [gn build] (manually) port b0fd9497af 2022-03-23 15:46:42 -04:00
Arthur Eubanks 9bd66b312c [PassManager][Coroutine] Run passes under -O0 conditionally and run GlobalDCE
CoroSplit lowers various coroutine intrinsics. It's a CGSCC pass and
CGSCC passes don't run on unreachable functions. Normally GlobalDCE will
come along and delete unreachable functions, but we don't run GlobalDCE
under -O0, so an unreachable function with coroutine intrinsics may
never have CoroSplit run on it.

This patch adds GlobalDCE when coroutines intrinsics are present. It
also now runs all coroutine passes conditional when coroutine intrinsics
are present. This should also solve the -O0 regression reported in
D105877 due to LazyCallGraph construction.

Fixes https://github.com/llvm/llvm-project/issues/54117

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D122275
2022-03-23 11:03:26 -07:00
Xiaodong Liu 9580f95488 [Dockerfile] Upgrade debian base image to version 10
Debian8 is too old to build LLVM project, the version
of GCC, CMake and python are lower than the requirements:
https://llvm.org/docs/GettingStarted.html#software

Debian10 is the earliest release that has software
packages that meet the above requirements.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D120826
2022-03-23 15:32:15 +00:00
Arthur Eubanks e22b78de27 [gn build] Manually port 89f6b26 2022-03-22 16:26:44 -07:00
Craig Topper 9b0f227d7b [TableGen][RISCV] Add InstAliases with zero_reg to cover unmasked vnot.v, vncvt.x.x.w, vneg.v, etc.
The mask being NoRegister prevented the existing aliases from matching
since NoRegister isn't in the VMV0 register class.

To workaround this I've added new aliases that look for zero_reg.
I had to motify tablegen to generate matching code for zero_reg.
And as a consequence, I had to change the EmitPriority for an ARM
alias that used zero_reg that started printing.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D121496
2022-03-22 10:14:43 -07:00
Craig Topper 49c2206b3b [VP] Preserve address space of pointer for strided load/store intrinsics.
This adds LLVMAnyPointerToElt to use instead of LLVMPointerToElt.
This allows us to preserve the address space as part of the type
overload for the intrinsic, but still require the vector element
type to match the pointer type.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D122042
2022-03-22 09:52:54 -07:00
Shengchen Kan 6902734eb3 [X86] Simplify attributes of the generated memory folding table (NFCI)
This reduces the gaps between tables in X86GenFoldTables.inc and X86InstrFoldTables.cpp
2022-03-22 16:02:54 +08:00
Sheng 23423c0ea8 [TableGen] Fix a misuse of getValueAsBitsInit
`getValueAsBitsInit` will assert when the "SoftFail" isn't presented.

But given the 'if' statement below, we should've allowed this situation.

This patch fix this.
2022-03-22 06:04:36 +00:00
LLVM GN Syncbot 01f76917cc [gn build] Port e6c84f82b8 2022-03-21 20:44:15 +00:00
Nico Weber 312ec6f156 [gn build] Use lld-link's new /winsysroot: flag
If `clang_base_path` is set, it must now point to a directory that contains
an lld-link built with D118070.

(If this is a problem for anyone, we can guard this behind a
lld_link_understands_winsysroot gn arg, but let's see if we can get away
without that for now.)

With this, it's possible to build everything in a normal cmd.exe Window,
an MSVC shell isn't needed \o/

(Assuming you set `clang_base_path`, and you set `sysroot` to a directory
that contains a win sysroot. If you have MSVC installed,
`python3 llvm\utils\sysroot.py make-fake --out-dir=my-sysroot` and
setting `sysroot = "//my-sysroot"` in args.gn works, for example.)

Differential Revision: https://reviews.llvm.org/D121871
2022-03-21 13:43:38 -04:00
LLVM GN Syncbot f8cda8f6be [gn build] Port 7917b3c695 2022-03-21 17:28:05 +00:00
Dave Lee 826bdf51ff [lldb] Fix llvm::Optional summary provider
Differential Revision: https://reviews.llvm.org/D122041
2022-03-21 10:03:16 -07:00
Amir Ayupov 442e9e1389 [X86][NFC] MnemonicTables: only access RI fields if they're initialized
Fix an issue reported by UBSan.

Test Plan:
Configure with `-DLLVM_USE_SANITIZER="Address;Undefined"`
`ninja llc`

Differential Revision: https://reviews.llvm.org/D122140
2022-03-21 09:25:29 -07:00
Aaron Puchert 3a33664e88 Add cmake/ to release tarballs via concatenation
The solution using append was reported not to work, but additionally it
would use the contents of the checked-out source tree instead of the git
tag or commit. This uses `git archive`, so it will use the right commit,
and at least for me (with GNU tar) it seems to work as intended.

Should fix #53281.

Reviewed By: kwk

Differential Revision: https://reviews.llvm.org/D121972
2022-03-21 15:28:29 +01:00
Nikita Popov 062b1ae7e0 Reapply [Utils] Fix %S substitution
%S refers to the directory of %s, not to the cwd. This is mostly
handled correctly, but update_cc_test_checks.py used the wrong
path for non-FileCheck RUN lines.

Reapplying this with a fix for an update_cc_test_checks test that
was based on cwd semantics.
2022-03-21 15:15:34 +01:00
Nikita Popov 7af5fc1372 Revert "[Utils] Fix %S substitution"
This reverts commit 8ee1ef2a08.

This breaks an update_cc_test_checks test that is based on an
incorrect %S use, revert until I can fix it.
2022-03-21 14:25:02 +01:00
Nikita Popov 8ee1ef2a08 [Utils] Fix %S substitution
%S refers to the directory of %s, not to the cwd. This is mostly
handled correctly, but update_cc_test_checks.py used for the wrong
path for non-FileCheck RUN lines.
2022-03-21 13:22:34 +01:00
LLVM GN Syncbot 819419f996 [gn build] Port 9ada761be3 2022-03-21 07:47:10 +00:00
Shengchen Kan 871db60e1c [NFC] Remove unused parameters for SubtargetEmitter::ParseFeaturesFunction 2022-03-19 19:14:22 +08:00
Nico Weber 3ac84c430b Reland "[gn build] (manually) port 6316129e066e"
This reverts commit 21b97df74c.
6316129e06 relanded in 7b983917d4.
2022-03-18 15:43:02 -04:00
Tomas Matheson 831ab35b2f [ARM][AArch64] generate subtarget feature flags
Reland of D120906 after sanitizer failures.

This patch aims to reduce a lot of the boilerplate around adding new subtarget
features. From the SubtargetFeatures tablegen definitions, a series of calls to
the macro GET_SUBTARGETINFO_MACRO are generated in
ARM/AArch64GenSubtargetInfo.inc.  ARMSubtarget/AArch64Subtarget can then use
this macro to define bool members and the corresponding getter methods.

Some naming inconsistencies have been fixed to allow this, and one unused
member removed.

This implementation only applies to boolean members; in future both BitVector
and enum members could also be generated.

Differential Revision: https://reviews.llvm.org/D120906
2022-03-18 16:07:00 +00:00
LLVM GN Syncbot 00145bcb4c [gn build] Port a36c2dd6d5 2022-03-18 14:44:37 +00:00
LLVM GN Syncbot 959e2f00b0 [gn build] Port f83d833e41 2022-03-18 12:43:27 +00:00
Nico Weber ec49c84fb9 [gn build] (manually) port a954ade8ed (gen X86GenMnemonicTables.inc) 2022-03-18 08:42:50 -04:00
Nico Weber d2dc52493e [gn build] (semiautomatically) port fdcb256f97 2022-03-18 08:42:50 -04:00
Nico Weber 21b97df74c Revert "[gn build] (manually) port 6316129e066e"
This reverts commit 5f4a334ded.
6316129e06 was reverted in 112aafcaf4.
2022-03-18 08:26:46 -04:00
Tomas Matheson 62c481542e Revert "[ARM][AArch64] generate subtarget feature flags"
This reverts commit dd8b0fecb9.
2022-03-18 11:58:20 +00:00
Tomas Matheson dd8b0fecb9 [ARM][AArch64] generate subtarget feature flags
This patch aims to reduce a lot of the boilerplate around adding new subtarget
features. From the SubtargetFeatures tablegen definitions, a series of calls to
the macro GET_SUBTARGETINFO_MACRO are generated in
ARM/AArch64GenSubtargetInfo.inc.  ARMSubtarget/AArch64Subtarget can then use
this macro to define bool members and the corresponding getter methods.

Some naming inconsistencies have been fixed to allow this, and one unused
member removed.

This implementation only applies to boolean members; in future both BitVector
and enum members could also be generated.

Differential Revision: https://reviews.llvm.org/D120906
2022-03-18 11:48:20 +00:00
Amir Ayupov fdcb256f97 [TableGen] X86 mnemonic tables backend
Add tablegen backend that generates X86 mnemonic-based opcode groupings, e.g.
`isADD`, `isTEST`, etc.

Addresses https://lists.llvm.org/pipermail/llvm-dev/2022-January/154526.html

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D121571
2022-03-18 01:43:53 -07:00
Shengchen Kan 9e832a67fe [Codegen][tablgen][NFC] Allow meta instruction to be target dependent
An instruction is a meta-instruction if it doesn't produce any output
in the form of executable instructions. So in the concept, a
meta-instruction does not have to be target independent.

Before this patch, `isMetaInstruction` is implemented by checking the
opcode of the instruction, add we have no way to add target dependent
opcode to the list, which does not make sense.

After this patch, a bit `isMeta` is added for class `Instruction` in
tablegen, which is used to indicate whether it's a meta instruction.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D121600
2022-03-18 13:09:01 +08:00
Nico Weber 5f4a334ded [gn build] (manually) port 6316129e06 2022-03-17 20:08:14 -04:00
LLVM GN Syncbot f18590118e [gn build] Port 22570bac69 2022-03-17 19:06:22 +00:00
LLVM GN Syncbot cb29df4998 [gn build] Port 1af5fbd5c6 2022-03-17 16:55:08 +00:00
LLVM GN Syncbot 56a25a95d4 [gn build] Port 22077627ae 2022-03-16 23:23:57 +00:00
Nico Weber 668d880f59 [gn build] (manually) port 5aab45f430 (SymbolGraph) 2022-03-16 19:18:27 -04:00
LLVM GN Syncbot a8ef5d2f6d [gn build] Port c2f62ab84b 2022-03-16 15:19:44 +00:00
Nico Weber 14d1a58209 [gn build] (manually) port e4cab4e24d 2022-03-16 07:52:50 -04:00
Sam McCall 75acad41bc Use lit_config.substitute instead of foo % lit_config.params everywhere
This mechanically applies the same changes from D121427 everywhere.

Differential Revision: https://reviews.llvm.org/D121746
2022-03-16 09:57:41 +01:00
Sam McCall e4cab4e24d [lit] Remove clang_libs_dir
Seems to have been added accidentally in 58db03a116 and then
copied into clangd by me (but not actually needed).
2022-03-16 03:03:02 +01:00
Nico Weber fd20ec6b6e [gn build] (manually) port 89cd86bbc5 (clang-pseudo move) 2022-03-15 20:45:36 -04:00
Nico Weber 78d29203ad [gn build] (manually) port 2b69eb4a7d 2022-03-15 19:05:46 -04:00
Sam McCall fa1019fa18 [lit] add lit_config.substitute to interpolate lit_config.params
A version of this logic appears in ~every lit.site.cfg.in (28 copies total).
This patch just removes two, but I'll update the rest of llvm-project next.

Differential Revision: https://reviews.llvm.org/D121427
2022-03-15 22:09:43 +01:00
LLVM GN Syncbot d6d67083e8 [gn build] Port d46409fc8e 2022-03-15 18:43:11 +00:00
LLVM GN Syncbot c55b4c276f [gn build] Port 7262eacd41 2022-03-15 13:08:09 +00:00
Keith Smiley 6541d3e979 [test] Add lit helper for windows paths
This adds 2 new lit helpers `%{fs-src-root}` and `%{fs-sep}`, these
allow writing tests that correctly handle slashes on Windows. In the
case of tests like clang/test/CodeGen/debug-prefix-map.c, these are
unable to correctly test behavior on both platforms, unless they fork
and add OS requirements, because the relevant logic hits host specific
codepaths like checking if paths are absolute.

Differential Revision: https://reviews.llvm.org/D111457
2022-03-14 20:05:55 -07:00
LLVM GN Syncbot e28ace8a97 [gn build] Port 9c542a5a4e 2022-03-15 00:51:57 +00:00
Peter Collingbourne aaca634c94 gn build: Add support for building with libcurl.
Differential Revision: https://reviews.llvm.org/D121260
2022-03-14 12:52:19 -07:00
LLVM GN Syncbot 5fc70e53bf [gn build] Port 5e65e79bac 2022-03-14 16:52:53 +00:00
LLVM GN Syncbot 6c123674d8 [gn build] Port 999fa9f687 2022-03-12 17:10:56 +00:00
serge-sans-paille ed98c1b376 Cleanup includes: DebugInfo & CodeGen
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D121332
2022-03-12 17:26:40 +01:00
LLVM GN Syncbot a7b1dccf7a [gn build] Port ee0f8c4010 2022-03-12 00:46:45 +00:00
LLVM GN Syncbot 6299089b94 [gn build] Port b1b4b6f366 2022-03-12 00:10:18 +00:00
Petr Hosek 0c0f6cfb7b [CMake] Rename TARGET_TRIPLE to LLVM_TARGET_TRIPLE
This clarifies that this is an LLVM specific variable and avoids
potential conflicts with other projects.

Differential Revision: https://reviews.llvm.org/D119918
2022-03-11 15:43:01 -08:00
serge-sans-paille fbbc41f8dd Cleanup include: TableGen
This also includes a few cleanup from Support.

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D121331
2022-03-11 11:41:32 +01:00
Sam McCall 895653d904 [cmake] Remove unused OUTPUT_MAPPING param to configure_lit_site_cfg(). NFC
Looks like it never did anything.
Added in 71deeee593
2022-03-10 21:26:53 +01:00
Nico Weber e32d061abe [gn build] (manually) port af98b0af67 2022-03-10 07:14:47 -05:00
LLVM GN Syncbot 9066a88f04 [gn build] Port c31014322c 2022-03-10 01:35:38 +00:00
Nico Weber c0700d3228 [gn build] (manually) port ffb9429b6f 2022-03-09 11:43:21 -05:00
LLVM GN Syncbot 741d64af28 [gn build] Port 2dc4a80ec0 2022-03-09 10:05:09 +00:00
LLVM GN Syncbot 7cc85f4d7e [gn build] Port c2cd15a665 2022-03-08 22:21:17 +00:00
Nico Weber 30b6b6a624 Revert "[gn build] (manually) port 0c2b43ab8c (X86MCTests)"
This reverts commit 336e3677ea.
0c2b43ab8c was reverted in cf9b3ef941.
2022-03-07 13:43:29 -05:00
Nico Weber 336e3677ea [gn build] (manually) port 0c2b43ab8c (X86MCTests) 2022-03-07 13:37:14 -05:00
Roman Lebedev 2b5a16420f
UpdateTestChecks: fix handling of UTC with spaces
We can't just split by space, that's not going to give us the same
argv we'd have gotten from the shell, it could be in a string,
we must actually parse that as argv.
2022-03-07 20:25:23 +03:00
LLVM GN Syncbot d229765e61 [gn build] Port 54d6b5b67f 2022-03-07 16:44:43 +00:00
LLVM GN Syncbot 20c4664552 [gn build] Port 205557c908 2022-03-07 16:17:21 +00:00
Roman Lebedev eadd1668d0
update_analyze_test_checks.py: fix UTC_ARGS handling
They should be both used if provided in the input test
and manifested in the updated test.
2022-03-07 18:22:19 +03:00
LLVM GN Syncbot 109d6e9dec [gn build] Port 311ff39178 2022-03-07 13:49:22 +00:00
Roman Lebedev df6c26fd34
update_analyze_test_checks.py: fix --filter handling
In particular, after filtering the check lines can't necessarily
use `-NEXT`, they may not be one directly after another.
2022-03-07 15:41:13 +03:00
LLVM GN Syncbot d7480d065d [gn build] Port 5f62156762 2022-03-07 09:08:13 +00:00
Stella Laurenzo 38151a08c2 Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"."
This reverts commit 7cdda6b8ce.

Differential Revision: https://reviews.llvm.org/D121020
2022-03-04 13:45:43 -08:00
LLVM GN Syncbot fa8293bbc7 [gn build] Port c88deef0a7 2022-03-04 17:22:23 +00:00
LLVM GN Syncbot a1e91b53f6 [gn build] Port 7ee97c24ef 2022-03-04 17:22:23 +00:00
LLVM GN Syncbot 2954f5b3f1 [gn build] Port e865fa7530 2022-03-04 00:22:21 +00:00
Sebastian Neubauer 473efae3a1 [UpdateTestChecks] Don't skip first line with --filter
body_start was never used, resulting in the first filtered line to be
skipped.
Fixes the --filter option introduced in D117694.

Differential Revision: https://reviews.llvm.org/D119704
2022-03-03 17:27:14 +01:00
LLVM GN Syncbot d48aee6991 [gn build] Port 8de8731591 2022-03-03 12:36:38 +00:00
Martin Storsjö 9e2236fb7b Reapply [lit] Read command stdout/stderr as text on Windows
This takes care of normalizing newlines back to single LF instead
of CRLF.

Fix up a couple tests that accidentally pass binary data to stdout.

Differential Revision: https://reviews.llvm.org/D120623
2022-03-03 13:31:31 +02:00
LLVM GN Syncbot 926f77dc22 [gn build] Port 8bcbfb50e8 2022-03-03 10:33:40 +00:00
Stella Laurenzo 7cdda6b8ce Revert "[cmake] Prefix gtest and gtest_main with "llvm_"."
lldb buildbot failure. will investigate and roll forward.

This reverts commit 9f37775472.
2022-03-02 11:13:46 -08:00
Stella Laurenzo 9f37775472 [cmake] Prefix gtest and gtest_main with "llvm_".
The upstream project ships CMake rules for building vanilla gtest/gmock which conflict with the names chosen by LLVM. Since LLVM's build rules here are quite specific to LLVM, prefixing them to avoid collision is the right thing (i.e. there does not appear to be a path to letting someone *replace* LLVM's googletest with one they bring, so co-existence should be the goal).

This allows LLVM to be included with testing enabled within projects that themselves have a dependency on an official gtest release.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D120789
2022-03-02 10:53:32 -08:00
LLVM GN Syncbot 91e9af32fc [gn build] Port ae60884dfe 2022-03-02 08:58:54 +00:00
LLVM GN Syncbot e1fd5a86c7 [gn build] Port 65588a0776 2022-03-02 06:10:52 +00:00
LLVM GN Syncbot c007a17af6 [gn build] Port 30e612ebdf 2022-03-02 02:38:00 +00:00
Arthur Eubanks 81291b636d [gn build] Add -fsanitize=fuzzer to link flags in fuzzer targets when llvm_use_sanitize_coverage 2022-03-01 16:10:51 -08:00
Nico Weber 015cbd7218 [gn build] (manually) port 15ab7bc3af (TestingSupportTests) 2022-03-01 18:50:22 -05:00
Tong Zhang 17ce89fa80 [SanitizerBounds] Add support for NoSanitizeBounds function
Currently adding attribute no_sanitize("bounds") isn't disabling
-fsanitize=local-bounds (also enabled in -fsanitize=bounds). The Clang
frontend handles fsanitize=array-bounds which can already be disabled by
no_sanitize("bounds"). However, instrumentation added by the
BoundsChecking pass in the middle-end cannot be disabled by the
attribute.

The fix is very similar to D102772 that added the ability to selectively
disable sanitizer pass on certain functions.

In this patch, if no_sanitize("bounds") is provided, an additional
function attribute (NoSanitizeBounds) is attached to IR to let the
BoundsChecking pass know we want to disable local-bounds checking. In
order to support this feature, the IR is extended (similar to D102772)
to make Clang able to preserve the information and let BoundsChecking
pass know bounds checking is disabled for certain function.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D119816
2022-03-01 18:47:02 +01:00
Martin Storsjö f570da28e6 Revert "[lit] Read command stdout/stderr as text on Windows"
This reverts commit 640e45b9b2.

That commit seemed to quite conclusively break a number of buildbots.
2022-03-01 14:43:55 +02:00
Martin Storsjö 640e45b9b2 [lit] Read command stdout/stderr as text on Windows
This takes care of normalizing newlines back to single LF instead
of CRLF.

This on itself breaks on a couple tests that accidentally seem to
be writing binary data to stdout; make sure those cases are piped
to /dev/null instead of actually written to a terminal.

Differential Revision: https://reviews.llvm.org/D120623
2022-03-01 14:24:02 +02:00
Yatao Wang 8565b6f9f2 [UpdateLLCTestChecks] Add support for isel debug output in update_llc_test_checks.py
Add a check on run lines to pick up isel options in llc commands and allow
generating check lines of isel final output other than assembly. If llc command
line contains -debug-only=isel, update_llc_test_checks.py will try to scrub isel
output, otherwise, the script will fall back on default behaviour, which is try to
scrub assembly output instead.

The motivation of this change is to allow usage of update_llc_test_checks.py to
autogenerate checks of instruction selection results. In this way, we can detect
errors at an earlier stage before the compilation goes all the way to assembly.
It is an example of having some transparency for the stages between IR and
assembly. These generated tests are almost like "unit tests" of isel stage.

This patch only implements the initial change to differentiate isel output from
assembly output for Lanai. Other targets will not be supported for isel check
generation at the moment. Although adding support for it will only require
implementing the function regex and scrubber for corresponding targets.

The Lanai implementation was chosen mainly for the simplicity of demonstrating
the difference between isel checks and asm checks.

This patch also do not include the implementation of function prefix, which is
required for the generated isel checks to pass. I will put up a follow up revision
for the function prefix change to complete isel support.

Reviewed By: Flakebi

Differential Revision: https://reviews.llvm.org/D119368
2022-03-01 10:55:53 +01:00
LLVM GN Syncbot 7a5394938a [gn build] Port d8a2afb244 2022-03-01 07:28:51 +00:00
LLVM GN Syncbot 215f996424 [gn build] Port 2022-02-28 22:24:55 +00:00
LLVM GN Syncbot b6a6ddf134 [gn build] Port a3255f219a 2022-02-28 20:01:32 +00:00
LLVM GN Syncbot a44c984d94 [gn build] Port 61835d19a8 2022-02-28 10:06:58 +00:00
Zi Xuan Wu 21bce9007a [Support] Add CSKY target parser and attributes parser
Construct LLVM Support module about CSKY target parser and attribute parser.
It refers CSKY ABIv2 and implementation of GNU binutils and GCC.

https://github.com/c-sky/csky-doc/blob/master/C-SKY_V2_CPU_Applications_Binary_Interface_Standards_Manual.pdf

Now we only support CSKY 800 series cpus and newer cpus in the future undering CSKYv2 ABI specification.
There are 11 archs including ck801, ck802, ck803, ck803s, ck804, ck805, ck807, ck810, ck810v, ck860, ck860v.

Every arch has base extensions, the cpus of that arch family have more extended extensions than base extensions.
We need specify extended extensions for every cpu. Every extension has its enum value, name and related llvm feature string with +/-.
Every enum value represents a bit of uint64_t integer.

Differential Revision: https://reviews.llvm.org/D119917
2022-02-28 11:35:07 +08:00
Nico Weber a524a12231 [gn build] (manually) port 2e6ae1d3f2 more
b85f97bc00 missed one file.

With this, all files listed in libcxx/include/CMakeLists.txt are
listed in this BUILD.gn file again.
2022-02-26 10:46:35 -05:00
Nico Weber eab54b5a9d [gn build] (manually) port 01ace074fc more
410d4492e3 only hit half the added files.
2022-02-26 10:43:21 -05:00
Nico Weber 505e1cda57 [gn build] Define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER when building libcxx
Ports 87a82490fc in a way. Has the effect of enabling warnings
when building libcxx itself, but more importantly this is required
after 5aaefa510e to not get build errors when building libcxx itself.
2022-02-26 10:25:01 -05:00
Nikita Popov 8dcb5e6bf5 Revert "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"
See post-commit discussion on https://reviews.llvm.org/D120305.
This change breaks the clang-ppc64le-rhel buildbot, though
there is suspicion that it's an issue with the bot. The change
also had a larger than expected impact on compile-time and
code-size.

This reverts commit 3c4ed02698
and some followup changes.
2022-02-26 15:32:49 +01:00
Christopher Di Bella 5aaefa510e [libcxx][modules] protects users from relying on detail headers
libc++ has started splicing standard library headers into much more
fine-grained content for maintainability. It's very likely that outdated
and naive tooling (some of which is outside of LLVM's scope) will
suggest users include things such as <__ranges/access.h> instead of
<ranges>, and Hyrum's law suggests that users will eventually begin to
rely on this without the help of tooling. As such, this commit
intends to protect users from themselves, by making it a hard error for
anyone outside of the standard library to include libc++ detail headers.

Differential Revision: https://reviews.llvm.org/D106124
2022-02-26 09:00:25 +00:00
Aakanksha bf60a1c546 Avoid comparisons between types of different widths in a loop condition to prevent the loop from behaving unexpectedly
This change fixes the code violations flagged in AMD compute CodeQL scan -
Query Description: "Comparisons between types of different widths in a loop condition can cause the loop to behave unexpectedly."

Differential Revision: https://reviews.llvm.org/D120355
2022-02-25 17:30:12 +00:00
LLVM GN Syncbot f23e5c0322 [gn build] Port 53dcd9efd1 2022-02-25 14:48:36 +00:00
LLVM GN Syncbot b7fba5325e [gn build] Port f9e8e92cf5 2022-02-25 12:21:23 +00:00
LLVM GN Syncbot 94ed8d48e3 [gn build] Port 29b512ba32 2022-02-25 11:47:20 +00:00
Fangrui Song 3c4ed02698 [Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON
Default the option introduced in D113372 to ON to match all(?) major Linux
distros. This matches GCC and improves consistency with Android and linux-musl
which always default to PIE.
Note: CLANG_DEFAULT_PIE_ON_LINUX will be removed in the future.

Reviewed By: thesamesam

Differential Revision: https://reviews.llvm.org/D120305
2022-02-25 00:22:12 +00:00
Benjamin Kramer dc7a624e38 [tblgen] Compress CompositeSequences to 1/8th of its size. NFCI. 2022-02-24 19:31:33 +01:00
LLVM GN Syncbot dc19c70c81 [gn build] Port 7c1ee5e95f 2022-02-23 17:12:13 +00:00