Commit Graph

10418 Commits

Author SHA1 Message Date
LLVM GN Syncbot e9f82e9e1b [gn build] Port 5671ff20d9 2021-06-01 19:37:29 +00:00
Martin Storsjö 41d7909368 [libcxx] [test] Fix the _supportsVerify check on Windows by fixing quoting
The pipes.quote function quotes using single quotes, the same goes
for the newer shlex.quote (which is the preferred form in Python 3).
This isn't suitable for quoting in command lines on Windows (and the
documentation for shlex.quote even says it's only usable for Unix
shells).

In general, the python subprocess.list2cmdline function should do
proper quoting for the platform's current shell. However, it doesn't
quote the ';' char, which we pass within some arguments to run.py.
Therefore use the custom reimplementation from lit.TestRunner which
is amended to quote ';' too.

The fact that arguemnts were quoted with single quotes didn't matter
for command lines that were executed by either bash or the lit internal
shell, but if executing things directly using subprocess.call, as in
_supportsVerify, the quoted path to %{cxx} fails to be resolved by the
Windows shell.

This unlocks 114 tests that previously were skipped on Windows.

Differential Revision: https://reviews.llvm.org/D103310
2021-06-01 09:51:41 +03:00
Nico Weber 1279b79c9b [gn build] make libunwind build on macOS 2021-05-31 13:17:16 -04:00
Arthur Eubanks 8815ce03e8 Remove "Rewrite Symbols" from codegen pipeline
It breaks up the function pass manager in the codegen pipeline.

With empty parameters, it looks at the -mllvm flag -rewrite-map-file.
This is likely not in use.

Add a check that we only have one function pass manager in the codegen
pipeline.

Some tests relied on the fact that we had a module pass somewhere in the
codegen pipeline.

addr-label.ll crashes on ARM due to this change. This is because a
ARMConstantPoolConstant containing a BasicBlock to represent a
blockaddress may hold an invalid pointer to a BasicBlock if the
blockaddress is invalidated by its BasicBlock getting removed. In that
case all referencing blockaddresses are RAUW a constant int. Making
ARMConstantPoolConstant::CVal a WeakVH fixes the crash, but I'm not sure
that's the right fix. As a workaround, create a barrier right before
ISel so that IR optimizations can't happen while a
ARMConstantPoolConstant has been created.

Reviewed By: rnk, MaskRay, compnerd

Differential Revision: https://reviews.llvm.org/D99707
2021-05-31 08:32:36 -07:00
Mindong Chen 71acce68da [NFCI] Move DEBUG_TYPE definition below #includes
When you try to define a new DEBUG_TYPE in a header file, DEBUG_TYPE
definition defined around the #includes in files include it could
result in redefinition warnings even compile errors.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D102594
2021-05-30 17:31:01 +08:00
LLVM GN Syncbot 42910da585 [gn build] Port b13edf6e90 2021-05-29 07:51:43 +00:00
Eli Friedman 0b3b0a727a [AArch64][RISCV] Make sure isel correctly honors failure orderings.
If a cmpxchg specifies acquire or seq_cst on failure, make sure we
generate code consistent with that ordering even if the success ordering
is not acquire/seq_cst.

At one point, it was ambiguous whether this sort of construct was valid,
but the C++ standad and LLVM now accept arbitrary combinations of
success/failure orderings.

This doesn't address the corresponding issue in AtomicExpand. (This was
reported as https://bugs.llvm.org/show_bug.cgi?id=33332 .)

Fixes https://bugs.llvm.org/show_bug.cgi?id=50512.

Differential Revision: https://reviews.llvm.org/D103284
2021-05-28 12:47:40 -07:00
Nico Weber 1a0e5d561c [gn build] manually port 982e3c0510 (check-lld needs dsymutil) 2021-05-28 15:39:12 -04:00
LLVM GN Syncbot b6afdbac13 [gn build] Port 9968896cd6 2021-05-28 18:57:30 +00:00
Reid Kleckner 4c6e2774d8 [gn] Make ubsan errors fatal, as in cmake
Apparently ubsan errors are non-fatal by default. If you introduce UB
into LLVM and run the tests, if errors are not fatal, the test will
still produce the expected output and the tests will pass. In order to
make ubsan errors show up as test failures, they have to be made fatal.
Pass the -fno-sanitize-recover=all flag to make it so.

Differential Revision: https://reviews.llvm.org/D103298
2021-05-28 08:05:37 -07:00
LLVM GN Syncbot 0c4f76c942 [gn build] Port 58b29a4efc 2021-05-28 14:09:31 +00:00
Nico Weber 6915a55824 [gn build] (semi-manually) port bd04d78d64 2021-05-28 08:04:52 -04:00
James Henderson 2ae5843187 [lit][test] Improve testing of use_llvm_tool
Reviewed by: MaskRay

Differential Revision: https://reviews.llvm.org/D103154
2021-05-27 11:25:43 +01:00
LLVM GN Syncbot cc3db8dbdf [gn build] Port 857fa7b7b1 2021-05-27 04:42:56 +00:00
LLVM GN Syncbot 77274258e2 [gn build] Port 0dc7fd1bc1 2021-05-27 04:42:55 +00:00
LLVM GN Syncbot e47311d888 [gn build] Port de9df3f5b9 2021-05-26 15:57:01 +00:00
LLVM GN Syncbot deb6a0f94a [gn build] Port 16342e3994 2021-05-26 15:45:57 +00:00
LLVM GN Syncbot dde123993f [gn build] Port 36d0fdf9ac 2021-05-26 04:31:12 +00:00
Alexandre Ganea 20c9a44ac0 [benchmark] Silence 'suggest override' and 'missing override' warnings
When building with Clang 11 on Windows, silence the following:

F:\aganea\llvm-project\llvm\utils\benchmark\include\benchmark/benchmark.h(955,8): warning: 'Run' overrides a member function but is not marked 'override' [-Wsuggest-override]
  void Run(State& st);
       ^
F:\aganea\llvm-project\llvm\utils\benchmark\include\benchmark/benchmark.h(895,16): note: overridden virtual function is here
  virtual void Run(State& state) = 0;
               ^
1 warning generated.
2021-05-25 18:46:37 -04:00
LLVM GN Syncbot 9ba21911db [gn build] Port 33706191d8 2021-05-25 18:58:50 +00:00
Marco Elver 280333021e [SanitizeCoverage] Add support for NoSanitizeCoverage function attribute
We really ought to support no_sanitize("coverage") in line with other
sanitizers. This came up again in discussions on the Linux-kernel
mailing lists, because we currently do workarounds using objtool to
remove coverage instrumentation. Since that support is only on x86, to
continue support coverage instrumentation on other architectures, we
must support selectively disabling coverage instrumentation via function
attributes.

Unfortunately, for SanitizeCoverage, it has not been implemented as a
sanitizer via fsanitize= and associated options in Sanitizers.def, but
rolls its own option fsanitize-coverage. This meant that we never got
"automatic" no_sanitize attribute support.

Implement no_sanitize attribute support by special-casing the string
"coverage" in the NoSanitizeAttr implementation. To keep the feature as
unintrusive to existing IR generation as possible, define a new negative
function attribute NoSanitizeCoverage to propagate the information
through to the instrumentation pass.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=49035

Reviewed By: vitalybuka, morehouse

Differential Revision: https://reviews.llvm.org/D102772
2021-05-25 12:57:14 +02:00
LLVM GN Syncbot e7a268f9ef [gn build] Port b510e4cf1b 2021-05-24 18:48:17 +00:00
LLVM GN Syncbot b2c70bd21a [gn build] Port a64ebb8637 2021-05-24 18:36:50 +00:00
LLVM GN Syncbot f55a733506 [gn build] Port 095e91c973 2021-05-24 17:18:43 +00:00
Nico Weber f47575f83c [gn build] (semi-manually) port 0bccdf82f7 2021-05-23 10:01:06 -04:00
Fangrui Song 5d9ea36baf [UpdateTestChecks] Default --x86_scrub_rip to False
True is a bad default: the useful symbol names and `@GOTPCREL` are scrubbed.

Change the default and add global variable tests to x86-basic.ll
(renamed from x86_function_name.ll since we now also test variables).
I updated some tests to show the differences.

Updated LCPI regex to include Darwin style `LCPI_[0-9]+_[0-9]+` (no
leading dot).

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D102588
2021-05-21 19:26:15 -07:00
Vitaly Buka 01c5904907 [lit] Print full googletest commad line
Similar to regular output of LIT tests:
c162f086ba/llvm/utils/lit/lit/TestRunner.py (L1569)

Differential Revision: https://reviews.llvm.org/D102899
2021-05-21 16:11:51 -07:00
Vitaly Buka bbdabb044d [NFC][lit] Add missing UNRESOLVED test
D102899 will change it behavour.
2021-05-21 11:34:00 -07:00
Vitaly Buka 3294001304 [NFC][lit] Add skipped test into upstream format
Missing from D102694
2021-05-21 11:34:00 -07:00
Vitaly Buka fa62a44e4e [nfc][lit] Relax spacing check 2021-05-21 11:34:00 -07:00
LLVM GN Syncbot 9039ade209 [gn build] Port 9db55b314b 2021-05-21 18:10:35 +00:00
Djordje Todorovic b9076d119a Recommit: "[Debugify][Original DI] Test dbg var loc preservation""
[Debugify][Original DI] Test dbg var loc preservation

    This is an improvement of [0]. This adds checking of
    original llvm.dbg.values()/declares() instructions in
    optimizations.

    We have picked a real issue that has been found with
    this (actually, picked one variable location missing
    from [1] and resolved the issue), and the result is
    the fix for that -- D100844.

    Before applying the D100844, using the options from [0]
    (but with this patch applied) on the compilation of GDB 7.11,
    the final HTML report for the debug-info issues can be found
    at [1] (please scroll down, and look for
    "Summary of Variable Location Bugs"). After applying
    the D100844, the numbers has improved a bit -- please take
    a look into [2].

    [0] https://llvm.org/docs/HowToUpdateDebugInfo.html#\
        test-original-debug-info-preservation-in-optimizations
    [1] https://djolertrk.github.io/di-check-before-adce-fix/
    [2] https://djolertrk.github.io/di-check-after-adce-fix/

    Differential Revision: https://reviews.llvm.org/D100845

The Unit test was failing because the pass from the test that
modifies the IR, in its runOnFunction() didn't return 'true',
so the expensive-check configuration triggered an assertion.
2021-05-21 02:04:29 -07:00
Igor Kudrin 21b40f02d2 [lit][gtest] Support SKIPPED tests
This updates the googletest format to support tests that use GTEST_SKIP(),
which is now available with the updated googletest framework.

Differential Revision: https://reviews.llvm.org/D102694
2021-05-21 13:39:52 +07:00
LLVM GN Syncbot efea813445 [gn build] Port 0af3105b64 2021-05-20 19:20:25 +00:00
Nico Weber e1ffcfcee7 [gn build] try reverting code part of f05fbb7795
Maybe aa8fe8fe6c was all that was needed to fix the build and
we can keep the code with fewer conditionals after all.
2021-05-20 15:08:39 -04:00
Nico Weber aa8fe8fe6c [gn build] attempt again to unbreak linux after fc9696130c 2021-05-20 15:01:35 -04:00
Nico Weber f3f592ac89 [gn build] use PEP-8 indents in symbol_exports.py 2021-05-20 15:00:24 -04:00
Nico Weber f05fbb7795 [gn build] attempt to unbreak linux after fc9696130c
Only emit `global:` if there are any exported symbols.

While here, `chmod +x` the symbol_exports.py script.
2021-05-20 14:55:40 -04:00
Nico Weber fc9696130c [gn build] Use .export files
Just fixing an old TODO, no dramatic behavior change.

Differential Revision: https://reviews.llvm.org/D102843
2021-05-20 14:48:12 -04:00
Djordje Todorovic 0ae3c1d4d7 Revert "[Debugify][Original DI] Test dbg var loc preservation"
This reverts commit 76f375f3d9.

This will be pushed again, after investigating a test failure:
https://lab.llvm.org/buildbot/#/builders/16/builds/11254
2021-05-20 07:11:35 -07:00
Djordje Todorovic 76f375f3d9 [Debugify][Original DI] Test dbg var loc preservation
This is an improvement of [0]. This adds checking of
original llvm.dbg.values()/declares() instructions in
optimizations.

We have picked a real issue that has been found with
this (actually, picked one variable location missing
from [1] and resolved the issue), and the result is
the fix for that -- D100844.

Before applying the D100844, using the options from [0]
(but with this patch applied) on the compilation of GDB 7.11,
the final HTML report for the debug-info issues can be found
at [1] (please scroll down, and look for
"Summary of Variable Location Bugs"). After applying
the D100844, the numbers has improved a bit -- please take
a look into [2].

[0] https://llvm.org/docs/HowToUpdateDebugInfo.html\
[1] https://djolertrk.github.io/di-check-before-adce-fix/
[2] https://djolertrk.github.io/di-check-after-adce-fix/

Differential Revision: https://reviews.llvm.org/D100845
2021-05-20 06:42:02 -07:00
LLVM GN Syncbot 2d8cb8205a [gn build] Port 081c62501e 2021-05-20 10:17:56 +00:00
LLVM GN Syncbot f2c97605a0 [gn build] Port 4bf69fb52b 2021-05-19 22:27:27 +00:00
Mariusz Ceier 9383e9c1e6 Fix lld macho standalone build by including llvm/Config/llvm-config.h instead of llvm/Config/config.h
lld/MachO/Driver.cpp and lld/MachO/SyntheticSections.cpp include
llvm/Config/config.h which doesn't exist when building standalone lld.

