Commit Graph

10418 Commits

Author SHA1 Message Date
Fangrui Song 43a43353f7 [gn build] (manually) port ee7d20e846 2021-08-04 10:28:27 -07:00
Reshabh Sharma d42e70b3d3 [AMDGPU] Handle functions in llvm's global ctors and dtors list
This patch introduces a new code object metadata field, ".kind"
which is used to add support for init and fini kernels.

HSAStreamer will use function attributes, "device-init" and
"device-fini" to distinguish between init and fini kernels from
the regular kernels and will emit metadata with ".kind" set to
"init" and "fini" respectively.

To reduce the number of init and fini kernels, the ctors and
dtors present in the llvm's global.ctors and global.dtors lists
are called from a single init and fini kernel respectively.

Reviewed by: yaxunl

Differential Revision: https://reviews.llvm.org/D105682
2021-08-04 19:53:33 +05:30
Vitaly Buka 6538aa8ce9 [NFC][tsan] Rename _inl.h to .inc
Differential Revision: https://reviews.llvm.org/D107319
2021-08-03 09:35:33 -07:00
Paulo Matos d3a0a65bf0 Reland: "[WebAssembly] Add new pass to lower int/ptr conversions of reftypes"
Add new pass LowerRefTypesIntPtrConv to generate debugtrap
instruction for an inttoptr and ptrtoint of a reference type instead
of erroring, since calling these instructions on non-integral pointers
has been since allowed (see ac81cb7e6).

Differential Revision: https://reviews.llvm.org/D107102
2021-08-03 09:20:51 +02:00
Paulo Matos 245f2ee647 Revert "[WebAssembly] Add new pass to lower int/ptr conversions of reftypes"
This reverts commit ce1c59dea6.
2021-08-02 20:12:25 +02:00
Nico Weber 3555880f10 [gn build] (manually) port 5c2b48fdb0 2021-08-02 20:10:04 +02:00
Paulo Matos ce1c59dea6 [WebAssembly] Add new pass to lower int/ptr conversions of reftypes
Add new pass LowerRefTypesIntPtrConv to generate trap
instruction for an inttoptr and ptrtoint of a reference type instead
of erroring, since calling these instructions on non-integral pointers
has been since allowed (see ac81cb7e6).

Differential Revision: https://reviews.llvm.org/D107102
2021-08-02 19:40:00 +02:00
Arthur Eubanks 8490a7d908 Add script to bisect over files in an rsp file
This is mostly intended to be used to find which file contains a miscompile.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D107184
2021-08-02 10:17:13 -07:00
Alexandros Lamprineas 3094e5389b [AArch64] Add a Machine Value Type for 8 consecutive registers
Adds MVT::i64x8, a Machine Value Type needed for lowering inline assembly
operands which materialize a sequence of eight general purpose registers.

Differential Revision: https://reviews.llvm.org/D94096
2021-07-31 09:51:28 +01:00
LLVM GN Syncbot c112483fab [gn build] Port 481ad59b9f 2021-07-30 17:57:30 +00:00
Jinsong Ji a09e93bfb8 [AIX] Include symbol alias in extract_symbols.py
nm does not show size for aliased symbols,
we should still extract them if they are external.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D107112
2021-07-30 01:37:56 +00:00
Arthur Eubanks ee7c9b8f14 [gn build] Manually add file
Since bot is broken
2021-07-29 10:37:28 -07:00
Sebastian Neubauer 4864893127 [Utils] Do not remove comments in llc test script
When checking if two prefixes can be merged for a function,
update_llc_test_checks.py removed IR comments before comparing
llc outputs of different RUN lines.
This means, if one RUN line emited lines starting with ';' and another
RUN line emited the same lines except the ones starting with ';', both
RUNs would be merged (if they share a prefix).

However, CHECK-NEXT lines check the comments, otherwise they fail, so
the script should not merge RUNs if they contain different comments.

