10293 Commits

Author SHA1 Message Date
Nico Weber
e30293352c [gn build] Kind of port c7b3a91017d2 (libclang version script)
libclang is only built as static library in the GN build at the
moment, which means we now generate a .exports file form a version
script and then link.exe and ld64 inputs from the .exports file
but don't use the version script, but hey.
2021-07-26 22:12:06 -04:00
LLVM GN Syncbot
fcb3bb581b [gn build] Port 6aa9e746ebde 2021-07-24 12:03:50 +00:00
LLVM GN Syncbot
698fef3eb6 [gn build] Port 96709823ec37 2021-07-24 03:08:02 +00:00
LLVM GN Syncbot
d556d71670 [gn build] Port e5d8b93e5a25 2021-07-23 16:13:25 +00:00
LLVM GN Syncbot
f890d6b892 [gn build] Port 0ad562b48bfd 2021-07-23 16:13:24 +00:00
LLVM GN Syncbot
e7077971f2 [gn build] Port 0118a649348b 2021-07-23 07:19:25 +00:00
Nico Weber
4a76bd0e31 [gn build] Allow use_asan=true on macOS
Seems to work.

(I only tried macOS, not iOS, but need to allow both because
the iOS toolchain used to build compiler-rt asserts otherwise.)
2021-07-22 21:38:02 -04:00
Nico Weber
377320fe80 [gn build] Reformat all gn files
Ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.
2021-07-22 21:35:35 -04:00
Nico Weber
681107e9f0 [gn build] (manually) port f8c6515554cc (libLLVMDWP) 2021-07-22 19:38:50 -04:00
LLVM GN Syncbot
4e0cefc640 [gn build] Port 3959c95deb11 2021-07-22 18:41:45 +00:00
Nico Weber
fd3823cc82 [gn build] (manually) port 78bda894129 from 2012 because 924d62ca4a85 added it to check-llvm 2021-07-22 09:11:54 -04:00
LLVM GN Syncbot
e2000f2761 [gn build] Port 74fd3cb8cd3e 2021-07-21 21:45:33 +00:00
LLVM GN Syncbot
d81a3cbe8b [gn build] Port 403e67d34d03 2021-07-21 00:19:59 +00:00
LLVM GN Syncbot
c781eb153b [gn build] Port 808bbc2c4702 2021-07-20 21:53:24 +00:00
LLVM GN Syncbot
d1438c1bd2 [gn build] Port 05a6d74c4845 2021-07-20 20:51:01 +00:00
Zequan Wu
8773822c57 [Utils] Add -compilation-dir flag to prepare-code-coverage-artifact.py
Differential Revision: https://reviews.llvm.org/D106314
2021-07-20 10:55:49 -07:00
Joel E. Denny
5b0a948a81 [UpdateCCTestChecks] Implement --global-hex-value-regex
For example, in OpenMP offload codegen tests, global variables like
`.offload_maptypes*` are much easier to read in hex.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D104743
2021-07-20 11:23:20 -04:00
Joel E. Denny
2f5b2ea6cd [UpdateCCTestChecks] Implement --global-value-regex
`--check-globals` activates checks for all global values, and
`--global-value-regex` filters them.  For example, I'd like to use it
in OpenMP offload codegen tests to check only global variables like
`.offload_maptypes*`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D104742
2021-07-20 11:23:20 -04:00
LLVM GN Syncbot
7cefcd9230 [gn build] Port 1a29403d2f8a 2021-07-20 15:13:51 +00:00
Nico Weber
ce5abfafb5 [gn build] remove stray character in a comment 2021-07-20 10:13:48 -04:00
LLVM GN Syncbot
978c5d8d2a [gn build] Port 2b08f6af62af 2021-07-20 12:00:01 +00:00
Nico Weber
9ced84de09 [gn build] (manually) port bc1a2979fc70 2021-07-20 06:43:30 -04:00
LLVM GN Syncbot
53942cd4dc [gn build] Port adb55d7c3265 2021-07-20 05:51:14 +00:00
Nico Weber
18a8aaee0e [gn build] Fix llvm_build_instrumented_coverage=true builds with goma/rbe 2021-07-19 19:57:02 -04:00
LLVM GN Syncbot
49289bd943 [gn build] Port 08b289867b5a 2021-07-19 21:33:24 +00:00
LLVM GN Syncbot
42e6cfc81d [gn build] Port 54902e00d128 2021-07-19 19:24:16 +00:00
LLVM GN Syncbot
68dec42e6b [gn build] Port 8b4acb067fd3 2021-07-19 18:24:11 +00:00
LLVM GN Syncbot
e78560f6e8 [gn build] Port 61fa9afe4c5b 2021-07-19 18:24:10 +00:00
LLVM GN Syncbot
d0ed40204d [gn build] Port 6103fdfab4e2 2021-07-19 18:24:09 +00:00
Haowei Wu
6103fdfab4 [ifs][elfabi] Merge llvm-ifs/elfabi tools
This change merges llvm-elfabi and llvm-ifs tools.