This patch replaces llvm/Config/config.h include with llvm/Config/llvm-config.h
just like it is in lld/ELF/Driver.cpp and HAVE_LIBXAR with LLVM_HAVE_LIXAR and
moves LLVM_HAVE_LIBXAR from config.h to llvm-config.h

Also it adds LLVM_HAVE_LIBXAR to LLVMConfig.cmake and links liblldMachO2.so
with XAR_LIB if LLVM_HAVE_LIBXAR is set.

Differential Revision: https://reviews.llvm.org/D102084
2021-05-19 11:15:07 -04:00
Senran Zhang 7faabe5fc9 [Utils][vim] Highlight CHECK-EMPTY: & CHECK-COUNT: directives
Reviewed By: porglezomp

Differential Revision: https://reviews.llvm.org/D101135
2021-05-18 23:42:23 -04:00
LLVM GN Syncbot 09ac3523b6 [gn build] Port 886629a8c9 2021-05-18 23:27:42 +00:00
Arthur Eubanks 16cbc80e72 [gn build] Rename PassesBindingsTests and add it to unittests 2021-05-18 10:26:00 -07:00
Arthur Eubanks 85f8698eb9 [gn build] Add target for PassesBindingsTest 2021-05-18 10:01:19 -07:00
James Henderson 20e1577d13 [lld] Add a feature for each lld variant when use_lld is called
This allows tests to detect whether to run or not, dependent on which
LLD version is required for the test.

Reviewed by: thopre

Differential Revision: https://reviews.llvm.org/D101997
2021-05-18 10:51:27 +01:00
James Henderson a1e6565855 [lit] Stop using PATH to lookup clang/lld/lldb unless requested
This patch stops lit from looking on the PATH for clang, lld and other
users of use_llvm_tool (currently only the debuginfo-tests) unless the
call explicitly requests to opt into using the PATH. When not opting in,
tests will only look in the build directory.

See the mailing list thread starting from
https://lists.llvm.org/pipermail/llvm-dev/2021-May/150421.html.

See the review for details of why decisions were made about when still
to use the PATH.

Reviewed by: thopre

Differential Revision: https://reviews.llvm.org/D102630
2021-05-18 10:43:33 +01:00
LLVM GN Syncbot 11c857c71d [gn build] Port 0c557db617 2021-05-17 18:56:03 +00:00
Peter Collingbourne c870e36be1 gn build: Only build the hwasan runtime in aliasing mode on x86.
The LAM mode is currently untested by check-hwasan, so we only need
to build the runtime in aliasing mode. Because LAM mode will always
need to be conditional (because only certain hardware will support
it) we can always just disable the LAM lit tests if it ever starts
being tested.
2021-05-17 11:48:49 -07:00
James Henderson d05ae0fd17 [debuginfo-tests] Fix environment variable used to specify LLDB
Currently, if the user specifies the environment variable 'CLANG', tests
will attempt to use the value as a path to the clang executable.
Previously, lldb could also be specified via the CLANG environment
variable, but this was almost certainly a bug, because that meant both
clang and lldb would have the same path. This patch changes the
environment variable for lldb to 'LLDB'.

Reviewed by: thopre, teemperor

Differential Revision: https://reviews.llvm.org/D101982
2021-05-17 12:50:10 +01:00
Nico Weber 77fa9a9b15 [gn build] reformat all gn files
$ git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
2021-05-17 06:59:43 -04:00
Nico Weber 452e035729 [gn build] Add build file for msan runtime
Works for the examples on
https://clang.llvm.org/docs/MemorySanitizer.html

Differential Revision: https://reviews.llvm.org/D102554
2021-05-17 06:58:10 -04:00
Tim Northover 82a0e808bb IR/AArch64/X86: add "swifttailcc" calling convention.
Swift's new concurrency features are going to require guaranteed tail calls so
that they don't consume excessive amounts of stack space. This would normally
mean "tailcc", but there are also Swift-specific ABI desires that don't
naturally go along with "tailcc" so this adds another calling convention that's
the combination of "swiftcc" and "tailcc".

Support is added for AArch64 and X86 for now.
2021-05-17 10:48:34 +01:00
David Blaikie 7f5d8e6559 Fix some deprecated copy ops in google mock 2021-05-16 15:59:06 -07:00
Kai Luo 06a9b0c6f4 [Utils] Fix indentation error in utils/wciia.py
Running this script gives
```
"llvm-project/llvm/./utils/wciia.py", line 56
    if word == "N:":
TabError: inconsistent use of tabs and spaces in indentation
```
Under emacs' whitespace-mode, it shows
```
for·line·in·code_owners_file:$
····for·word·in·line.split():$
»       if·word·==·"N:":$
»       »       name·=·line[2:].strip()$
»       »       if·code_owner:$
»       »       »       process_code_owner(code_owner)$
»       »       »       code_owner·=·{}$
```
I use `yapf` to format this script directly and it's running correctly.
2021-05-16 22:34:09 +08:00
Simon Pilgrim bd7b7ca3ee Revert rG632668c1c0e7dcf97154d2e377491cdc8cb6963c : "[TableGen] TreePatternNode::isIsomorphicTo - early out for matching leafs. NFCI."
Revert premature (and very broken....) experimental commit.
2021-05-15 15:49:14 +01:00
Simon Pilgrim 632668c1c0 [TableGen] TreePatternNode::isIsomorphicTo - early out for matching leafs. NFCI.
If the leafs are the same then no need to perform DefInit matching.
2021-05-15 15:34:43 +01:00
Nico Weber 46b14dc485 [gn build] (manually) port ad7e12226f 2021-05-14 22:24:39 -04:00
Benjamin Kramer a558ebbd6f Reinstate gtest fix from 4f0b0bf5c6
I missed this when merging gtest 1.10.0, breaking all asan tests :|
2021-05-15 00:35:53 +02:00
Benjamin Kramer 4901199f5b GTEST_HAS_TR1_TUPLE is gone, stop defining it. 2021-05-14 21:14:32 +02:00
Benjamin Kramer 09499efb7a Add another -Wdeprecated-copy hack for gtest 2021-05-14 20:37:03 +02:00
Nico Weber 0ca6e93a9e [gn build] (manually) merge b7d1ab75cf
No check-hwasan-lam target yet, though.
2021-05-14 13:51:10 -04:00
Benjamin Kramer 1dbfeb463b Document updated googletest + modifications 2021-05-14 19:26:12 +02:00
Benjamin Kramer d4d80a2903 Bump googletest to 1.10.0 2021-05-14 19:16:31 +02:00
Benjamin Kramer 4dd546131a Bump googletest to 1.8.1
We've accumulated a scary amount of local patches to this directory. I
tried to merge them all, but if your favorite change is missing please
reapply it manually (and send it upstream).
2021-05-14 17:20:06 +02:00
LLVM GN Syncbot de115c3fb2 [gn build] Port 0fda4c4745 2021-05-14 04:56:03 +00:00
Reid Kleckner 5ba4a0e890 [gn] Don't pass -fprofile-instr-generate to linker on Windows
Avoids a warning from the linker. The user still has to put the resource
directory on the linker search path, and I can't find a clean way to do
that automatically in gn.
2021-05-13 16:04:11 -07:00
Nico Weber 9310840cc2 [gn build] (manually) port 92f9852fc9, clang-repl 2021-05-13 08:53:53 -04:00
LLVM GN Syncbot 9bf1761975 [gn build] Port d8b37de8a4 2021-05-13 05:32:35 +00:00
Craig Topper 44e0e91db0 [ValueTypes] Rename MVT::getVectorNumElements() to MVT::getVectorMinNumElements(). Fix some misuses of getVectorNumElements()
getVectorNumElements() returns a value for scalable vectors
without any warning so it is effectively getVectorMinNumElements().
By renaming it and making getVectorNumElements() forward to
it, we can insert a check for scalable vectors into getVectorNumElements()
similar to EVT. I didn't do that in this patch because there are still more
fixes needed, but I was able to temporarily do it and passed the RISCV
lit tests with these changes.

The changes to isPow2VectorType and getPow2VectorType are copied from EVT.

The change to TypeInfer::EnforceSameNumElts reduces the size of AArch64's isel table.
We're now considering SameNumElts to require the scalable property to match which
removes some unneeded type checks.

This was motivated by the bug I fixed yesterday in 80b9510806

Reviewed By: frasercrmck, sdesmalen

Differential Revision: https://reviews.llvm.org/D102262
2021-05-12 07:46:45 -07:00
Amara Emerson ae2b36e8bd [AArch64][GlobalISel] Support truncstorei8/i16 w/ combine to form truncating G_STOREs.
This needs some tablegen changes so that we can actually import the patterns properly.

Differential Revision: https://reviews.llvm.org/D102204
2021-05-11 11:33:03 -07:00
LLVM GN Syncbot 842b162446 [gn build] Port e5d483f28a 2021-05-11 00:19:33 +00:00
LLVM GN Syncbot 0077dce361 [gn build] Port 3b8d2be527 2021-05-10 23:06:37 +00:00
qixingxue fefd03a891 [TableGen] Remove redundant `Error:` in msg (NFC)
Since calling `PrintFatalError` will automatically add `error: `
prefix in the message printed, there is no need having an extra
`ERROR:` prefix in the argument passed.

Differential Revision: https://reviews.llvm.org/D102151
Reviewed By: Paul-C-Anagnostopoulos
2021-05-10 21:18:37 +08:00
Xiang1 Zhang d4bdeca576 [X86] Support AMX fast register allocation
Differential Revision: https://reviews.llvm.org/D100026
2021-05-08 14:21:11 +08:00
Xiang1 Zhang bebafe01a7 Revert "[X86] Support AMX fast register allocation"
This reverts commit 77e2e5e07d.
2021-05-08 13:43:32 +08:00
Xiang1 Zhang 77e2e5e07d [X86] Support AMX fast register allocation 2021-05-08 13:27:21 +08:00
Arthur Eubanks 44d14d5de6 [lit] Bump up the Windows process cap from 32 to 60
At 61 or over, I see messages like

  File "...\Python\Python39\lib\multiprocessing\connection.py", line 816, in _exhaustive_wait
    res = _winapi.WaitForMultipleObjects(L, False, timeout)

  ValueError: need at most 63 handles, got a sequence of length 64

60 seems to work for me.

If this causes issues for anybody else, feel free to revert.
2021-05-07 18:13:38 -07:00
Arthur Eubanks ddff81f692 Revert "lit: revert 134b103fc0f3a995d76398bf4b029d72bebe8162"
This reverts commit d319005a37.

Causing messages like:

  File "...\Python\Python39\lib\multiprocessing\connection.py", line 816, in _exhaustive_wait
    res = _winapi.WaitForMultipleObjects(L, False, timeout)
ValueError: need at most 63 handles, got a sequence of length 74
2021-05-07 18:00:11 -07:00
Arthur Eubanks d82bc9e81d [gn build] Manually port 5b158093e 2021-05-07 17:54:32 -07:00
Saleem Abdulrasool d319005a37 lit: revert 134b103fc0
Revert the 32-process cap on Windows.  When testing with Swift, we found
that there was a time reduction for testing with the higher load.  This
should hopefully not matter much in practice.  In the case that the
original problem with python remains with a high subprocess count, we
can easily revert this change.
2021-05-07 10:22:43 -07:00
LLVM GN Syncbot 8894a4b5d7 [gn build] Port 98e5ede604 2021-05-07 09:15:50 +00:00
James Henderson d2b2ad32b7 [lit][test] Attempt fix when paths include symlink
Example of failure:
https://lab.llvm.org/staging/#/builders/126/builds/345/steps/5/logs/FAIL__lit___use-tool-search-env_py
2021-05-07 09:21:58 +01:00
Coelacanthus e6cf3d6441
[TableGen] Use range-based for loops (NFC)
Use range-based for loops in TableGen.

Reviewed By: Paul-C-Anagnostopoulos

Differential Revision: https://reviews.llvm.org/D101994
2021-05-07 13:34:03 +08:00
LLVM GN Syncbot fca10c8808 [gn build] Port 83af66e18e 2021-05-06 21:03:05 +00:00
Arthur Eubanks 642df18f14 [gn build] Support compiler-rt/profile on Windows
Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D101961
2021-05-06 10:20:52 -07:00
James Henderson abe2c906ad [lit] Report tool path from use_llvm_tool if found via env variable
Previously, if the search_env argument was specified, and the tool was
found at that location, the path was not reported, unlike other
situations when this function was called. Adding the reporting makes the
function consistent.

Reviewed by: thopre