Differential Revision: https://reviews.llvm.org/D101312
2021-07-29 13:03:05 +02:00
Diana Picus 9ff030ca50 test-release.sh: Kill python2
Don't prefer python2's virtualenv when setting up the test-suite.
Always use python3 instead, since that's what we support everywhere else
anyway.

Differential Revision: https://reviews.llvm.org/D106941
2021-07-29 10:25:48 +02:00
LLVM GN Syncbot ecd5dc6dcc [gn build] Port 61c35fb0c2 2021-07-29 02:29:22 +00:00
LLVM GN Syncbot 8ddf0b178c [gn build] Port 0f4b41e038 2021-07-28 22:59:12 +00:00
Arthur Eubanks 3143ee4ddf [gn build] Manually port dbed061b 2021-07-28 15:45:30 -07:00
Arthur Eubanks 43a44f1c54 [gn build] Add support for Win/x86 compiler-rt
This allows us to build the x86 profile runtime.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D106972
2021-07-28 14:59:18 -07:00
Jessica Clarke 0e79a94836 [Utils] Support class template specializations in update_cc_test_checks
ClassTemplateSpecializationDecl not within a ClassTemplateDecl
represents an explicit instatiation of a template and so should be
handled as if it were a normal CXXRecordDecl. Unfortunately, having an
equivalent for FunctionTemplateDecl remains a TODO in ASTDumper's
VisitFunctionTemplateDecl, with all the explicit instantiations just
being emitted inside the FunctionTemplateDecl along with all the other
specializations, meaning we can't easily support explicit function
instantiations in update_cc_test_checks.

Reviewed By: arichardson

Differential Revision: https://reviews.llvm.org/D106243
2021-07-28 16:03:41 +01:00
Tom Stellard 08c766a731 Bump the trunk major version to 14
and clear the release notes.
2021-07-27 21:58:25 -07:00
George Burgess IV ce2a5fa72b llvm/utils: guarantee revert_checker's revert ordering
At the moment, the revert ordering from this tool is unspecified (though
it happens to be in `git log` order, so newest reverts come first).

From the standpoint of tooling and users, this seems to be the opposite
of what we want by default: tools and users will generally try to apply
these reverts as cherry-picks. If two reverts in the list are close
enough to each other, if the reverts get applied out of order, we'll get
a merge conflict.

Rather than having `reverse`s for all tools (and mental reverses for
manual users), just guarantee an oldest-first output ordering for this
function.