Differential Revision: https://reviews.llvm.org/D100139
2021-07-19 11:23:19 -07:00
Whisperity
73e4b5cfa8 [clang-tidy] Add 'readability-suspicious-call-argument' check
Finds function calls where the call arguments might be provided in an
incorrect order, based on the comparison (via string metrics) of the
parameter names and the argument names against each other.

A diagnostic is emitted if an argument name is similar to a *different*
parameter than the one currently passed to, and it is sufficiently
dissimilar to the one it **is** passed to currently.

False-positive warnings from this check are useful to indicate bad
naming convention issues, even if a swap isn't necessary.
This check does not generate FixIts.

Originally implemented by @varjujan as his Master's Thesis work.
The check was subsequently taken over by @barancsuk who added type
conformity checks to silence false positive matches.
The work by @whisperity involved driving the check's review and fixing
some more bugs in the process.

Reviewed By: aaron.ballman, alexfh

Differential Revision: http://reviews.llvm.org/D20689

Co-authored-by: János Varjú <varjujanos2@gmail.com>
Co-authored-by: Lilla Barancsuk <barancsuklilla@gmail.com>
2021-07-19 10:18:09 +02:00
Joel E. Denny
b8355b7126 [lit] Add --xfail-not/LIT_XFAIL_NOT
For example, I need this lately in my CI config:

LIT_XFAIL_NOT='libomptarget :: nvptx64-nvidia-cuda :: unified_shared_memory/api.c'

That test specifies an XFAIL directive, but I get an XPASS result.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D106022
2021-07-16 19:13:34 -04:00
LLVM GN Syncbot
1daaf1df56 [gn build] Port 0bf4b81d57b0 2021-07-16 20:32:47 +00:00
Nico Weber
304293d85d [gn build] (semi-manually) port 6a4054ef060b 2021-07-16 15:54:13 -04:00
Carl Ritson
f5917e0312 [TableGen] Allow isAllocatable inheritence from any superclass
When setting Allocatable on a generated register class check all
superclasses and set Allocatable true if any superclass is
allocatable.

Without this change generated register classes based on an
allocatable class may end up unallocatable due to the topological
inheritance order.

This change primarily effects AMDGPU backend; however, there are
a few changes in MIPs GlobalISel register constraints as a result.

Reviewed By: kparzysz

Differential Revision: https://reviews.llvm.org/D105967
2021-07-16 13:02:24 +09:00
LLVM GN Syncbot
b1ffa8fc61 [gn build] Port 766a08df12c1 2021-07-16 02:23:45 +00:00
Nico Weber
18d8779747 [gn build] port 766a08df12c1 2021-07-15 22:23:14 -04:00
Harald van Dijk
a8ad917054
[X86] Fix handling of maskmovdqu in X32
The maskmovdqu instruction is an odd one: it has a 32-bit and a 64-bit
variant, the former using EDI, the latter RDI, but the use of the
register is implicit. In 64-bit mode, a 0x67 prefix can be used to get
the version using EDI, but there is no way to express this in
assembly in a single instruction, the only way is with an explicit
addr32.

This change adds support for the instruction. When generating assembly
text, that explicit addr32 will be added. When not generating assembly
text, it will be kept as a single instruction and will be emitted with
that 0x67 prefix. When parsing assembly text, it will be re-parsed as
ADDR32 followed by MASKMOVDQU64, which still results in the correct
bytes when converted to machine code.

The same applies to vmaskmovdqu as well.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D103427
2021-07-15 22:56:08 +01:00
George Burgess IV
3a7ca4cad4 utils: fix broken assertion in revert_checker
`intermediate_commits` is a list of full SHAs, and `across_ref` may/may
not be a full SHA (or a SHA at all). We already have `across_sha`, which
is the resolved form of `across_ref`, so use that instead.

Thanks to probinson for catching this in post-commit review of
https://reviews.llvm.org/D105578!
2021-07-15 13:07:46 -07:00
Andrzej Warzynski
47f846f8c5 Enable Flang by default in the test-release.sh script
I've also brought this up on llvm-dev:
  https://lists.llvm.org/pipermail/llvm-dev/2021-July/151744.html

Differential Revision: https://reviews.llvm.org/D105885
2021-07-15 17:17:49 +01:00
Ilya Leoshkevich
402fc790eb [TSan] Add SystemZ longjmp support
Implement the interceptor and stack pointer demangling.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D105629
2021-07-15 12:18:48 +02:00
LLVM GN Syncbot
9805afdfea [gn build] Port b0d38ad0bc25 2021-07-15 07:50:35 +00:00
LLVM GN Syncbot
8b426bdaf1 [gn build] Port b9c3941cd61d 2021-07-15 01:12:36 +00:00
Djordje Todorovic
df686842bc [RemoveRedundantDebugValues] Add a Pass that removes redundant DBG_VALUEs
This new MIR pass removes redundant DBG_VALUEs.