Differential Revision: https://reviews.llvm.org/D101896
2021-05-06 09:21:54 +01:00
Nico Weber ea3777fe22 [gn build] (semi-manually) port 0b10bb7ddd more 2021-05-05 18:15:13 -04:00
Nico Weber ceccfaae14 [gn build] (semi-manually) port 0b10bb7ddd 2021-05-05 18:06:52 -04:00
Giorgis Georgakoudis 78a7d8c4dd [Utils][NFC] Rename replace-function-regex in update_cc_test_checks
This patch renames the replace-function-regex to replace-value-regex to indicate that the existing regex replacement functionality can replace any IR value besides functions.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D101934
2021-05-05 14:19:30 -07:00
LLVM GN Syncbot 72cefd50e5 [gn build] Port 600686d75f 2021-05-05 04:57:55 +00:00
LLVM GN Syncbot 88ec05b654 [gn build] Port f2018d6c16 2021-05-05 03:54:38 +00:00
Giorgis Georgakoudis 92f2c39f91 [Utils] Run non-filecheck runlines in-order in update_cc_test_checks
The script update_cc_test_checks runs all non-filechecked runlines before the filechecked ones. This creates problems since outputs of those non-filechecked runlines may conflict and that will fail the execution of update_cc_test_checks. This patch executes non-filechecked in the order specified in the test file to avoid this issue.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D101683
2021-05-04 12:06:03 -07:00
LLVM GN Syncbot 6ede28c9e1 [gn build] Port 2021d272ad 2021-05-04 15:06:28 +00:00
Nico Weber d7ec48d71b [clang] accept -fsanitize-ignorelist= in addition to -fsanitize-blacklist=
Use that for internal names (including the default ignorelists of the
sanitizers).

Differential Revision: https://reviews.llvm.org/D101832
2021-05-04 10:24:00 -04:00
LLVM GN Syncbot caa8431404 [gn build] Port 1db4dbba24 2021-05-04 09:56:46 +00:00
LLVM GN Syncbot 97f4789c38 [gn build] Port ed51156084 2021-05-04 06:39:48 +00:00
LLVM GN Syncbot 47ee47e1e8 [gn build] Port 7310403e3c 2021-05-04 00:04:57 +00:00
Giorgis Georgakoudis 404fa9a6cf [Utils] Add prof metadata to matched unnamed values
Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D101742
2021-05-03 15:15:34 -07:00
Jon Roelofs aad3113417 Partial revert of "Use std::foo_t rather than std::foo in LLVM." in googlebench
Since googlebench builds as c++11, the change there is incorrect and breaks the
googlebench build when the STL implementation is strict about std::enable_if_t
not being available in lesser c++ versions.