Differential Revision: https://reviews.llvm.org/D106838
2021-07-28 00:51:05 +00:00
LLVM GN Syncbot 7809e04e3c [gn build] Port 8a48e6dda9 2021-07-27 23:10:20 +00:00
Nico Weber 3888039403 [gn build] manually port 71909de374 2021-07-27 18:23:28 -04:00
LLVM GN Syncbot df95697db3 [gn build] Port 02077da7e7 2021-07-27 18:41:55 +00:00
LLVM GN Syncbot 66640aa5ae [gn build] Port 2487db1f28 2021-07-27 06:54:07 +00:00
Nico Weber e30293352c [gn build] Kind of port c7b3a91017 (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 6aa9e746eb 2021-07-24 12:03:50 +00:00
LLVM GN Syncbot 698fef3eb6 [gn build] Port 96709823ec 2021-07-24 03:08:02 +00:00
LLVM GN Syncbot d556d71670 [gn build] Port e5d8b93e5a 2021-07-23 16:13:25 +00:00
LLVM GN Syncbot f890d6b892 [gn build] Port 0ad562b48b 2021-07-23 16:13:24 +00:00
LLVM GN Syncbot e7077971f2 [gn build] Port 0118a64934 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 f8c6515554 (libLLVMDWP) 2021-07-22 19:38:50 -04:00
LLVM GN Syncbot 4e0cefc640 [gn build] Port 3959c95deb 2021-07-22 18:41:45 +00:00
Nico Weber fd3823cc82 [gn build] (manually) port 78bda89412 from 2012 because 924d62ca4a added it to check-llvm 2021-07-22 09:11:54 -04:00
LLVM GN Syncbot e2000f2761 [gn build] Port 74fd3cb8cd 2021-07-21 21:45:33 +00:00
LLVM GN Syncbot d81a3cbe8b [gn build] Port 403e67d34d 2021-07-21 00:19:59 +00:00
LLVM GN Syncbot c781eb153b [gn build] Port 808bbc2c47 2021-07-20 21:53:24 +00:00
LLVM GN Syncbot d1438c1bd2 [gn build] Port 05a6d74c48 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 1a29403d2f 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 2b08f6af62 2021-07-20 12:00:01 +00:00
Nico Weber 9ced84de09 [gn build] (manually) port bc1a2979fc 2021-07-20 06:43:30 -04:00
LLVM GN Syncbot 53942cd4dc [gn build] Port adb55d7c32 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 08b289867b 2021-07-19 21:33:24 +00:00
LLVM GN Syncbot 42e6cfc81d [gn build] Port 54902e00d1 2021-07-19 19:24:16 +00:00
LLVM GN Syncbot 68dec42e6b [gn build] Port 8b4acb067f 2021-07-19 18:24:11 +00:00
LLVM GN Syncbot e78560f6e8 [gn build] Port 61fa9afe4c 2021-07-19 18:24:10 +00:00
LLVM GN Syncbot d0ed40204d [gn build] Port 6103fdfab4 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 0bf4b81d57 2021-07-16 20:32:47 +00:00
Nico Weber 304293d85d [gn build] (semi-manually) port 6a4054ef06 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 766a08df12 2021-07-16 02:23:45 +00:00
Nico Weber 18d8779747 [gn build] port 766a08df12 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 b0d38ad0bc 2021-07-15 07:50:35 +00:00
LLVM GN Syncbot 8b426bdaf1 [gn build] Port b9c3941cd6 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 c08dabb0f4 2021-07-14 10:49:08 +00:00
Nico Weber aff0954577 [gn build] (manually) merge 462d4de35b 2021-07-14 06:43:23 -04:00
Nico Weber 3ea8860afb [gn build] (manually) port 303ddb60a2 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
Nico Weber eecd5d0aa8 [gn build] port 0da172b176 more 2021-07-12 08:50:18 -04:00
Nico Weber 0c6fad233a [gn build] (semi-manually) port 0da172b176 2021-07-12 08:15:59 -04:00
Nico Weber c82b96c0a4 [gn build] fix formatting after 9647a6f719 2021-07-09 19:04:46 -04:00
Wouter van Oortmerssen 9647a6f719 [WebAssembly] Added initial type checker to MC Assembler
This to protect against non-sensical instruction sequences being assembled,
which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate.

Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input.

Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly.

A `-no-type-check` flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct.

This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future.

Differential Revision: https://reviews.llvm.org/D104945
2021-07-09 14:07:25 -07:00
David Blaikie 0562d17864 PR51018: A few more explicit conversions from SmallString to StringRef
Follow-up to 1def2579e1 with a few more
obscure cases.
2021-07-09 13:54:02 -07:00
Fangrui Song 47db32e542 [llvm-size] Switch command line parsing from llvm::cl to OptTable
Part of https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html
"Binary utilities: switch command line parsing from llvm::cl to OptTable"

* `--totals=false` and `--totals=0` cannot be used. Omit the option.
* `--help-list` is removed. This is a `cl::` specific option.

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

Note: because the tool is simple, and its long options are uncommon, I just drop
the one-dash forms except `-arch <value>` (Darwin style).

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105598
2021-07-09 10:26:53 -07:00
LLVM GN Syncbot 214f63b272 [gn build] Port 0e09a41b41 2021-07-09 17:14:37 +00:00
Fangrui Song 48de8bb0d3 [llvm-cxxfilt] Switch command line parsing from llvm::cl to OptTable
Similar to D104889. The tool is very simple and its long options are uncommon,
so just drop the one-dash form in this patch.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105605
2021-07-09 10:10:45 -07:00
Nico Weber 97c675d3d4 Revert "Revert "Temporarily do not drop volatile stores before unreachable""
This reverts commit 52aeacfbf5.
There isn't full agreement on a path forward yet, but there is agreement that
this shouldn't land as-is.  See discussion on https://reviews.llvm.org/D105338

Also reverts unreviewed "[clang] Improve `-Wnull-dereference` diag to be more in-line with reality"
This reverts commit f4877c78c0.

And all the related changes to tests:
This reverts commit 9a0152799f.
This reverts commit 3f7c9cc274.
This reverts commit 329f8197ef.
This reverts commit aa9f58cc2c.
This reverts commit 2df37d5ddd.
This reverts commit a72a441812.
2021-07-09 11:44:34 -04:00
Roman Lebedev aa9f58cc2c
Speculatively adjust gtest's UnitTest::AddTestPartResult() to not rely on volatile store to null trapping
This fallback path is used at least on PPC.
If this doesn't work on some compilers that take this path,
then this will have to be changed to either abort,
or partitioned to do different things based on the compiler.

Please refer to https://reviews.llvm.org/D105338.
2021-07-09 13:32:18 +03:00
LLVM GN Syncbot 87e41cc4b6 [gn build] Port 321c2ea91c 2021-07-08 15:35:54 +00:00
Nico Weber e37dbc6e57 [gn build] (manually) port ef16c8eaa5 (MCACustomBehaviorAMDGPU) 2021-07-07 21:59:07 -04:00
Nico Weber 877e835add [gn build] (semi-manually) port 966386514b 2021-07-07 19:27:19 -04:00
George Burgess IV 81ee4952f1 utils: add a revert checker
Chrome OS and Android have found it useful to have an automated revert
checker. It was requested to upstream it, since other folks in the LLVM
community may also find value in it.

The tests depend on having a full (non-shallow) checkout of LLVM. This
seems reasonable to me, since:

- the tests should only be run if the user is developing on this script
- it's kind of hard to develop on this script without local git history
  :)