After the register allocator is done, more precisely, after
the Virtual Register Rewriter, we end up having duplicated
DBG_VALUEs, since some virtual registers are being rewritten
into the same physical register as some of existing DBG_VALUEs.
Each DBG_VALUE should indicate (at least before the LiveDebugValues)
variables assignment, but it is being clobbered for function
parameters during the SelectionDAG since it generates new DBG_VALUEs
after COPY instructions, even though the parameter has no assignment.
For example, if we had a DBG_VALUE $regX as an entry debug value
representing the parameter, and a COPY and after the COPY,
DBG_VALUE $virt_reg, and after the virtregrewrite the $virt_reg gets
rewritten into $regX, we'd end up having redundant DBG_VALUE.

This breaks the definition of the DBG_VALUE since some analysis passes
might be built on top of that premise..., and this patch tries to fix
the MIR with the respect to that.

This first patch performs bacward scan, by trying to detect a sequence of
consecutive DBG_VALUEs, and to remove all DBG_VALUEs describing one
variable but the last one:

For example:

(1) DBG_VALUE $edi, !"var1", ...
(2) DBG_VALUE $esi, !"var2", ...
(3) DBG_VALUE $edi, !"var1", ...
 ...

in this case, we can remove (1).

By combining the forward scan that will be introduced in the next patch
(from this stack), by inspecting the statistics, the RemoveRedundantDebugValues
removes 15032 instructions by using gdb-7.11 as a testbed.

Differential Revision: https://reviews.llvm.org/D105279
2021-07-14 04:29:42 -07:00
LLVM GN Syncbot
90e7f5d259 [gn build] Port c08dabb0f476 2021-07-14 10:49:08 +00:00
Nico Weber
aff0954577 [gn build] (manually) merge 462d4de35b0c 2021-07-14 06:43:23 -04:00
Nico Weber
3ea8860afb [gn build] (manually) port 303ddb60a2d2 2021-07-13 15:15:38 -04:00
Nikita Popov
7ed3e87825 [Attributes] Determine attribute properties from TableGen data
Continuing from D105763, this allows placing certain properties
about attributes in the TableGen definition. In particular, we
store whether an attribute applies to fn/param/ret (or a combination
thereof). This information is used by the Verifier, as well as the
ForceFunctionAttrs pass. I also plan to use this in LLParser,
which also duplicates info on which attributes are valid where.

This keeps metadata about attributes in one place, and makes it
more likely that it stays in sync, rather than in various
functions spread across the codebase.

Differential Revision: https://reviews.llvm.org/D105780
2021-07-12 22:13:38 +02:00
Nikita Popov
5d1464cbfe [Attributes] Make type attribute handling more generic (NFCI)
Followup to D105658 to make AttrBuilder automatically work with
new type attributes. TableGen is tweaked to emit First/LastTypeAttr
markers, based on which we can handle type attributes
programmatically.

Differential Revision: https://reviews.llvm.org/D105763
2021-07-12 20:49:38 +02:00
Fangrui Song
46580d43fc [llvm-readobj] Switch command line parsing from llvm::cl to OptTable
Users should generally observe no difference as long as they don't use
unintended option forms. Behavior changes:

* `-t=d` is removed. Use `-t d` instead.
* `--demangle=false` and `--demangle=0` cannot be used. Omit the option or use `--no-demangle`. Other flag-style options don't have `--no-` forms.
* `--help-list` is removed. This is a `cl::` specific option.
* llvm-readobj now supports grouped short options as well.
* `--color` is removed. This is generally not useful (only apply to errors/warnings) but was inherited from Support.

Some adjustment to the canonical forms
(usually from GNU readelf; currently llvm-readobj has too many redundant aliases):

* --dyn-syms is canonical. --dyn-symbols is a hidden alias
* --file-header is canonical. --file-headers is a hidden alias
* --histogram is canonical. --elf-hash-histogram is a hidden alias
* --relocs is canonical. --relocations is a hidden alias
* --section-groups is canonical. --elf-section-groups is a hidden alias

OptTable avoids global option collision if we decide to support multiplexing for binary utilities.

* Most one-dash long options are still supported. `-dt, -sd, -st, -sr` are dropped due to their conflict with grouped short options.
* `--section-mapping=false` (D57365) is strange but is kept for now.
* Many `cl::opt` variables were unnecessarily external. I added `static` whenever appropriate.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105532
2021-07-12 10:14:42 -07:00