partial revert of: 1bd6123b78 (https://reviews.llvm.org/D74384)

Differential Revision: https://reviews.llvm.org/D101583
2021-05-03 07:49:30 -07:00
LLVM GN Syncbot 895ba21401 [gn build] Port 1527a5e4b4 2021-05-03 12:53:10 +00:00
Craig Topper 6430430958 [TableGen] Use sign rotated VBR for OPC_EmitInteger.
This allows for a much more efficient encoding for small negative
numbers by storing the sign bit first and negating the rest of
the bits. This was already being used for OPC_CheckInteger.

For every in tree target this affects, the table got smaller.
R600GenDAGISel.inc saw the largest reduction of 7K.

I did have to add a new opcode for StringIntegers used for
register class ids and subregister indices since we don't have the
integer value to encode. The enum name is emitted directly into
the table. Previously assumed the enum would expand to a positive
7-bit number. We might be able to just shift that right by 1 and
assume it is a positive 6 bit number, but that will need more
investigation.
2021-05-02 12:40:44 -07:00
LLVM GN Syncbot ff7f27fe67 [gn build] Port 1977c53b2a 2021-05-02 02:55:47 +00:00
LLVM GN Syncbot 7994615ea0 [gn build] Port 02c5ba8679 2021-05-01 00:09:37 +00:00
LLVM GN Syncbot e01e9a2e31 [gn build] Port 2d28100bf2 2021-04-30 20:17:55 +00:00
LLVM GN Syncbot adf4dc0561 [gn build] Port c6f20d70a8 2021-04-30 17:30:08 +00:00
LLVM GN Syncbot 5596bc40e6 [gn build] Port 7c17731596 2021-04-30 17:00:36 +00:00
LLVM GN Syncbot 8ebbaf17f9 [gn build] Port 5a3309f825 2021-04-30 17:00:35 +00:00
LLVM GN Syncbot 4978bf65ad [gn build] Port 43bc584dc0 2021-04-30 13:48:40 +00:00
Dominik Montada 97ed1b6036 [GISel] Teach TableGen to check predicates of immediate operands in patterns
Reviewed By: dsanders

Differential Revision: https://reviews.llvm.org/D91703
2021-04-30 10:18:45 +02:00
LLVM GN Syncbot 5fbea82692 [gn build] Port df323ba445 2021-04-29 16:59:58 +00:00
Benjamin Kramer df323ba445 Revert "[X86] Support AMX fast register allocation"
This reverts commit 3b8ec86fd5.

Revert "[X86] Refine AMX fast register allocation"

This reverts commit c3f95e9197.

This pass breaks using LLVM in a multi-threaded environment by
introducing global state.
2021-04-29 18:56:33 +02:00
Fraser Cormack 618b5b5fbc [Utils][vim] Highlight 'vscale' constant
Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D101466
2021-04-29 08:53:30 +01:00
Craig Topper 3d3782397a [TableGen] Remove predicate filtering from GenerateVariants.
After D100691, predicates should be cheap to compare again so
we don't need to filter anymore.

This is mostly just a revert of several patches going back to 2018.

Reviewed By: kparzysz

Differential Revision: https://reviews.llvm.org/D100695
2021-04-28 16:02:13 -07:00
Craig Topper f391de8cb6 [TableGen] Store predicates in PatternToMatch as ListInit *. Add string for HwModeFeatures
This uses to be how predicates were handled prior to HwMode being
added. When the Predicates were converted to a std::vector it
significantly increased the cost of a compare in GenerateVariants.
Since ListInit's are uniquified by tablegen, we can use a simple
pointer comparison to check for identical lists.

In order to store the HwMode, we now add a separate string to
PatternToMatch. This will be appended separately to the predicate
string in getPredicateCheck. A new getPredicateRecords is added
to allow GlobalISel and getPredicateCheck to both get the sorted
list of Records. GlobalISel was ignoring any HwMode predicates
before and still is.

There is one slight change here, ListInits with different predicate
orders aren't sorted so the filtering in GenerateVariants might
fail to detect two isomorphic patterns with different predicate
orders. This doesn't seem to be happening in tree today.

My hope is this will allow us to remove all the BitVector tracking
in GenerateVariants that was making up for predicates beeing
expensive to compare. There's a decent amount of heap allocations
there on large targets like X86, AMDGPU, and RISCV.

Differential Revision: https://reviews.llvm.org/D100691
2021-04-28 12:05:49 -07:00
Nico Weber 671f0e2e18 [clang] Make libBasic not depend on MC
Reduces numbers of files built for clang-format from 575 to 449.

Requires two small changes:

1. Don't use llvm::ExceptionHandling in LangOptions. This isn't
   even quite the right type since we don't use all of its values.
   Tweaks the changes made in:
   - https://reviews.llvm.org/D93215
   - https://reviews.llvm.org/D93216

2. Move section name validation code added (long ago) in commit 30ba67439 out
   of libBasic into Sema and base the check on the triple. This is a bit less
   OOP-y, but completely in line with what we do in many other places in Sema.

No behavior change.

Differential Revision: https://reviews.llvm.org/D101463
2021-04-28 12:16:22 -04:00
Nico Weber 3d974ac9fc [gn build] (port) 64bc44f5dd and f8de9aaef2 some more 2021-04-28 09:59:07 -04:00
Alex Richardson 9692811b26 [update_(llc_)test_checks.py] Support pre-processing commands
This has been rather useful in our downstream CHERI target where we want
to run tests both with addrspace(0) and addrspace(200) pointers.
With this patch we can prefix the opt command with
`sed -e 's/addrspace(200)/addrspace(0)/g' -e 's/-A200-P200-G200//g'` to
test both cases using the same IR input.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D95137
2021-04-28 12:19:19 +01:00
Nico Weber 0f1137ba79 [clang/Basic] Make TargetInfo.h not use DataLayout again
Reverts parts of https://reviews.llvm.org/D17183, but keeps the
resetDataLayout() API and adds an assert that checks that datalayout string and
user label prefix are in sync.

Approach 1 in https://reviews.llvm.org/D17183#2653279
Reduces number of TUs build for 'clang-format' from 689 to 575.

I also implemented approach 2 in D100764. If someone feels motivated
to make us use DataLayout more, it's easy to revert this change here
and go with D100764 instead. I don't plan on doing more work in this
area though, so I prefer going with the smaller, more self-consistent change.

Differential Revision: https://reviews.llvm.org/D100776
2021-04-27 22:26:10 -04:00
Nico Weber c35fadceab [gn build] (manually) port 82d3c0759f 2021-04-27 22:25:55 -04:00
Craig Topper e05fdab125 [TableGen] Add predicate checks to isel patterns for default HwMode.
As discussed in D100691 and based on D100889.

I removed the ModeChecks cache which provides little value. Reduced
from three loops to two. Used ArrayRef to pass the Predicate to
AppendPattern to avoid needing to construct a vector for single
mode. Used SmallVector to avoid heap allocation constructing
DefaultCheck for the in tree targets the use it.

Reviewed By: kparzysz

Differential Revision: https://reviews.llvm.org/D101240
2021-04-27 10:46:51 -07:00
LLVM GN Syncbot 4cf942adab [gn build] Port 241c2da406 2021-04-27 16:56:33 +00:00
Mikael Holmen 33f04e485c Only ignore -Wdeprecated-copy if the used compiler supports the warning
This is needed after
  https://reviews.llvm.org/rG9658d045926545e62cc3f963fe611d7c5d0c9d98
which introduced code that at least didn't compile clean with clang 8.

Differential Revision: https://reviews.llvm.org/D101288
2021-04-27 08:01:10 +02:00
LLVM GN Syncbot 889fcb2f74 [gn build] Port 51495fd285 2021-04-27 05:57:29 +00:00
LLVM GN Syncbot 891d1e160b [gn build] Port d122d80b3d 2021-04-27 04:24:09 +00:00
LLVM GN Syncbot c6d5e6bc61 [gn build] Port 7aa3cad46a 2021-04-27 00:18:13 +00:00
LLVM GN Syncbot 5daa135a6f [gn build] Port bbddadd46e 2021-04-26 22:16:25 +00:00
LLVM GN Syncbot d7308da4a5 [gn build] Port caf1294d95 2021-04-26 21:24:36 +00:00
LLVM GN Syncbot d3a2038955 [gn build] Port 8740360093 2021-04-26 21:04:24 +00:00
Nico Weber 5529878f8e [gn build] reformat all gn files
$ git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
2021-04-26 16:04:23 -04:00
Nico Weber 7673bd56ff [gn build] (manually) port f8de9aaef2 2021-04-26 16:03:50 -04:00
Dávid Bolvanský 942d2e19e1 Revert "Only ignore -Wdeprecated-copy if the used compiler supports the warning"
This reverts commit b125c034af.

Some bots say " missing binary operator before token "(" "
2021-04-26 16:09:02 +02:00
Dávid Bolvanský b125c034af Only ignore -Wdeprecated-copy if the used compiler supports the warning
This is needed after
  https://reviews.llvm.org/rG9658d045926545e62cc3f963fe611d7c5d0c9d98
which introduced code that at least didn't compile clean with clang 8.

Reviewed By: xbolva00

Differential Revision: https://reviews.llvm.org/D101288
2021-04-26 16:00:54 +02:00
Vitaly Buka 51b4a7ef52 [sanitizer] Use COMPILER_RT_EMULATOR with gtests
Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D100998
2021-04-25 15:41:13 -07:00
Martin Storsjö b493193d74 [googlemock] Fix warnings about superfluous semicolons after 68ff493dfc. NFC. 2021-04-25 23:41:37 +03:00
Nemanja Ivanovic 504eee28fe Disable deprecated-copy warnings on various LLVM code to bring the bot back to green
Bootstrap with `-Werror` is currently broken due to D79714.
This patch is required to bring the bootstrap bot back to green. The
code will likely need to be fixed and the pragmas removed in due time,
but for now we need to bring the bot back up.

Bot that is currently failing:
https://lab.llvm.org/buildbot/#/builders/36/builds/7680

Differential Revision: https://reviews.llvm.org/D101214
2021-04-25 12:41:46 -07:00
Vitaly Buka 68ff493dfc [NFC] Fixed some D79714 warnings 2021-04-25 12:41:46 -07:00
LLVM GN Syncbot 92880ab7a2 [gn build] Port 1cea7ab4ba 2021-04-25 12:00:31 +00:00
LLVM GN Syncbot c5cb5053a9 [gn build] Port a354fd56c5 2021-04-25 11:27:54 +00:00
Xiang1 Zhang 3b8ec86fd5 [X86] Support AMX fast register allocation
Differential Revision: https://reviews.llvm.org/D100026
2021-04-25 09:45:41 +08:00
Dávid Bolvanský 9658d04592 [utils] Disable -Wdeprecated-copy for googlemock/gtest
Simple fix for build breakage. Feel free to fix all places (quite a lot).
2021-04-23 23:45:50 +02:00
LLVM GN Syncbot f2bf9322b5 [gn build] Port c623945d70 2021-04-23 09:26:02 +00:00
Nico Weber d1bbb8533a [gn build] (manually) port 0b2bc69ba2 2021-04-22 22:40:53 -04:00
Vitaly Buka 686328263e Revert "[sanitizer] Use COMPILER_RT_EMULATOR with gtests"
Missed review comments.

This reverts commit e25082961c.
2021-04-22 11:15:55 -07:00
Vitaly Buka e25082961c [sanitizer] Use COMPILER_RT_EMULATOR with gtests
Differential Revision: https://reviews.llvm.org/D100998
2021-04-22 10:33:50 -07:00
Fangrui Song ef5e7f90ea Temporarily revert the code part of D100981 "Delete le32/le64 targets"
This partially reverts commit 77ac823fd2.

Halide uses le32/le64 (https://github.com/halide/Halide/pull/5934).
Temporarily brings back the code part to give them some time for migration.
2021-04-22 10:18:44 -07:00
Tim Northover 2e72f6b5d8 AArch64: support mixed-size fp <-> int conversions in GlobalISel. 2021-04-22 15:03:17 +01:00
Nico Weber 46991ad266 [gn build] (manually) port aee6c86c4d better
"EmptyNodeIntrospection.inc.in" needs to be a source of the action,
so that ninja knows to rerun this action if that input changes.
2021-04-22 08:41:40 -04:00
Nico Weber b13e9d72da [gn build] (manually) port aee6c86c4d 2021-04-22 08:36:19 -04:00
Fangrui Song 77ac823fd2 Delete le32/le64 targets
They are unused now.

Note: NaCl is still used and is currently expected to be needed until 2022-06
(https://blog.chromium.org/2020/08/changes-to-chrome-app-support-timeline.html).

Differential Revision: https://reviews.llvm.org/D100981
2021-04-21 18:44:12 -07:00
Nico Weber e6eaacbf0b [gn build] add llvm-profgen to gn build
Didn't notice it missing due to https://reviews.llvm.org/D89707#2705110
2021-04-21 11:50:41 -04:00
LLVM GN Syncbot 35c564dc96 [gn build] Port 97e383aa06 2021-04-21 15:39:33 +00:00
Nico Weber ba7a92c01e [Support] Don't include VirtualFileSystem.h in CommandLine.h
CommandLine.h is indirectly included in ~50% of TUs when building
clang, and VirtualFileSystem.h is large.

(Already remarked by jhenderson on D70769.)

No behavior change.

Differential Revision: https://reviews.llvm.org/D100957
2021-04-21 10:19:01 -04:00
LLVM GN Syncbot d51b22d782 [gn build] Port 120fa8293e 2021-04-20 15:33:43 +00:00
Nico Weber 476155e68e [gn build] reformat all gn files
$ git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format

(and manually wrap two comments)
2021-04-20 10:34:08 -04:00
Nico Weber 1a3f88658a [llvm-objdump] Add an llvm-otool tool
This implements an LLVM tool that's flag- and output-compatible
with macOS's `otool` -- except for bugs, but from testing with both
`otool` and `xcrun otool-classic`, llvm-otool matches vanilla
otool's behavior very well already. It's not 100% perfect, but
it's a very solid start.

This uses the same approach as llvm-objcopy: llvm-objdump uses
a different OptTable when it's invoked as llvm-otool. This
is possible thanks to D100433.

Differential Revision: https://reviews.llvm.org/D100583
2021-04-20 08:24:58 -04:00
Thomas Preud'homme d618c6e8ce [lit, test] Fix test cancellation feature detection
A lit feature guards tests for the lit timeout functionality because on
most system it depends on the availability of the psutil Python module.
However, that feature is defined based on the ability of the testing lit
to cancel test, which does not necessarily apply to the ability of the
tested lit.

In particular, RUN commands have a cleared PYTHONPATH and user site
packages are disabled. In the case where psutil is found by the testing
lit from one of those two source of python path, the tested lit would
not be able to find it, causing timeout tests to fail.

This commit fixes the issue by testing the ability to cancel tests in
the RUN command environment.

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D99728
2021-04-20 12:09:30 +01:00
LLVM GN Syncbot 03b98114ce [gn build] Port e0adf7e06a 2021-04-19 18:35:15 +00:00
Nico Weber 004d807f4d [gn build] (manually) merge 5f87ab336e 2021-04-19 10:34:41 -04:00
Nico Weber f12b7daaf1 [gn build] Add missing dependencies to clang/lib/Basic
These are needed when buildling `clang-format` in a clean build dir.
It's a bit unfortunate that clang's lib/Basic depends on these
random TableGen targets. In the CMake build, this is less visible
because I think all llvm-tblgen's complete before all compiles there
(not sure though).
2021-04-19 10:30:10 -04:00
Craig Topper b7ddd45081 [TableGen] Pass SmallVector to union_modes instead of returning a std::vector.
The number of modes is small so this should avoid a heap allocation.

Also replace std::set with SmallSet.
2021-04-18 15:59:52 -07:00
Martin Storsjö d0b03ec401 [lit] Fix the return code for "not not" after evaluating "not" internally
This fixes cases where "not not <command>" is supposed to return
only the error codes 0 or 1, but after efee57925c,
it passed the original error code through.

This was visible on AIX in the shtest-output-printing.py testcase,
where 'wc' returns 2, while it returns 1 on other platforms, and the
test required "not not" to normalize it to 1.
2021-04-19 00:37:13 +03:00
Craig Topper f08b171b18 [TableGen] Use MachineValueTypeSet in place of SmallSet.
MachineValueTypeSet is effectively a std::bitset<256>. This allows
us quickly insert into the set and check if a type is in the set.
2021-04-18 13:38:30 -07:00
Craig Topper f1aaa306ee [TableGen] Use range-based for loop. NFC 2021-04-18 12:41:09 -07:00
LLVM GN Syncbot 410d4492e3 [gn build] Port 01ace074fc 2021-04-18 11:35:28 +00:00
Craig Topper a5e579cc2b [TableGen] Remove local SmallSet from TypeSetByHwMode::insert.
This keeps track of which modes are in VVT so we can find out
if a mode is missing later. But we can just ask VVT whether it
has a particular mode.
2021-04-17 10:48:57 -07:00
Craig Topper a623051dc3 [TableGen] Replace two SmallDenseSets with SmallSets.
The key here is HwMode indices. They're going to be small numbers,
contiguous, and only a few different values. I don't think we need
to go through the SmallDenseSet hashing.

A BitVector would be even better, but we don't have the upper
bound here.
2021-04-16 17:57:53 -07:00
Nico Weber bc636c1c2c [gn build] (manually) port ca6751043d better 2021-04-16 18:16:29 -04:00
Craig Topper be0ffbb21f [TableGen] Run GenerateVariants before ExpandHwModeBasedTypes.
A large portion of the patterns are duplicated for HwMode on RISCV.
If we expand HwMode first, we need to check nearly twice as many
patterns for variants. HwModes shouldn't affect whether a variant
is valid so we should be able to expand after.

This also reduces the RISCV isel table by 539 bytes due to factoring
working better on this pattern order. Unfortunately it increases
Hexagon table size by ~50 bytes. But I think this is a reasonable
trade.
2021-04-16 15:05:33 -07:00
Nico Weber 48cc5b0d35 [gn build] (manually) port ca6751043d 2021-04-16 18:03:44 -04:00
Fangrui Song 657b325416 [TableGen] Fix -Wparentheses 2021-04-16 13:37:52 -07:00
Craig Topper 6b446310be [TableGen] Predicate::operator== needs to compare the HwMode feature name in addition to the HwMode flag.
This was causing GenerateVariants to lose some variants since
HwMode is expanded first. We were mistakenly thinking the HwMode
predicate matched and finding the variant was isomorphic to a
pattern in another HwMode and discarding it.

Found while investigating it if would be better to generate
variants before expanding HwModes to improve RISCV build time.
I noticed an increase in the number of Opc_MorphNodeTo in the table
which indicated that the number of patterns had changed.
2021-04-16 13:22:28 -07:00
Benjamin Kramer 7946cc404f [tblgen] Fold loop into assert to avoid unused variable warnings. NFCI. 2021-04-16 20:47:38 +02:00
Simon Pilgrim 9a6804ab19 [TableGen] CodeGenDAGPatterns - use const references on for-range loops to avoid unnecessary copies. NFCI. 2021-04-16 18:55:23 +01:00
Simon Pilgrim 0168da3035 [TableGen] CodeGenMapTable - use for-range loop. NFCI. 2021-04-16 18:55:23 +01:00
Simon Pilgrim 82240e07eb [TableGen] CodeGenDAGPatterns - (style) remove if-else chain when if block always returns. NFCI. 2021-04-16 18:26:33 +01:00
paperchalice 6445d5ba84 [TableGen] Allow mnemonics aliases with uppercase
Differential Revision: https://reviews.llvm.org/D96691
2021-04-16 09:58:20 -04:00
LLVM GN Syncbot 68744bb479 [gn build] Port 3bc88eb392 2021-04-16 01:16:51 +00:00
Craig Topper 07edd78993 [TableGen] Reduce the number of map lookups in TypeSetByHwMode::getOrCreate. NFCI
hasMode was looking up the map once. Then we'd either call get which
would look up again, or we'd insert into the map which requires
walking the map to find the insertion point.

I believe the hasMode was needed because get has a special case
to look for DefaultMode if the mode being asked for doesn't exist.
We don't want that here so we were using hasMode to make sure we
wouldn't hit that case.

Simplify to a regular operator[] access which will default
construct a SetType if the lookup fails.
2021-04-15 12:32:21 -07:00
LLVM GN Syncbot 915a778098 [gn build] Port 82787eb228 2021-04-15 18:54:08 +00:00
Martin Storsjö efee57925c Reland "[lit] Handle plain negations directly in the internal shell"
Keep running "not --crash" via the external "not" executable, but
for plain negations, and for cases that use the shell "!" operator,
just skip that argument and invert the return code.

The libcxx tests only use the shell operator "!" for negations,
never the "not" executable, because libcxx tests can be run without
having a fully built llvm tree available providing the "not"
executable.

This allows using the internal shell for libcxx tests.

It should be possible to reland this now that D99938 fixed the
one test failure in clang-tidy that broke when "not" was handled
internally, letting lit/python execute grep.exe directly instead
of via not.exe. (See D99330 and D99406 for more commentery on the
exact issue that broke and other potential ways of fixing it.)

Differential Revision: https://reviews.llvm.org/D98859
2021-04-15 11:02:14 +03:00
LLVM GN Syncbot 730c0b6ea3 [gn build] Port b7459a10da 2021-04-15 01:52:03 +00:00
Nico Weber 1035123ac5 [llvm-objdump] Switch command-line parsing from llvm::cl to OptTable
This is similar to D83530, but for llvm-objdump.

The motivation is the desire to add an `llvm-otool` symlink to
llvm-objdump that behaves like macOS's `otool`, using the same
technique the at llvm-objcopy uses to behave like `strip` (etc).

This change for the most part preserves behavior. In some cases,
it increases compatibility with GNU objdump a bit. For example,
the long options now require two dashes, and the long options
taking arguments for the most part now require a `=` in front
of the value. Exceptions are flags where tests passed the
value separately, for these the separate form is kept as
an alias to the = form.

The one-letter short form args are now joined or separate
and long longer accept a =, which also matches GNU objdump.

cl::opt<>s in libraries now have to be explicitly plumbed
through. This patch does that for --x86-asm-syntax=, but
there's hope that we can remove that again.

Differential Revision: https://reviews.llvm.org/D100433
2021-04-14 20:12:24 -04:00
LLVM GN Syncbot c0fa3fe4aa [gn build] Port f992cfba71 2021-04-14 18:37:22 +00:00
LLVM GN Syncbot 89dc4e3312 [gn build] Port e98060fa72 2021-04-14 18:37:21 +00:00
Nico Weber e200690381 [gn build] try to make sync_source_lists_from_cmake.py py3-compatible 2021-04-14 14:36:29 -04:00
LLVM GN Syncbot 34367dd253 [gn build] Port bbab9f986c 2021-04-14 13:59:02 +00:00
Martin Storsjö 37935405ef [lit] Always quote arguments containing '[' on windows
This avoids breaking clang-tidy/infrastructure/validate-check-names.cpp
if 'not' is evaluated as a lit internal tool (making TestRunner
invoke 'grep' directly in that test, instead of invoking 'not', which
then invokes 'grep').

The quoting of arguments is still brittle if the executable is an
MSYS based tool though, as MSYS based tools incorrectly unescape
backslashes in quoted arguments (contrary to regular win32 argument
parsing rules), see D99406 and
https://github.com/msys2/msys2-runtime/issues/36 for more examples
of the issues.

Differential Revision: https://reviews.llvm.org/D99938
2021-04-14 12:32:48 +03:00
LLVM GN Syncbot 096857426e [gn build] Port 530456caf9 2021-04-14 07:28:18 +00:00
LLVM GN Syncbot 9052920676 [gn build] Port cbc9c4ea90 2021-04-14 06:32:13 +00:00
LLVM GN Syncbot 961967453a [gn build] Port 8ca366935b 2021-04-13 18:49:06 +00:00
LLVM GN Syncbot d13c6ce5db [gn build] Port 46b8ea2fff 2021-04-13 18:49:05 +00:00
LLVM GN Syncbot 0f24c0118d [gn build] Port bb6d96ced8 2021-04-13 16:05:40 +00:00
LLVM GN Syncbot 7ec5907a6c [gn build] Port 8914902b01 2021-04-13 16:05:39 +00:00
LLVM GN Syncbot 0f42675c86 [gn build] Port be54341cd2 2021-04-13 13:07:25 +00:00
LLVM GN Syncbot 6674a7a1fd [gn build] Port 9b0a3388eb 2021-04-13 13:07:25 +00:00
LLVM GN Syncbot b0d988d499 [gn build] Port 916fecb499 2021-04-13 13:07:24 +00:00
LLVM GN Syncbot 5c148258a1 [gn build] Port 7f1963dc8e 2021-04-13 13:07:23 +00:00
LLVM GN Syncbot b7e826136b [gn build] Port 4f9b2469f3 2021-04-13 13:07:23 +00:00
LLVM GN Syncbot 37f54edbc2 [gn build] Port 21d6636d83 2021-04-13 13:07:22 +00:00
Nico Weber 5482228e5c [gn build] fix bug in fb0b19c3de
Since __config is no longer in the concatenated generated __config_site,
it now needs to be copied.

(Also fix a comment typo while here.)
2021-04-13 09:06:29 -04:00
LLVM GN Syncbot d926498d9f [gn build] Port e96df3e531 2021-04-13 01:35:58 +00:00
LLVM GN Syncbot 9f64e6ce76 [gn build] Port 6a1ac88fc1 2021-04-12 15:51:13 +00:00
LLVM GN Syncbot 07274e3238 [gn build] Port 26beecfe47 2021-04-12 15:51:12 +00:00
LLVM GN Syncbot db51d5968c [gn build] Port 0b439e4cc9 2021-04-12 15:51:11 +00:00
Yuanfang Chen bcb8ef2d5a abtest.py: support bisection based on a response file
Also makes LINK_TEST customizable from commandline with `--test` option.
2021-04-08 09:46:01 -07:00
Luís Marques b09df246ca [lit testing] Fix xfail-cl.py test worker count
This would fail in test environments with < 3 hardware threads.

Differential Revision: https://reviews.llvm.org/D99858
2021-04-06 20:48:18 +01:00
Arthur Eubanks 9c8b28a69b [llvm-reduce] Remove unwanted module inline asm
We can clear line by line, but that's likely not very important.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D99921
2021-04-06 09:35:37 -07:00
Nico Weber 6103f3f39c [gn build] (manually) port 0116d04d04 2021-04-05 14:12:58 -04:00
LLVM GN Syncbot 5abc725012 [gn build] Port 9b3df78b4c 2021-04-05 17:21:14 +00:00
Craig Topper 122c0e61f1 [TableGen] Use StringRef instead of std::string to split up a string that's being parsed. NFCI 2021-04-03 11:48:13 -07:00
Nikita Popov 665065821e [FastISel] Remove kill tracking
This is a followup to D98145: As far as I know, tracking of kill
flags in FastISel is just a compile-time optimization. However,
I'm not actually seeing any compile-time regression when removing
the tracking. This probably used to be more important in the past,
before FastRA was switched to allocate instructions in reverse
order, which means that it discovers kills as a matter of course.

As such, the kill tracking doesn't really seem to serve a purpose
anymore, and just adds additional complexity and potential for
errors. This patch removes it entirely. The primary changes are
dropping the hasTrivialKill() method and removing the kill
arguments from the emitFast methods. The rest is mechanical fixup.

Differential Revision: https://reviews.llvm.org/D98294
2021-04-03 15:50:13 +02:00
Nico Weber 03c41191af [gn build] hook up tsan on macOS too
Mostly just works already.
2021-04-02 19:21:38 -04:00
Nico Weber 8156d899ab [gn build] (manually) port 4c58f333f1 2021-04-02 18:21:37 -04:00
Nico Weber 55978f914e [gn build] add build file for tsan runtime
Linux-only for now. Some mac bits stubbed out, but not tested.

Good enough for the tiny_race.c example at
https://clang.llvm.org/docs/ThreadSanitizer.html :

   $ out/gn/bin/clang -fsanitize=address -g -O1 tiny_race.c
   $ while true; do ./a.out || echo $? ; done

While here, also make `-fsanitize=address` work for .c files.

Differential Revision: https://reviews.llvm.org/D99795
2021-04-02 12:59:14 -04:00
LLVM GN Syncbot b0c32199a6 [gn build] Port 0f7bbbc481 2021-04-02 10:22:54 +00:00
Samuel 56fa1b4ff2 [llvm-reduce] Add header guards and fix clang-tidy warnings
Add header guards and fix other clang-tidy warnings in .h files.
Also align misaligned header docs

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D99634
2021-04-01 20:38:49 -07:00
LLVM GN Syncbot 4be379b18b [gn build] Port fdc4f19e2f 2021-04-01 17:18:32 +00:00
Philip Reames e8d8754c06 Revert "Make TableGenGlobalISel an object library"
This reverts commit 2c3cf62d4a.

Causes build failures on x86_64, will respond to commit thread with link errors.
2021-03-31 13:27:00 -07:00
Aaron Puchert 2c3cf62d4a Make TableGenGlobalISel an object library
That's how it was originally intended but that wasn't possible because
we still needed to support older CMake versions.

The problem here is that the sources in TableGenGlobalISel are meant to
be linked into both llvm-tblgen and TableGenTests (a unit test), but not
be part of LLVM proper. So they shouldn't be an ordinary LLVM component.
Because they are used in llvm-tblgen, they can't draw in the LLVM dylib
dependency, but then we'd have to do the same thing in TableGenTests to
make sure we don't link both a static Support library and another copy
through the LLVM dylib.

With an object library we're just reusing the object files and don't
have to care about dependencies at all.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D74588
2021-03-31 22:20:56 +02:00
Alex Richardson 44ce487bfe [TableGen] Emit more helpful error messages on empty type set
I have seen this error quite frequently in our out-of-tree CHERI backends
and the lack of location information sometimes makes it quite difficult
to track down the actual source of the error.
This patch changes the llvm_unreachable() to a PrintFatalError() so that
tablegen prints a stack of source locations.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D99468
2021-03-31 09:24:03 +01:00
Zhiwei Chen d332bbee45 [Utils][Emacs] Improve syntax highlight
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D99404
2021-03-30 19:32:30 -07:00
Nico Weber fb0b19c3de Reland "[gn build] port 48e4b0f (__config_site)"
This reverts commit 13aff21f0d,
since the CMake part relanded in c06a8f9caa.

The GN part is a bit simpler than last time due to the
prior simplifications in acea470c16.
2021-03-30 20:32:36 -04:00
LLVM GN Syncbot 69473d68b5 [gn build] Port c51e91e046 2021-03-30 12:15:19 +00:00
Nico Weber 8315890bdc [gn build] (semi-manually) port 51fa9e0fd9 2021-03-30 06:59:37 -04:00
Dave Lee 50a6aa6c0f [llvm][utils] Fix handling of llvm::None 2021-03-29 17:43:53 -07:00
LLVM GN Syncbot b75018e305 [gn build] Port 5178ffc7cf 2021-03-29 22:12:00 +00:00
Samuel 24339056c8 [llvm-reduce] Remove dso_local when possible
Add a new delta pass to llvm-reduce that removes dso_local when possible

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D98673
2021-03-29 12:00:10 -07:00
Craig Topper 0248e24071 [X86][update_llc_test_checks] Use a less greedy regular expression for replacing constant pool labels in tests.
While working on D97208 I noticed that these greedy regular
expressions prevent tests from failing when (%rip) appears after
a constant pool label when it didn't before.

Reviewed By: RKSimon, pengfei

Differential Revision: https://reviews.llvm.org/D99460
2021-03-28 11:39:46 -07:00
LLVM GN Syncbot 1e9746d229 [gn build] Port 7b6f760fcd 2021-03-28 18:35:33 +00:00
Zakk Chen 821547cabb [RISCV][Clang] Update new overloading rules for RVV intrinsics.
RVV intrinsics has new overloading rule, please see
82aac7dad4

Changed:
1. Rename `generic` to `overloaded` because the new rule is not using C11 generic.
2. Change HasGeneric to HasNoMaskedOverloaded because all masked operations
   support overloading api.
3. Add more overloaded tests due to overloading rule changed.

Differential Revision: https://reviews.llvm.org/D99189
2021-03-28 09:04:35 -07:00
Nico Weber ab158d35b5 [gn build] rewrap a comment to 80 cols 2021-03-27 12:50:33 -04:00
Joel E. Denny 43279d1df9 [FileCheck] Try to fix buildbot failures caused by c7c542e8f3
For example,

<https://lab.llvm.org/buildbot/#/builders/132/builds/3929>

has this diagnostic:

```
/opt/gcc/9.3.0/snos/include/g++/bits/stl_tree.h:780:8: error: static assertion failed: comparison object must be invocable as const
  780 |        is_invocable_v<const _Compare&, const _Key&, const _Key&>,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2021-03-27 11:03:10 -04:00
Joel E. Denny c7c542e8f3 [FileCheck] Fix -dump-input per-pattern diagnostic indexing
In input dump annotations, `check:2'1` indicates diagnostic 1 for the
`CHECK` directive on check file line 2.  Without this patch,
`-dump-input` computes the diagnostic index with the assumption that
FileCheck *consecutively* produces all diagnostics for the same
pattern.  Already, that can be a false assumption, as in the examples
below.  Moreover, it seems like a brittle assumption as FileCheck
evolves.  Finally, it actually complicates the implementation even if
it makes it slightly more efficient.

This patch avoids that assumption.  Examples below show results after
applying this patch.  Before applying this patch, `'N` is omitted
throughout these examples because the implementation doesn't notice
there's more than one diagnostic per pattern.

First, `CHECK-LABEL` violates the assumption because `CHECK-LABEL`
tries to match twice, and other directives can match in between:

```
$ cat check
CHECK: foobar
CHECK-LABEL: foobar

$ FileCheck -vv check < input |& tail -8
<<<<<<
           1: text
           2: foobar
label:2'0     ^~~~~~
check:1       ^~~~~~
label:2'1           X error: no match found
           3: text
>>>>>>
```

Second, `--implicit-check-not` is obviously processed many times among
other directives:

```
$ cat check
CHECK: foo
CHECK: foo

$ FileCheck -vv -dump-input=always -implicit-check-not=foo \
            check < input |& tail -16
<<<<<<
            1: text
not:imp1'0     X~~~~
            2: foo
check:1        ^~~
not:imp1'1        X
            3: text
not:imp1'1     ~~~~~
            4: foo
check:2        ^~~
not:imp1'2        X
            5: text
not:imp1'2     ~~~~~
            6:
eof:2          ^
>>>>>>
```

Reviewed By: thopre, jhenderson

Differential Revision: https://reviews.llvm.org/D97813
2021-03-27 10:36:21 -04:00
Giorgis Georgakoudis 8bc2c662d9 [Utils] Add prefix parameter in update test checks to avoid FileCheck conflicts
IR values convert to check prefix FileCheck variables for IR checks. For example, nameless values, e.g., %0, convert to check prefix TMP FileCheck variables, e.g., [[TMP0:%.*]]. This check prefix may clash with named values that have the same name and that causes auto-generated tests to fail. Currently a warning is emitted to change the names of the IR values but this is not always possible, if for example they are generated by clang. Manual intervention to fix the FileCheck variable names is too tedious. This patch add a parameter to prefix conflicting FileCheck variable names with a user-provided string to automate the process.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D99415
2021-03-26 11:49:42 -07:00
Abhina Sreeskantharajan c83cd8feef [NFC] Reordering parameters in getFile and getFileOrSTDIN
In future patches I will be setting the IsText parameter frequently so I will refactor the args to be in the following order. I have removed the FileSize parameter because it is never used.

```
  static ErrorOr<std::unique_ptr<MemoryBuffer>>
  getFile(const Twine &Filename, bool IsText = false,
          bool RequiresNullTerminator = true, bool IsVolatile = false);

  static ErrorOr<std::unique_ptr<MemoryBuffer>>
  getFileOrSTDIN(const Twine &Filename, bool IsText = false,
                 bool RequiresNullTerminator = true);

 static ErrorOr<std::unique_ptr<MB>>
 getFileAux(const Twine &Filename, uint64_t MapSize, uint64_t Offset,
            bool IsText, bool RequiresNullTerminator, bool IsVolatile);

  static ErrorOr<std::unique_ptr<WritableMemoryBuffer>>
  getFile(const Twine &Filename, bool IsVolatile = false);
```

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D99182
2021-03-25 09:47:49 -04:00
Giorgis Georgakoudis 7ad55a3df5 [Utils][NFC] Fix regex substitution for update test checks
Relates to: https://reviews.llvm.org/D97107
2021-03-24 17:47:33 -07:00
LLVM GN Syncbot ac6572a5c8 [gn build] Port 5fbe1fdf17 2021-03-24 19:01:21 +00:00
LLVM GN Syncbot f6259efee7 [gn build] Port 5fd001a5ff 2021-03-24 17:33:50 +00:00
Martin Storsjö feff05d135 [lit] Fix check-lit hanging on Windows due to a division by zero exception 2021-03-24 19:28:33 +02:00
Thomas Preud'homme 7dd90da79f [UpdateTestChecks] Fix typo & copy/paste in comments 2021-03-24 16:11:36 +00:00
Nico Weber 82fa17aad1 [gn build] (manually) port 301d9261b7
This reverts commit 50fd426fd8
and tweaks things for the reland: SystemZAsmLexer is now
SystemZAsmLexerTests.
2021-03-24 10:44:00 -04:00
Nico Weber 1ad9c95a45 [gn build] port 1d8fc086ae 2021-03-24 08:29:34 -04:00
Rafael Auler 53196387c2 Add register size info back to MCRegisterClass
This patch addresses the removal of register size information done in
commit c8b782c.

Without this change, there is no viable option to get register size
information outside libTarget. We need this information to run
analysis that know the register size from the MC layer, used by
BOLT.

Discussion D50285 and D47199.

Reviewed By: kparzysz

Differential Revision: https://reviews.llvm.org/D97891
2021-03-23 15:04:44 -07:00
Nico Weber ed0558a09d [gn build] (manually) port d709dcc090 2021-03-23 10:13:14 -04:00
Valentin Clement d709dcc090 [openacc][openmp] Reduce number of generated file and prefer inclusion of .inc
Follow up from D92955 and D83636. This patch makes the base cpp files
OMP.cpp and ACC.cpp normal files and they now include the XXX.inc file
generated by tablegen. This reduces the number of file generated by the
DirectiveEmitter backend and makes it closer to the proposal in D83636.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D93560
2021-03-23 09:16:53 -04:00
LLVM GN Syncbot 308d40fe66 [gn build] Port 274907c0a4 2021-03-23 13:01:57 +00:00
Abhina Sreeskantharajan a234d03198 [NFC] Formatting changes
This patch addresses some formatting changes from the comments in https://reviews.llvm.org/D97785.

Reviewed By: anirudhp

Differential Revision: https://reviews.llvm.org/D99072
2021-03-23 07:17:54 -04:00
Roman Lebedev 962339a5ec
[lit] Reliable progress indicator and ETA
Quality of progress bar and ETA in lit has always bothered me.

For example, given `./bin/llvm-lit /repositories/llvm-project/clang/test/CodeGen* -sv`
at 1%, it says it will take 10 more minutes,
at 25%, it says it will take 1.25 more minutes,
at 50%, it says it will take 30 more seconds,
and in the end finishes with `Testing Time: 39.49s`. That's rather wildly unprecise.

Currently, it assumes that every single test will take the same amount of time to run on average.
This is is a somewhat reasonable approximation overall, but it is quite clearly imprecise,
especially in the beginning.

But, we can do better now, after D98179! We now know how long the tests took to run last time.
So we can build a better ETA predictor, by accumulating the time spent already,
the time that will be spent on the tests for which we know the previous time,
and for the test for which we don't have previous time, again use the average time
over the tests for which we know current or previous run time.
It would be better to use median, but i'm wary of the cost that may incur.

Now, on **first** run of `./bin/llvm-lit /repositories/llvm-project/clang/test/CodeGen* -sv`
at 10%, it says it will take 30 seconds,
at 25%, it says it will take 50 more seconds,
at 50%, it says it will take 27 more seconds,
and in the end finishes with `Testing Time: 41.64s`. That's pretty reasonable.

And on second run of `./bin/llvm-lit /repositories/llvm-project/clang/test/CodeGen* -sv`
at 1%, it says it will take 1 minutes,
at 25%, it says it will take 30 more seconds,
at 50%, it says it will take 19 more seconds,
and in the end finishes with `Testing Time: 39.49s`. That's amazing i think!

I think people will love this :)

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D99073
2021-03-23 12:16:19 +03:00
Serge Pavlov cf0f2884a1 [TableGen] Tiny enhancement
Differential Revision: https://reviews.llvm.org/D99057
2021-03-23 12:49:05 +07:00
Serge Pavlov 61fa35c3f7 [TableGen] Allow BitsInit to init integer in pseudo expansion
Differential Revision: https://reviews.llvm.org/D99057
2021-03-23 11:50:55 +07:00
Gulfem Savrun Yeniceri e3a6d70c68 Revert "[Passes] Add relative lookup table converter pass"
This reverts commit 78a65cd945 which
caused buildbot failures.
2021-03-23 00:43:16 +00:00
Nico Weber d39d526924 [gn build] fix typo in 78a65cd945 2021-03-22 18:38:17 -04:00
Gulfem Savrun Yeniceri 78a65cd945 [Passes] Add relative lookup table converter pass
Lookup tables generate non PIC-friendly code, which requires dynamic relocation as described in:
https://bugs.llvm.org/show_bug.cgi?id=45244

This patch adds a new pass that converts lookup tables to relative lookup tables to make them PIC-friendly.

Differential Revision: https://reviews.llvm.org/D94355
2021-03-22 22:09:02 +00:00
Philip Reames 6b04ace4ad Fix obvious breakage of update_analysis_test_checks.py from 1ce846b 2021-03-22 11:06:30 -07:00
LLVM GN Syncbot ce04af87ca [gn build] Port 5a87f81fe9 2021-03-22 17:10:11 +00:00
Roman Lebedev 233db43967
[lit] Do not forget test times for tests that weren't executed
Even though we have read the times before,
we intentionally forget about it for performance reasons.
But that means we also forget all the times for the tests
that weren't executed this time. This is mildly inconvenient.

So, when recording the new times, first re-read the old times,
and update times for the tests that were executed,
thus preserving all original times, too.
2021-03-22 15:26:00 +03:00
Roman Lebedev 0088164477
[NFC][lit] Extract 'test time' reading/writing into standalone functions
Simply refactor code into reusable functions,
to allow read_test_times() to be reused later.
2021-03-22 15:25:32 +03:00
Roman Lebedev b32fe2b514
[NFC][lit] Add a test showing that timing data for tests not executed is lost
I.e. when you first run lit on a directory, and then on a single test,
the timing knowledge about anything else other than that single test
is lost. This isn't right.
2021-03-22 15:25:32 +03:00
Roman Lebedev ef4b3a4571
[NFCI][lit] Unbreak more lit self-tests after D98179
All of these depend on the order of tests, so if one runs them twice,
the tests within them will naturally be reordered
using the previous run times, which breaks them.
2021-03-22 15:25:32 +03:00
Roman Lebedev aae10a94ff
[NFC][lit] discovery: find_tests_for_inputs: avoid py warning when no suites found
If lit was run on a directory that contained no suites,
then naturally suite[0] will not be there,
and that line would cause python warnings.

So just predicate it with a check that it is there in the first place.
2021-03-22 15:25:32 +03:00
David Zarzycki 5cbe2279f7 [lit] Sort testing summary output
As fallout from from the record-and-reorder work, people asked that the
summary output be sorted to aid diffing.
2021-03-20 07:52:08 -04:00
Carl Ritson fe5f4c397f [AMDGPU] Rename SIInsertSkips Pass
Pass no longer handles skips.  Pass now removes unnecessary
unconditional branches and lowers early termination branches.
Hence rename to SILateBranchLowering.

Move code to handle returns to epilog from SIPreEmitPeephole
into SILateBranchLowering. This means SIPreEmitPeephole only
contains optional optimisations, and all required transforms
are in SILateBranchLowering.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D98915
2021-03-20 11:48:04 +09:00
Carl Ritson 5df2af8b0e [AMDGPU] Merge SIRemoveShortExecBranches into SIPreEmitPeephole
SIRemoveShortExecBranches is an optimisation so fits well in the
context of SIPreEmitPeephole.

Test changes relate to early termination from kills which have now
been lowered prior to considering branches for removal.
As these use s_cbranch the execz skips are now retained instead.
Currently either behaviour is valid as kill with EXEC=0 is a nop;
however, if early termination is used differently in future then
the new behaviour is the correct one.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D98917
2021-03-20 11:26:42 +09:00
Senran Zhang bcb34a5387 [Utils][vim] Highlight `poison` keyword
Reviewed By: awarzynski, MaskRay

Differential Revision: https://reviews.llvm.org/D98927
2021-03-19 19:09:11 -07:00
Peter Collingbourne eef8b74ef5 gn build: Unbreak Android cross-compilation.
- D96404 defaulted to libunwind which isn't provided by NDK r21
  (or r22), so specify -rtlib=libgcc on non-arm32.
- D97993 means that we need to use --gcc-toolchain instead of -B
  to let the driver find libgcc.
2021-03-19 16:28:24 -07:00
Abhina Sreeskantharajan 4f750f6ebc [SystemZ][z/OS] Distinguish between text and binary files on z/OS
This patch consists of the initial changes to help distinguish between text and binary content correctly on z/OS. I would like to get feedback from Windows users on setting OF_None for all ToolOutputFiles. This seems to have been done as an optimization to prevent CRLF translation on Windows in the past.

Reviewed By: zibi

Differential Revision: https://reviews.llvm.org/D97785
2021-03-19 08:09:57 -04:00
Martin Storsjö f3dd783b23 Revert "[lit] Handle plain negations directly in the internal shell"
This reverts commit d09adfd399.

That commit caused failures in
clang-tidy/infrastructure/validate-check-names.cpp on windows
buildbots.

That change exposed a surprising issue, not directly related to
this change in itself, but in how TestRunner quotes command line
arguments that later are going to be interpreted by a msys based
tool (like grep.exe, when provided by Git for Windows). This
worked accidentally before, when grep was invoked via not.exe
which took a more conservative approach to windows argument quoting.
2021-03-19 12:33:12 +02:00
Martin Storsjö 9de63b2e05 [lit] Pass the USERPROFILE variable through on Windows
When running in a Windows Container, the Git for Windows Unix tools
(C:\Program Files\Git\usr\bin) just hang if this variable isn't
passed through.

Currently, running the LLVM/clang tests in a Windows Container fails
if that directory is added to the path, but succeeds after this change.
(After this change, the previously used GnuWin tools can be left out
entirely, too, as lit automatically picks up the Git for Windows tools
if necessary.)

Differential Revision: https://reviews.llvm.org/D98858
2021-03-19 09:38:19 +02:00
Martin Storsjö d09adfd399 [lit] Handle plain negations directly in the internal shell
Keep running "not --crash" via the external "not" executable, but
for plain negations, and for cases that use the shell "!" operator,
just skip that argument and invert the return code.

The libcxx tests only use the shell operator "!" for negations,
never the "not" executable, because libcxx tests can be run without
having a fully built llvm tree available providing the "not"
executable.

This allows using the internal shell for libcxx tests.

Differential Revision: https://reviews.llvm.org/D98859
2021-03-19 09:33:26 +02:00
LLVM GN Syncbot 6333ee2184 [gn build] Port ed8bff13dc 2021-03-18 14:39:37 +00:00
Joel E. Denny dd59c1324d [FileCheck] Fix numeric error propagation
A more general name might be match-time error propagation.  That is,
it's conceivable we'll one day have non-numeric errors that require
the handling fixed by this patch.

Without this patch, FileCheck behaves as follows:

```
$ cat check
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]

$ FileCheck -vv -dump-input=never check < input
check:1:54: remark: implicit EOF: expected string found in input
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]
                                                     ^
<stdin>:2:1: note: found here

^
check:1:15: error: unable to substitute variable or numeric expression: overflow error
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]
              ^
$ echo $?
0
```

Notice that the exit status is 0 even though there's an error.
Moreover, FileCheck doesn't print the error diagnostic unless both
`-dump-input=never` and `-vv` are specified.

The same problem occurs when `CHECK-NOT` does have a match but a
capture fails due to overflow: exit status is 0, and no diagnostic is
printed unless both `-dump-input=never` and `-vv` are specified.  The
usefulness of capturing from `CHECK-NOT` is questionable, but this
case should certainly produce an error.

With this patch, FileCheck always includes the error diagnostic and
has non-zero exit status for the above examples.  It's conceivable
that this change will cause some existing tests to fail, but my
assumption is that they should fail.  Moreover, with nearly every
project enabled, this patch didn't produce additional `check-all`
failures for me.

This patch also extends input dumps to include such numeric error
diagnostics for both expected and excluded patterns.

As noted in fixmes in some of the tests added by this patch, this
patch worsens an existing issue with redundant diagnostics.  I'll fix
that bug in a subsequent patch.

Reviewed By: thopre, jhenderson

Differential Revision: https://reviews.llvm.org/D98086
2021-03-17 19:25:41 -04:00
David Zarzycki 2b20df2d79 [lit] Harmonize test timing data between Unix and Windows
The "path" recorded for timing purposes is only used as a key into a dictionary. It is never used as an actual path to a filesystem API, therefore we should use '/' as the canonical separator so that Unix and Windows machines can share timing data. This also ensures that the lit testing works across platforms.

Reviewed By: jhenderson, jmorse

Differential Revision: https://reviews.llvm.org/D98767
2021-03-17 07:42:40 -04:00
Jay Foad b8bf94df25 [TableGen] Fix excessive compile time issue in FixedLenDecoderEmitter
This patch reduces the time taken for clang to compile the generated
disassembler for an out-of-tree target with InsnType bigger than 64 bits
from 4m30s to 48s.

D67686 did a similar thing for CodeEmitterGen.

The idea is to tweak the API of the APInt-like InsnType class so that
we don't need so many temporary InsnTypes. This takes advantage of the
rule stated in D52100 that currently "no string of bits extracted
from the encoding may exceeed 64-bits", so we can use uint64_t for some
temporaries.

D52100 goes on to say that "fields are still permitted to exceed 64-bits
so long as they aren't one contiguous string of bits". This patch breaks
that by always using a "uint64_t tmp" in the generated decodeToMCInst,
but it should be easy to fix in FilterChooser::emitBinaryParser by
choosing to use a different type of tmp based on the known total field
width.

Differential Revision: https://reviews.llvm.org/D98046
2021-03-17 09:28:50 +00:00
Praveen 1d7960a601 [Flang][OpenMP][OpenACC] Add function for mapping parser clause classes with the corresponding clause kind.
1. Generate the mapping for clauses between the parser class and the
   corresponding clause kind for OpenMP and OpenACC using tablegen.

2. Add a common function to get the OmpObjectList from the OpenMP
   clauses to avoid repetition of code.

Reviewed by: Kiranchandramohan @kiranchandramohan , Valentin Clement @clementval

Differential Revision: https://reviews.llvm.org/D98603
2021-03-17 12:20:43 +05:30
Giorgis Georgakoudis a80a33e8b5 [Utils] Support lit-like substitutions in update_cc_test_checks
Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D98712
2021-03-16 10:36:22 -07:00
Jeremy Morse 264f101ae6 Tweak spelling of system-windows UNSUPPORTED line 2021-03-16 16:52:00 +00:00
David Zarzycki 61ca706461 [lit testing] Mark reorder.py as unavailable on Windows
The test file has embedded slashes. This is fine for normal users that
are just recording and reordering paths, but not great when the trace
data is committed back to a repository that should work on both Unix and
Windows.
2021-03-16 10:54:06 -04:00
LLVM GN Syncbot 70aa319ee7 [gn build] Port 9a5af541ee 2021-03-16 14:03:53 +00:00
David Zarzycki 49d0e115d5 [lit testing] Fix Windows reliability? 2021-03-16 09:11:41 -04:00
Bjorn Pettersson 5ac3b37599 [TableGen/GlobalISel] Emit MI_predicate custom code for PatFrags (not only PatFrag)
When GlobalISelEmitter::emitCxxPredicateFns emitted code for MI
predicates it used "PatFrag" when searching for definitions. With
this patch it will search for all "PatFrags" instead. Since PatFrag
derives from PatFrags the difference is that we now include all
definitions using PatFrags directly as well. Thus making it possible
to use GISelPredicateCode together with a PatFrags definition.

It might be noted that the matcher code was emitted also for PatFrags
in the past. But then one ended up with errors since the custom code
in testMIPredicate_MI was missing.

Differential Revision: https://reviews.llvm.org/D98486
2021-03-16 12:44:09 +01:00
David Zarzycki 1d297f9064 [lit] Sort test start times based on prior test timing data
Lit as it exists today has three hacks that allow users to run tests earlier:

1) An entire test suite can set the `is_early` boolean.
2) A very recently introduced "early_tests" feature.
3) The `--incremental` flag forces failing tests to run first.