If people really want, the tests' dependency on LLVM's history can be
removed. It's mostly just effort/complexity that doesn't seem necessary.

Differential Revision: https://reviews.llvm.org/D105578
2021-07-07 14:20:01 -07:00
Fangrui Song cae3b831f4 [llvm-nm] Switch command line parsing from llvm::cl to OptTable
Part of https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html
"Binary utilities: switch command line parsing from llvm::cl to OptTable"

Users should generally observe no difference as long as they only use intended
option forms. Behavior changes:

* `-t=d` is removed. Use `-t d` instead.
* `--demangle=0` cannot be used. Omit the option or use `--no-demangle` instead.
* `--help-list` is removed. This is a `cl::` specific option.

Note:

* `-t` diagnostic gets improved.
* This patch avoids cl::opt collision if we decide to support multiplexing for binary utilities
* One-dash long options are still supported.
* The `-s` collision (`-s segment section` for Mach-O) is unfortunate. `-s` means `--print-armap` in GNU nm.
* This patch removes the last `cl::multi_val` use case from the `llvm/lib/Support/CommandLine.cpp` library

`-M` (`--print-armap`), `-U` (`--defined-only`), and `-W` (`--no-weak`)
are now deprecated. They could conflict with future GNU nm options.
(--print-armap has an existing alias -s, so GNU will unlikely add a new one.
--no-weak (not in GNU nm) is rarely used anyway.)

`--just-symbol-name` is now deprecated in favor of
`--format=just-symbols` and `-j`.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105330
2021-07-07 13:34:33 -07:00
LLVM GN Syncbot 645e599e93 [gn build] Port 6829db727e 2021-07-07 10:14:59 +00:00
LLVM GN Syncbot 7a46d8f50c [gn build] Port 8517a26d44 2021-07-06 18:17:43 +00:00
Nico Weber 325a5619e4 [gn build] (manually) port 98f078324f (llvm-strings Opts.td) 2021-07-05 14:43:05 -04:00
LLVM GN Syncbot 94ff00f988 [gn build] Port 99f00635d7 2021-07-02 17:03:49 +00:00
LLVM GN Syncbot 25473d7b08 [gn build] Port bf64210fd8 2021-07-02 16:12:54 +00:00
Sam McCall 33ff8078ff Revert "[clangd] Unbreak mac build differently 0c96a92d8666b8"
This reverts commit 2f79acb7b7.