All of these approaches have problems.

1) The `is_early` feature was until very recently undocumented. Nevertheless it still lacks testing and is a imprecise way of optimizing test starting times.
2) The `early_tests` feature requires manual updates and doesn't scale.
3) `--incremental` is undocumented, untested, and it requires modifying the *source* file system by "touching" the file. This "touch" based approach is arguably a hack because it confuses editors (because it looks like the test was modified behind the back of the editor) and "touching" the test source file doesn't work if the test suite is read only from the perspective of `lit` (via advanced filesystem/build tricks).

This patch attempts to simplify and address all of the above problems.

This patch formalizes, documents, tests, and defaults lit to recording the execution time of tests and then reordering all tests during the next execution. By reordering the tests, high core count machines run faster, sometimes significantly so.

This patch also always runs failing tests first, which is a positive user experience win for those that didn't know about the hidden `--incremental` flag.

Finally, if users want, they can _optionally_ commit the test timing data (or a subset thereof) back to the repository to accelerate bots and first-time runs of the test suite.

Reviewed By: jhenderson, yln

Differential Revision: https://reviews.llvm.org/D98179
2021-03-16 05:23:04 -04:00
LLVM GN Syncbot 6547dcb4f3 [gn build] Port 4f198b0c27 2021-03-16 02:41:16 +00:00
LLVM GN Syncbot 2ef6ee1978 [gn build] Port ecf6466f01 2021-03-15 23:01:19 +00:00
Nico Weber 264ff539f3 [gn build] merge af2796c76d a bit more
The default is fine on non-Win, but on Win this needs an explicit
setting now that lit no longer has the right default.
2021-03-15 18:20:54 -04:00
Nico Weber 01d648a69b [gn build] merge 9bcf0eff99 2021-03-15 17:05:05 -04:00
Nico Weber efbaf4030b [gn build] kind of merge af2796c76d
Good enough for now. If we need more, we'll do the usual
platform-dependent hardcoding that in practice works for everything else
too.
2021-03-15 17:01:00 -04:00
Markus Böck 68e4084bf6 Revert line accidentally included in af2796c76d 2021-03-15 21:03:46 +01:00
Markus Böck af2796c76d [test] Add ability to get error messages from CMake for errc substitution
Visual Studios implementation of the C++ Standard Library does not use strerror to produce a message for std::error_code unlike other standard libraries such as libstdc++ or libc++ that might be used.

This patch adds a cmake script that through running a C++ program gets the error messages for the POSIX error codes and passes them onto lit through an optional config parameter.

If the config parameter is not set, or getting the messages failed, due to say a cross compiling configuration without an emulator, it will fall back to using pythons strerror functions.

Differential Revision: https://reviews.llvm.org/D98278
2021-03-15 20:56:08 +01:00
Nico Weber a431268668 [gn build] (semi-manually) port b136a74efc 2021-03-15 12:51:12 -04:00
LLVM GN Syncbot fd9604c815 [gn build] Port 13e49dcee4 2021-03-15 15:24:41 +00:00
Stephen Kelly 19740652c4 [AST] Add generator for source location introspection
Generate a json file containing descriptions of AST classes and their
public accessors which return SourceLocation or SourceRange.

Use the JSON file to generate a C++ API and implementation for accessing
the source locations and method names for accessing them for a given AST
node.

This new API can be used to implement 'srcloc' output in clang-query:

  http://ce.steveire.com/z/m_kTIo

The JSON file can also be used to generate bindings for other languages,
such as Python and Javascript:

  https://steveire.wordpress.com/2019/04/30/the-future-of-ast-matching

In this first version of this feature, only the accessors for Stmt
classes are generated, not Decls, TypeLocs etc.  Those can be added
after this change is reviewed, as this change is mostly about
infrastructure of these code generators.