Should no longer be needed after 26e1553a10
2021-07-02 16:29:48 +02:00
LLVM GN Syncbot 5df556ac8b [gn build] Port a92964779c 2021-07-02 13:05:44 +00:00
LLVM GN Syncbot 430bfc4f3b [gn build] Port 33a7b4d9d8 2021-07-01 22:26:09 +00:00
Joel E. Denny 355bf7c1f0 [lit] Extend --xfail/LIT_XFAIL to take full test name
The new documentation entry gives an example use case from
libomptarget.

Reviewed By: yln, jhenderson, davezarzycki

Differential Revision: https://reviews.llvm.org/D105208
2021-07-01 15:46:37 -04:00
Nico Weber 19443c13b5 [gn build] Port 050b064f15 2021-07-01 14:52:21 -04:00
Nico Weber 2f79acb7b7 [clangd] Unbreak mac build differently 0c96a92d86
This reverts b56e5f8a10 (and follow-up f6db88535c) and instead
restores the state we had before 0c96a92d8666b8: ClangdMain.cpp
includes Features.inc before including Transport.h.

This is a bit ugly, but it matches the former state and making Transport.h
include Features.h means that xpc/ needs to be able to find the generated
Features.inc, wich is also a bit ugly.
2021-07-01 10:51:27 -04:00
LLVM GN Syncbot 820ced1362 [gn build] Port 39f64c4c83 2021-07-01 08:31:00 +00:00
LLVM GN Syncbot 9184090c96 [gn build] Port 28b01c59c9 2021-07-01 04:00:13 +00:00
LLVM GN Syncbot f16029e3f7 [gn build] Port 662c55442f 2021-07-01 03:45:41 +00:00
LLVM GN Syncbot ec74192f52 [gn build] Port 381ded345b 2021-06-30 18:49:16 +00:00
Nico Weber 51c3e3f80c [gn build] (manually) port f617ab1044 (DoublerPlugin) 2021-06-30 14:49:06 -04:00
Nico Weber f6db88535c [gn build] add dep needed after b56e5f8a10 2021-06-30 12:58:59 -04:00
LLVM GN Syncbot 0596f7d828 [gn build] Port 0c96a92d86 2021-06-30 15:57:43 +00:00
Louis Dionne fec521a7b2 [lit] Add the ability to parse regexes in Lit boolean expressions
This patch augments Lit with the ability to parse regular expressions
in boolean expressions. This includes REQUIRES:, XFAIL:, UNSUPPORTED:,
and all other special Lit markup that evaluates to a boolean expression.

Regular expressions can be specified by enclosing them in {{...}},
similarly to how FileCheck handles such regular expressions. The regular
expression can either be on its own, or it can be part of an identifier.
For example, a match expression like {{.+}}-apple-darwin{{.+}} would match
the following variables:

     x86_64-apple-darwin20.0
     arm64-apple-darwin20.0
     arm64-apple-darwin22.0
     etc...

In the long term, this could be used to remove the need to handle the
target triple specially when parsing boolean expressions.

Differential Revision: https://reviews.llvm.org/D104572
2021-06-30 10:52:16 -04:00
Jay Foad 2da58826a5 [TableGen] Allow identical MnemonicAliases with no predicate
My use case for this is illustrated in the test case: I want to define
the same instruction twice with different (disjoint) predicates, because
the instruction has different operands on different subtargets. It's
convenient to do this with a multiclass that also defines an alias for
the instruction.