Also in this version, the platforms/cmake configurations are excluded as
much as possible so that support can be added iteratively.  Currently a
break on any platform causes a revert of the entire feature.  This way,
the `OR WIN32` can be removed in a future commit and if it breaks the
buildbots, only that commit gets reverted, making the entire process
easier to manage.

Differential Revision: https://reviews.llvm.org/D93164
2021-03-15 10:52:44 +00:00
Stephen Kelly 6e303a982d Revert "[AST] Add generator for source location introspection"
This reverts commit 91abaa1f8d.
2021-03-15 01:16:10 +00:00
Stephen Kelly 91abaa1f8d [AST] Add generator for source location introspection
Generate a json file containing descriptions of AST classes and their
public accessors which return SourceLocation or SourceRange.

Use the JSON file to generate a C++ API and implementation for accessing
the source locations and method names for accessing them for a given AST
node.

This new API can be used to implement 'srcloc' output in clang-query:

  http://ce.steveire.com/z/m_kTIo

The JSON file can also be used to generate bindings for other languages,
such as Python and Javascript:

  https://steveire.wordpress.com/2019/04/30/the-future-of-ast-matching

In this first version of this feature, only the accessors for Stmt
classes are generated, not Decls, TypeLocs etc.  Those can be added
after this change is reviewed, as this change is mostly about
infrastructure of these code generators.

Also in this version, the platforms/cmake configurations are excluded as
much as possible so that support can be added iteratively.  Currently a
break on any platform causes a revert of the entire feature.  This way,
the `OR WIN32` can be removed in a future commit and if it breaks the
buildbots, only that commit gets reverted, making the entire process
easier to manage.

Differential Revision: https://reviews.llvm.org/D93164
2021-03-15 00:00:29 +00:00
Stephen Kelly e312b4b6c7 Revert "[AST] Add generator for source location introspection"
This reverts commit 477e4b9746.
2021-03-14 22:51:45 +00:00
Stephen Kelly 477e4b9746 [AST] Add generator for source location introspection
Generate a json file containing descriptions of AST classes and their
public accessors which return SourceLocation or SourceRange.

Use the JSON file to generate a C++ API and implementation for accessing
the source locations and method names for accessing them for a given AST
node.

This new API can be used to implement 'srcloc' output in clang-query:

  http://ce.steveire.com/z/m_kTIo

The JSON file can also be used to generate bindings for other languages,
such as Python and Javascript:

  https://steveire.wordpress.com/2019/04/30/the-future-of-ast-matching

In this first version of this feature, only the accessors for Stmt
classes are generated, not Decls, TypeLocs etc.  Those can be added
after this change is reviewed, as this change is mostly about
infrastructure of these code generators.

Also in this version, the platforms/cmake configurations are excluded as
much as possible so that support can be added iteratively.  Currently a
break on any platform causes a revert of the entire feature.  This way,
the `OR WIN32` can be removed in a future commit and if it breaks the
buildbots, only that commit gets reverted, making the entire process
easier to manage.

Differential Revision: https://reviews.llvm.org/D93164
2021-03-14 22:32:42 +00:00
Ricky Taylor 6475ddb1d8 [M68k] Fix extract-section.py under Python 3
read_raw_stdin() was opening a file in binary mode, but Popen
was being told to use text mode (universal_newlines). This is
benign on Python 2 but an error on Python 3.

Differential Revision: https://reviews.llvm.org/D98428
2021-03-14 11:36:57 -07:00
Nico Weber 237526319c Revert "[gn build] (manually) kind of merge d627a27d26"
This reverts commit 5123327eda.
d627a27d26 was reverted in e0f70a8a97.
2021-03-14 12:18:22 -04:00
Nico Weber 5123327eda [gn build] (manually) kind of merge d627a27d26
This only merges the no-op generator part for now.
2021-03-14 09:19:44 -04:00
Giorgis Georgakoudis 1ce846be04 Replace func name with regex for update test scripts
The patch adds an argument to update test scripts, such as update_cc_test_checks, for replacing a function name matching a regex. This functionality is needed to match generated function signatures that include file hashes. Example:

The function signature for the following function:

`__omp_offloading_50_b84c41e__Z9ftemplateIiET_i_l30_worker`

with `--replace-function-regex "__omp_offloading_[0-9]+_[a-z0-9]+_(.*)"` will become:

`CHECK-LABEL: @{{__omp_offloading_[0-9]+_[a-z0-9]+__Z9ftemplateIiET_i_l30_worker}}(`

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97107
2021-03-12 17:37:09 -08:00
Giorgis Georgakoudis 9f9a4dfda7 Revert "Replace func name with regex for update test scripts"
This reverts commit 5eaf70afb5.
2021-03-12 17:20:00 -08:00
Giorgis Georgakoudis 5eaf70afb5 Replace func name with regex for update test scripts
The patch adds an argument to update test scripts, such as update_cc_test_checks, for replacing a function name matching a regex. This functionality is needed to match generated function signatures that include file hashes. Example:

The function signature for the following function:

`__omp_offloading_50_b84c41e__Z9ftemplateIiET_i_l30_worker`

with `--replace-function-regex "__omp_offloading_[0-9]+_[a-z0-9]+_(.*)"` will become:

`CHECK-LABEL: @{{__omp_offloading_[0-9]+_[a-z0-9]+__Z9ftemplateIiET_i_l30_worker}}(`

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97107
2021-03-12 17:00:42 -08:00
Nico Weber 50fd426fd8 Revert "[gn build] (manually) port bcdd40f802a5"
This reverts commit 0bd9d9aa3c.
bcdd40f802 was reverted in 4f9cc1512d
2021-03-12 15:04:20 -05:00
Nico Weber 0bd9d9aa3c [gn build] (manually) port bcdd40f802 2021-03-12 12:15:52 -05:00
Nico Weber 81d4e9c146 [lit] rewrap a few lines to 80 columns
No behavior change.
2021-03-12 11:55:00 -05:00
Johannes Doerfert cd1bd6e587 [Utils] Check for more global information in update_test_checks
This allows to check for various globals (metadata/attributes/...) and
also resolves problems with globals (metadata/attributes/...) being
reused across different prefixes.

Reviewed By: sstefan1

Differential Revision: https://reviews.llvm.org/D94741
2021-03-11 23:31:16 -06:00
LLVM GN Syncbot 0cb0c6beda [gn build] Port 5433a79176 2021-03-11 18:35:32 +00:00
Djordje Todorovic 9f41c03f82 [Debugify][OriginalDIMode] Export the report into JSON file
By using the original-di check with debugify in the combination with
the llvm/utils/llvm-original-di-preservation.py it becomes very user
friendly tool. An example of the HTML page with the issues
related to debug info can be found at [0].

[0] https://djolertrk.github.io/di-checker-html-report-example/

Differential Revision: https://reviews.llvm.org/D82546
2021-03-11 01:11:13 -08:00
Nico Weber cb17f060e2 [gn build] (manually) Port d6a0560bf2 2021-03-10 21:56:59 -05:00
LLVM GN Syncbot af4ae18319 [gn build] Port 4f16e177e1 2021-03-10 23:36:48 +00:00
Giorgis Georgakoudis ecf68972fd Revert "Replace func name with regex in update_cc_test_checks"
This reverts commit bf58d6a1f9.

Breaks tests, fix
2021-03-10 15:05:35 -08:00
Giorgis Georgakoudis bf58d6a1f9 Replace func name with regex in update_cc_test_checks
The patch adds an argument to update_cc_test_checks for replacing a function name matching a regex. This functionality is needed to match generated function signatures that include file hashes. Example:

The function signature for the following function:

`__omp_offloading_50_b84c41e__Z9ftemplateIiET_i_l30_worker`

with `--replace-function-regex "__omp_offloading_[0-9]+_[a-z0-9]+_(.*)"` will become:

`CHECK-LABEL: @{{__omp_offloading_[0-9]+_[a-z0-9]+__Z9ftemplateIiET_i_l30_worker}}(`

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97107
2021-03-10 12:57:35 -08:00
Giorgis Georgakoudis a2abe2259c Run non-filechecked commands in update_cc_test_checks.py
Some tests in clang require running non-filechecked commands to generate the actual filecheck input. For example, tests for openmp offloading require generating the host bc without any checking, before running the clang command to actually generate the filechecked IR of the target device. This patch enables `update_cc_test_checks.py` to run non-filechecked run lines in-place.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97068
2021-03-10 12:25:35 -08:00
Sriraman Tallam 0ba1ebcbb7 Remove original implementation of UniqueInternalLinkageNames pass.
D96109 was recently submitted which contains the refactored implementation of
-funique-internal-linakge-names by adding the unique suffixes in clang rather
than as an LLVM pass. Deleting the former implementation in this change.

Differential Revision: https://reviews.llvm.org/D98234
2021-03-10 11:57:40 -08:00
Craig Topper 351844edf1 [RISCV] Add support for VECTOR_REVERSE for scalable vector types.
I've left mask registers to a future patch as we'll need
to convert them to full vectors, shuffle, and then truncate.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D97609
2021-03-09 10:03:45 -08:00
Liu, Chen3 3618b21298 [X86][NFC] Adding one flag to imply whether the instruction should check the predicate when compress EVEX instructions to VEX encoding.
Some EVEX instructions should check the predicates when compress to VEX
encoding. For example, avx512vnni instructions. This is because avx512vnni
doesn't mean that avxvnni is supported on the target.
This patch moving the manually added check to .inc that generated by tablegen.

Differential Revision: https://reviews.llvm.org/D98011
2021-03-09 19:58:01 +08:00
Jon Roelofs a24644bb1c Revert "Run non-filechecked commands in update_cc_test_checks.py"
This reverts commit 60d4c73b30.

The new test is broken on macos hosts. Discussion here:
https://reviews.llvm.org/D97068#2611269
https://reviews.llvm.org/D97068#2612675

... revert to green.
2021-03-08 17:26:24 -08:00
LLVM GN Syncbot 84fa3497c8 [gn build] Port 5c26be214d 2021-03-08 21:01:52 +00:00
LLVM GN Syncbot e1928f0e92 [gn build] Port 5eb7a5814a 2021-03-08 20:33:54 +00:00
LLVM GN Syncbot b790a15e4b [gn build] Port 5509748f2c 2021-03-08 20:33:53 +00:00
LLVM GN Syncbot bb1fe3f943 [gn build] Port 503343191e 2021-03-08 20:33:53 +00:00
Min-Yih Hsu c23a780c30 [M68k][test](6/8) Add all of the tests
And a small utilities -- extract-section.py -- that helps extracting
specific object file section and printing in textual format. This
utility is just a workaround for tests inside `Encoding`. Hopefully in
the future we can replace dependencies in those tests with existing tools
(e.g. llvm-readobj). Please refer to this bug for more context:
https://bugs.llvm.org/show_bug.cgi?id=49245

Note that since we don't have AsmParser for now, we are testing the MC
part using MIR as input and put those tests under the `Encoding` folder.
In the future when AsmParser (and disassembler) is finished, those tests
will be moved to `test/MC/M68k`.

Authors: myhsu, m4yers, glaubitz

Differential Revision: https://reviews.llvm.org/D88392
2021-03-08 12:30:57 -08:00
Min-Yih Hsu 503343191e [M68k][TableGen](1/8) TableGen related changes
- Add a new TableGen backend: CodeBeads
 - Add support to generate logical operand information

For the first item, it is currently a workaround of M68k's (complex)
instruction encoding. A typical architecture, especially CISC one like
X86, normally uses `MCInstrDesc::TSFlags` to carry instruction encoding
info. However, at the early days of M68k backend development, we found
it difficult to fit every possible encoding into the 64-bit
`MCInstrDesc::TSFlags`. Therefore CodeBeads was invented to provide
an alternative, arbitrary length container for instruciton encoding
info. However, in the long term we incline not to use a new TG
backend for less common pattern like what we encountered in M68k. A bug
has been created to host to discussion on migrating from CodeBeads to
more concise solution: https://bugs.llvm.org/show_bug.cgi?id=48792

The second item was also served for similar purpose. It created utility
functions that tell you the index of a `MachineOperand` in a
`MachineInst` given a logical operand index. In normal cases a logical
operand is the same as `MachineOperand`, but for operands using complex
addressing mode a logical operand might be consisting of multiple
`MachineOperand`. The TableGen-ed `getLogicalOperandIdx`, for instance,
can give you the mapping between these two concepts. Nevertheless, we
hope to remove this feature in the future if possible. Since it's not
really useful for the targets supported by LLVM now either.

Authors: myhsu, m4yers, glaubitz

Differential Revision: https://reviews.llvm.org/D88385
2021-03-08 12:30:56 -08:00
Nico Weber 08c709a266 [gn build] (manually) port ebe6161c54 2021-03-08 14:56:41 -05:00
Giorgis Georgakoudis 60d4c73b30 Run non-filechecked commands in update_cc_test_checks.py
Some tests in clang require running non-filechecked commands to generate the actual filecheck input. For example, tests for openmp offloading require generating the host bc without any checking, before running the clang command to actually generate the filechecked IR of the target device. This patch enables `update_cc_test_checks.py` to run non-filechecked run lines in-place.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D97068
2021-03-08 07:18:01 -08:00
Jessica Clarke 5d6e0e474e [benchmark] Replace references to M680x0 with M68k
The former was the old unusual name of the out-of-tree backend but it
was renamed to M68k during the code review process to conform with how
almost everything refers to the Motorola 68000 family of processors.
Thus, update the comments to avoid confusion when the backend lands.
2021-03-06 01:04:36 +00:00
Andrzej Warzynski 2da21a1bd4 [Utils] Add missing attributes in syntax files
Added the following attributes to all LLVM syntax files:
  * allocsize
  * cold
  * convergent
  * dereferenceable_or_null
  * hot
  * inaccessiblemem_or_argmemonly
  * inaccessiblememonly
  * inalloca
  * jumptable
  * nocallback
  * nocf_check
  * noduplicate
  * nofree
  * nomerge
  * noprofile
  * nosync
  * null_pointer_is_valid
  * optforfuzzing
  * preallocated
  * safestack
  * sanitize_hwaddress
  * sanitize_memtag
  * shadowcallstack
  * speculative_load_hardening
  * swifterror
  * syncscope
  * tailcc
  * willreturn

I generated that list by comparing:
  * Attributes.inc (generated from Attributes.td), and
  * the Vim syntax file: llvm/utils/vim/syntax/llvm.vim

My original intention was to focus on the Vim syntax file. Since other
syntax files are also out-of-date, I added these attributes (if missing)
to other files as well. Note that in the other sytnax files (i.e. for
Emacs, VScode and Kate), there will be other attributes missing too.

I've also sorted all attributes alphabetically. Otherwise it's really
hard to automate adding new attributes. And I think that it was the
original intent to keep all of them ordered alphabetically.

Differential Revision: https://reviews.llvm.org/D97627
2021-03-05 17:36:09 +00:00
Nico Weber 98c6d3194e [gn build] allow setting clang_base_path to a source-absolute path
With this, you can set `clang_base_path = "//out/gn1"` in `out/gn2/args.gn` and
the build in out/gn2 will use clang and lld from out/gn1.

Setting `clang_base_path` to an absolute path (with e.g.
`clang_base_path = getenv("HOME") + "/src/..."`) should behave as before.

Differential Revision: https://reviews.llvm.org/D97989
2021-03-05 12:13:51 -05:00
Abhina Sreeskantharajan c52fe0b021 [test] Use host platform specific error message substitution in lit tests
This patch uses the errno python library to print out the correct error messages instead of hardcoding the error message per platform.

Reviewed By: jhenderson, ASDenysPetrov

Differential Revision: https://reviews.llvm.org/D97472
2021-03-05 07:21:53 -05:00
LLVM GN Syncbot f456fd0ed8 [gn build] Port a60d06d8b7 2021-03-05 11:09:38 +00:00
Nico Weber ecdae5df7d [gn build] port b973e2e2f2 2021-03-04 18:41:04 -05:00
LLVM GN Syncbot c3960087f6 [gn build] Port 561abd83ff 2021-03-04 22:58:35 +00:00
LLVM GN Syncbot ba18a51c38 [gn build] Port d7834556b7 2021-03-04 21:34:02 +00:00
Nico Weber 4b192f8084 [gn build] port db06088d63 2021-03-04 16:33:24 -05:00
Jay Foad 594d0c3496 [TableGen] Fix warning when compiling generated MCCodeEmitter
This fixes an instance of:
warning: cast from 'const unsigned long *' to 'unsigned char *' drops const qualifier [-Wcast-qual]
when compiling the generated MCCodeEmitter for an out-of-tree target
that uses the optional support for instruction widths > 64 bits.

Differential Revision: https://reviews.llvm.org/D97942
2021-03-04 18:35:25 +00:00
Nico Weber 4c1bf9e0ee [gn build] port e9f9ec837d 2021-03-04 11:40:12 -05:00
LLVM GN Syncbot 635db3514b [gn build] Port d791695cb5 2021-03-04 11:17:51 +00:00
Andrew Savonichev d791695cb5 [MCA] Add support for in-order CPUs
This patch adds a pipeline to support in-order CPUs such as ARM
Cortex-A55.

In-order pipeline implements a simplified version of Dispatch,
Scheduler and Execute stages as a single stage. Entry and Retire
stages are common for both in-order and out-of-order pipelines.

Differential Revision: https://reviews.llvm.org/D94928
2021-03-04 14:08:19 +03:00
Stefan Gränitz e984c2b06f Revert "hack to unbreak check-llvm on win after D97335" in attempt for actual fix
This reverts commit 900f076113 and attempts an actual fix: All failing tests for llvm-jitlink use the `-noexec` flag. The inputs they operate on are not meant for execution on the host system. Looking e.g. at the MachO_test_harness_harnesss.s test, llvm-mc generates input machine code with "x86_64-apple-macosx10.9".

My previous attempt in bbdb4c8c9b disabled the debug support plugin for Windows targets, but what we would actually want is to disable it on Windows HOSTS.

With the new patch here, I don't do exactly that, but instead follow the approach for the EH frame plugin and include the `-noexec` flag in the condition. It should have the desired effect when it comes to the test suite. It appears a little workaround'ish, but should work reliably for now. I will discuss the issue with Lang and see if we can do better. Thanks @thakis again for the temporary fix.
2021-03-03 22:35:36 +01:00
Thomas Preud'homme 09c3573903 [FileCheck] Do not skip end of line in diagnostics
When commit da108b4ed4 introduced
the CHECK-NEXT directive, it added logic to skip to the next line when
printing a diagnostic if the current matching position is at the end of
a line. This was fine while FileCheck did not support regular expression
but since it does now it can be confusing when the pattern to match
starts with the expectation of a newline (e.g. CHECK-NEXT: {{\n}}foo).
It is also inconsistent with the column information in the diagnostic
which does point to the end of line.

This commit removes this logic altogether, such that failure to match
diagnostic for such cases would show the end of line and be consistent
with the column information. The commit also adapts all existing
testcases accordingly.

Note to reviewers: An alternative approach would be to restrict the code
to only skip to the next line if the first character of the pattern is
known not to match a whitespace-like character. This would respect the
original intent but keep the inconsistency in terms of column info and
requires more code. I've only chosen this current approach by laziness
and would be happy to restrict the logic instead.

Reviewed By: jdenny, jhenderson

Differential Revision: https://reviews.llvm.org/D93341
2021-03-03 08:20:39 +00:00
Wang, Pengfei fd79aa7294 [NFC] Add x86_amx and some missed half, bfloat keywords to llvm plugin syntaxes
Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D97444
2021-03-03 10:01:10 +08:00
Nico Weber 900f076113 hack to unbreak check-llvm on win after https://reviews.llvm.org/D97335
fix attempt http://reviews.llvm.org/rGbbdb4c8c9bcef0e didn't work

The problem is that the test tries to look up
llvm_orc_registerJITLoaderGDBWrapper from the llvm-jitlink.exe
executable, but the symbol wasn't exported. Just manually export it
for now. There's a FIXME with a suggestion for a real fix.
2021-03-02 18:10:28 -05:00
Amara Emerson 8a316045ed [AArch64][GlobalISel] Enable use of the optsize predicate in the selector.
To do this while supporting the existing functionality in SelectionDAG of using
PGO info, we add the ProfileSummaryInfo and LazyBlockFrequencyInfo analysis
dependencies to the instruction selector pass.

Then, use the predicate to generate constant pool loads for f32 materialization,
if we're targeting optsize/minsize.

Differential Revision: https://reviews.llvm.org/D97732
2021-03-02 12:55:51 -08:00
Nico Weber 253a6606fa [gn build] fix llvm-jitlink tests on linux after ef2389235c 2021-03-02 13:41:09 -05:00
Krzysztof Parzyszek d96b5e606a [TableGen] Add IntrNoMerge as intrinsic property
There is a function attribute 'nomerge' in addition to 'noduplicate'
and 'convergent'. Both 'noduplicate' and 'convergent' have corresponding
intrinsic properties. This patch adds an intrinsic property for the
'nomerge' attribute.

Differential Revision: https://reviews.llvm.org/D96364
2021-03-02 09:04:50 -08:00
Nico Weber 31b1e94a6e [gn build] (manually) port 99a6d003ed 2021-03-02 10:31:59 -05:00
Nico Weber 31d516f183 [gn build] Port f47ff8cff1 2021-03-02 10:31:59 -05:00