Previously tablegen would complain if this alias was defined twice with
no predicate. One way to fix this would be to add a predicate on each
definition of the alias, matching the predicate on the instruction. But
this (a) is slightly awkward to do in the real world use case I had, and
(b) leads to an inefficient matcher that will do something like this:

  if (Mnemonic == "foo_alias") {
    if (Features.test(Feature_Subtarget1Bit))
      Mnemonic == "foo";
    else if (Features.test(Feature_Subtarget2Bit))
      Mnemonic == "foo";
    return;
  }

It would be more efficient to skip the feature tests and return "foo"
unconditionally.

Overall it seems better to allow multiple definitions of the identical
alias with no predicate.

Differential Revision: https://reviews.llvm.org/D105033
2021-06-30 10:53:39 +01:00
LLVM GN Syncbot 2a063173c1 [gn build] Port d03aa7d6b6 2021-06-29 15:41:00 +00:00
LLVM GN Syncbot c76fe67a7b [gn build] Port 9b02a9b401 2021-06-29 09:44:27 +00:00
LLVM GN Syncbot fc6a5d85ea [gn build] Port 159024ce23 2021-06-29 09:44:26 +00:00
LLVM GN Syncbot 918bb2a978 [gn build] Port f32f3db9fc 2021-06-28 16:30:29 +00:00
Sander de Smalen 0e09d18c6a Reland [GlobalISel] NFC: Have LLT::getSizeInBits/Bytes return a TypeSize.
This patch relands https://reviews.llvm.org/D104454, but fixes some failing
builds on Mac OS which apparently has a different definition for size_t,
that caused 'ambiguous operator overload' for the implicit conversion
of TypeSize to a scalar value.

This reverts commit b732e6c9a8.
2021-06-28 15:24:27 +01:00
LLVM GN Syncbot 9061da2748 [gn build] Port 499e39c598 2021-06-28 08:50:56 +00:00
LLVM GN Syncbot b62de20190 [gn build] Port 8b7881a084 2021-06-26 14:20:52 +00:00
LLVM GN Syncbot 2b9016745d [gn build] Port aff57ff24a 2021-06-26 11:38:00 +00:00
Joel E. Denny 9eaf0d120d [UpdateCCTestChecks] Support --check-globals
This option is already supported by update_test_checks.py, but it can
also be useful in update_cc_test_checks.py.  For example, I'd like to
use it in OpenMP offload codegen tests to check global variables like
`.offload_maptypes*`.

Reviewed By: jdoerfert, arichardson, ggeorgakoudis

Differential Revision: https://reviews.llvm.org/D104714
2021-06-25 13:17:56 -04:00
Sander de Smalen b732e6c9a8 Revert "[GlobalISel] NFC: Have LLT::getSizeInBits/Bytes return a TypeSize."
This patch seems to be causing build errors, reverting it for now.

This reverts commit aeab9d9570.
2021-06-25 17:37:16 +01:00
Sander de Smalen aeab9d9570 [GlobalISel] NFC: Have LLT::getSizeInBits/Bytes return a TypeSize.
To reflect that the size may be scalable, a TypeSize is returned
instead of an unsigned. In places where the result is used,
it currently relies on an implicit cast of TypeSize -> uint64_t,
which asserts that the type is not scalable.

This patch is NFC for fixed-width vectors.

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D104454
2021-06-25 17:06:50 +01:00
LLVM GN Syncbot 67a8931440 [gn build] Port 69d5a66621 2021-06-25 00:29:34 +00:00
Martin Storsjö 42f74e8249 [llvm] Rename StringRef _lower() method calls to _insensitive()
This is a mechanical change. This actually also renames the
similarly named methods in the SmallString class, however these
methods don't seem to be used outside of the llvm subproject, so
this doesn't break building of the rest of the monorepo.
2021-06-25 00:22:01 +03:00
LLVM GN Syncbot 6ca730e7cb [gn build] Port 6adbc83ee9 2021-06-24 18:02:44 +00:00
Nico Weber b1061e36d9 [gn build] Fix a comment typo and a comment copy-pasto 2021-06-24 11:06:48 -04:00
Nico Weber d57a5879ab [gn build] Remove an unneeded -I flag
Everything includes clang/Config/config.h by qualified "clang/Config/config.h"
path, so there's no need for `-Igen/clang/include/clang/Config/clang/include`.

No behavior change.
2021-06-24 10:18:49 -04:00
Sander de Smalen d5e14ba88c [GlobalISel] NFC: Change LLT::vector to take ElementCount.
This also adds new interfaces for the fixed- and scalable case:
* LLT::fixed_vector
* LLT::scalable_vector

The strategy for migrating to the new interfaces was as follows:
* If the new LLT is a (modified) clone of another LLT, taking the
  same number of elements, then use LLT::vector(OtherTy.getElementCount())
  or if the number of elements is halfed/doubled, it uses .divideCoefficientBy(2)
  or operator*. That is because there is no reason to specifically restrict
  the types to 'fixed_vector'.
* If the algorithm works on the number of elements (as unsigned), then
  just use fixed_vector. This will need to be fixed up in the future when
  modifying the algorithm to also work for scalable vectors, and will need
  then need additional tests to confirm the behaviour works the same for
  scalable vectors.
* If the test used the '/*Scalable=*/true` flag of LLT::vector, then
  this is replaced by LLT::scalable_vector.

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D104451
2021-06-24 11:26:12 +01:00
Carl Ritson 6b0f98d442 [ValueTypes] Define MVTs for v3i64/v3f64 to complement v6i32/v6f32
Having type symmetry with these is somewhat necessary when implementing support for 192-bit values.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D104621
2021-06-24 12:41:22 +09:00
Peter Collingbourne 272af9c700 gn build: Build ubsan_minimal on Android. 2021-06-23 19:25:21 -07:00
Andrew Litteken 9e73f7c8d2 [IRSim] Adding basic implementation of llvm-sim.
This is a similarity visualization tool that accepts a Module and
passes it to the IRSimilarityIdentifier.  The resulting SimilarityGroups
are output in a JSON file.

Tests are found in test/tools/llvm-sim and check for the file not found,
a bad module, and that the JSON is created correctly.

Reviewers: paquette, jroelofs, MaskRay

Recommit of: 15645d044b to fix linking
errors and GN build system.

Differential Revision: https://reviews.llvm.org/D86974
2021-06-23 14:38:58 -05:00
LLVM GN Syncbot 45d5373511 [gn build] Port 560170fa2d 2021-06-23 17:11:10 +00:00
Joel E. Denny 38b7b1d4a2 [UpdateCCTestChecks][NFC] Permit other comments in common.py
Some parts of common.py already permit comment styles besides `;`.
Handle the remaining cases.  Specifically, a future patch will extend
update_cc_test_checks.py to call add_global_checks.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D104713
2021-06-23 11:12:42 -04:00
Roman Lebedev eb7ce97870
[NFC][ARM] Fix update_llc_test_checks for thumbv7-apple-darwin, autogenerate thumb2-ifcvt1.ll 2021-06-23 16:31:19 +03:00
Roman Lebedev 3c94869632
[NFC][ARM] Fix update_llc_test_checks for aarch64-apple-ios/thumbv7s-apple-darwin, autogenerate a few tests 2021-06-23 16:31:19 +03:00
Roman Lebedev 15be15073e
[NFC][ARM] Fix update_llc_test_checks for thumbv7-apple-ios, autogenerate switch-minsize.ll 2021-06-23 16:31:19 +03:00
Roman Lebedev 4de0c40031
[NFC][ARM] Fix update_llc_test_checks for armv7-apple-ios, autogenerate ifcvt5.ll/ifcvt6.ll 2021-06-23 16:31:19 +03:00
Igor Kudrin 36111f28ed [TableGen] Fix printing second PC-relative operand
If an instruction has several operands and a PC-relative one is not the
first of them, the generator may produce the code that does not pass the
'Address' parameter to the printout method. For example, for an Arm
instruction 'LE LR, $imm', it reuses the same code as for other
instructions where the second operand is not PC-relative:

void ARMInstPrinter::printInstruction(...) {
...
  case 11:
    // BF16VDOTI_VDOTD, BF16VDOTI_VDOTQ, BF16VDOTS_VDOTD, ...
    printOperand(MI, 1, STI, O);
    O << ", ";
    printOperand(MI, 2, STI, O);
    break;
...

The patch fixes that by considering 'PCRel' when comparing
'AsmWriterOperand' values.

Differential Revision: https://reviews.llvm.org/D104698
2021-06-23 13:27:37 +07:00
Nico Weber e8c8ce0974 [gn build] don't build ubsan_minimal on mac
It doesn't build there, see http://45.33.8.238/macm1/12180/step_4.txt
2021-06-22 22:21:20 -04:00
Peter Collingbourne 0439ba9903 gn build: Only build the TSan runtime on 64-bit platforms.
TSan only supports 64-bit platforms.

Differential Revision: https://reviews.llvm.org/D104755
2021-06-22 17:51:00 -07:00
Peter Collingbourne 6e962fcc3d gn build: Add support for building ubsan_minimal.
Differential Revision: https://reviews.llvm.org/D104754
2021-06-22 17:51:00 -07:00
Peter Collingbourne 449b179902 gn build: Rebase clang-tblgen include path against root_build_dir instead of root_out_dir.
Fixes clang cross-compilation.

Also remove some redundant include path arguments.
2021-06-22 14:32:24 -07:00
Nico Weber 356d6b7b8a [gn build] manually port c747b7d1d9 more (config.osx_sysroot) 2021-06-22 15:33:52 -04:00
LLVM GN Syncbot 805e1a5896 [gn build] Port 40d6d2c49d 2021-06-22 17:03:46 +00:00
Nico Weber 47553356ef [gn build] manually port c747b7d1d9 (config.osx_sysroot) 2021-06-22 12:50:58 -04:00
Fraser Cormack c97cf73867 [Utils][vim] Add missing highlights for fast-math flags
This patch adds the `afn`, `contract`, and `reassoc` fast-math flags.

It also fixes up `fneg`'s order in the alphabetized list.

Reviewed By: MaskRay, craig.topper

Differential Revision: https://reviews.llvm.org/D104541
2021-06-22 09:39:15 +01:00
Sander de Smalen bd7f7e2eba [GlobalISel] Add scalable property to LLT types.
This patch aims to add the scalable property to LLT. The rest of the
patch-series changes the interfaces to take/return ElementCount and
TypeSize, which both have the ability to represent the scalable property.

The changes are mostly mechanical and aim to be non-functional changes
for fixed-width vectors.

For scalable vectors some unit tests have been added, but no effort has
been put into making any of the GlobalISel algorithms work with scalable
vectors yet. That will be left as future work.

The work is split into a series of 5 patches to make reviews easier.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D104450
2021-06-22 08:43:34 +01:00
Joel E. Denny 2bfe0536e5 [UpdateCCTestChecks] Fix --replace-value-regex across RUN lines
Without this patch, llvm/utils/update_cc_test_checks.py fails to
perform `--replace-value-regex` replacements when two RUN lines
produce the same output and use the same single FileCheck prefix.  The
problem is that replacements in a RUN line's output are not performed
until after comparing against previous RUN lines' output, where
replacements have already been performed.  This patch fixes that.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D104566
2021-06-21 17:01:17 -04:00
LLVM GN Syncbot 808ac8d595 [gn build] Port 208332de8a 2021-06-21 07:27:34 +00:00
LLVM GN Syncbot b746a8db84 [gn build] Port 80fd5fa526 2021-06-21 06:23:08 +00:00
Roman Lebedev b1f55c33d4
[UpdateTestUtils] Print test filename when complaining about conflicting prefix
Now that FileCheck eagerly complains when prefixes are unused,
the update script does the same, and  is becoming very common
to need to drop some prefixes, yet figuring out the file
it complains about isn't obvious unless it actually tells us.
2021-06-20 14:12:39 +03:00