Commit Graph

9045 Commits

Author SHA1 Message Date
LLVM GN Syncbot a7e0d55de0 [gn build] Port d5c28c4094 2020-06-09 19:53:21 +00:00
Mehdi Amini d31c9e5a46 Change filecheck default to dump input on failure
Having the input dumped on failure seems like a better
default: I debugged FileCheck tests for a while without knowing
about this option, which really helps to understand failures.

Remove `-dump-input-on-failure` and the environment variable
FILECHECK_DUMP_INPUT_ON_FAILURE which are now obsolete.

Differential Revision: https://reviews.llvm.org/D81422
2020-06-09 18:57:46 +00:00
LLVM GN Syncbot 21d747184a [gn build] Port 9b02a9b401 2020-06-09 13:58:14 +00:00
LLVM GN Syncbot 3ea8a65da8 [gn build] Port 98db1f990f 2020-06-09 13:58:13 +00:00
LLVM GN Syncbot 115a1fff53 [gn build] Port 813734dad7 2020-06-09 13:58:13 +00:00
LLVM GN Syncbot 8e1d204344 [gn build] Port bb677cacc8 2020-06-08 19:44:56 +00:00
LLVM GN Syncbot ef5850a2de [gn build] Port 550b599523 2020-06-08 16:55:22 +00:00
Guillaume Chatelet 94b0c32a0b [Alignment][NFC] Migrate HandleByVal to Align
Summary: Note to downstream target maintainers: this might silently change the semantics of your code if you override `TargetLowering::HandleByVal` without marking it `override`.

This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: sdardis, hiraditya, jrtc27, atanasyan, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81365
2020-06-08 10:50:27 +00:00
Guillaume Chatelet 2aa483016d [Alignment][NFC] Migrate CallingConv tablegen code
Summary: This is a follow up on D81196, fixing one more call site.

Reviewers: courbet

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81268
2020-06-08 06:58:02 +00:00
LLVM GN Syncbot b264edcce8 [gn build] Port 8422bc9efc 2020-06-06 18:22:19 +00:00
LLVM GN Syncbot 473220c4df [gn build] Port 2920348063 2020-06-06 01:50:36 +00:00
LLVM GN Syncbot d81b76cfe6 [gn build] Port 1fa43e0b34 2020-06-06 00:47:43 +00:00
LLVM GN Syncbot 7e7ec2b325 [gn build] Port 8a8c6913a9 2020-06-05 19:48:20 +00:00
Nico Weber f029c165f9 [gn build] (manually) merge 5eedf07ab9 2020-06-05 14:39:04 -04:00
LLVM GN Syncbot e7cc6896f6 [gn build] Port 11d06b9511 2020-06-05 17:22:19 +00:00
Nico Weber 7928f2c177 [gn build] (manually) port a6fcf5ca03 2020-06-05 12:32:23 -04:00
Julian Lettner 99d6e05e71 [lit] Improve naming of test result categories
Improve consistency when printing test results:
Previously we were using different labels for group names (the header
for the list of, e.g., failing tests) and summary count lines.  For
example, "Failing Tests"/"Unexpected Failures".  This commit changes lit
to label things consistently.

Improve wording of labels:
When talking about individual test results, the first word in
"Unexpected Failures", "Expected Passes", and "Individual Timeouts" is
superfluous.  Some labels contain the word "Tests" and some don't.
Let's simplify the names.

Before:
```
Failing Tests (1):
  ...

Expected Passes    : 3
Unexpected Failures: 1
```

After:
```
Failed Tests (1):
  ...

Passed: 3
Failed: 1
```

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D77708
2020-06-05 08:14:42 -07:00
Guillaume Chatelet 80845db6a5 [Alignment][NFC] Migrate CallingConv tablegen code
Summary:
We first migrate the generated code, more patches to come.

This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81196
2020-06-05 13:33:34 +00:00
Daniel Grumberg ff0eec4c9e NFC: Formatting fix in TableGEn/OptParserEmitter.cpp 2020-06-05 10:51:10 +01:00
LLVM GN Syncbot 8b5ee3b9b6 [gn build] Port e53f558057 2020-06-04 17:56:21 +00:00
LLVM GN Syncbot 5c55033dce [gn build] Port c973ad1878 2020-06-04 17:56:21 +00:00
LLVM GN Syncbot 60c2fee426 [gn build] Port ba2a01645b 2020-06-04 17:56:20 +00:00
LLVM GN Syncbot 3a4bf99f0b [gn build] Port 69fa84a6e9 2020-06-04 17:56:20 +00:00
LLVM GN Syncbot 48a50fcc9a [gn build] Port 6756a2c953 2020-06-04 17:56:19 +00:00
LLVM GN Syncbot 9034dc9c59 [gn build] Port 49a4f3f7d8 2020-06-04 17:56:19 +00:00
Fangrui Song 68dd32dd43 [gn build] Port b5fc1deb5b 2020-06-04 09:22:59 -07:00
Denis Antrushin f2c9765664 [TableGen] Handle (outs variable_ops)
When `variable_ops` is specified in `InOperandList` of instruction,
it behaves as expected, i.e., does not count as operand.
So for `(ins variable_ops)` instruction description will have 0
operands.  However when used in OutOperandList it is counted as
operand. So `(outs variable_ops)` results in instruction with
one def.
This patch makes behavior of `variable_ops` in `out` list to match
that of `in` list.

Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D81095
2020-06-04 16:07:33 +03:00
LLVM GN Syncbot 8ccb9f98ea [gn build] Port 48cd9d9dd8 2020-06-04 12:56:45 +00:00
Nico Weber 3871ad366b [gn build] port some -Wno flags for gcc from the cmake build. 2020-06-04 08:10:29 -04:00
LLVM GN Syncbot 6cbccda89a [gn build] Port e636e6b79a 2020-06-03 21:16:03 +00:00
LLVM GN Syncbot 86fdfc104e [gn build] Port 7f50c15be5 2020-06-03 21:16:02 +00:00
Nico Weber a946cb1813 [gn build] Fix link with ld.bfd and gold.
lld's symbol resolution algorithm makes it not depend on
the order of object files and libraries, but ld.bfd and
gold require listing dependencies later on the link line.
Put {{libs}} after {{inputs}} so that e.g. -lpthreads
appears after the object files, not before it.

Differential Revision: https://reviews.llvm.org/D81035
2020-06-03 17:06:30 -04:00
LLVM GN Syncbot 99b8f3570a [gn build] Port add51e152a 2020-06-03 10:50:20 +00:00
LLVM GN Syncbot f2f3a80fd8 [gn build] Port 755a895915 2020-06-03 08:27:24 +00:00
LLVM GN Syncbot 128219faf9 [gn build] Port f99d5f8c32 2020-06-02 20:36:52 +00:00
dstuttar 9244be7b05 [TableGen] Avoid generating switch with just default
Summary:
Switch with just default causes an MSVC warning (warning C4065: switch statement
contains 'default' but no 'case' labels).

Change-Id: I9ddeccdef93666256b5454b164b567b73b488461

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81021
2020-06-02 19:48:07 +01:00
Nico Weber dd3ebe223e [gn build] (manually) port 44f989e780 2020-06-02 08:18:42 -04:00
Sanjay Patel e5b8772756 [utils] change default nameless value to "TMP"
This is effectively reverting rGbfdc2552664d to avoid test churn
while we figure out a better way forward.

We at least salvage the warning on name conflict from that patch
though.

If we change the default string again, we may want to mass update
tests at the same time. Alternatively, we could live with the poor
naming if we change -instnamer.

This also adds a test to LLVM as suggested in the post-commit
review. There's a clang test that is also affected. That seems
like a layering violation, but I have not looked at fixing that yet.

Differential Revision: https://reviews.llvm.org/D80584
2020-06-01 06:54:45 -04:00
Nico Weber 216bad9a64 [gn build] (semi-manually) port a8ca0ec267 2020-05-31 22:06:11 -04:00
Sanjay Patel bfdc255266 [utils] change update_test_checks.py use of 'TMP' value names
As discussed in PR45951:
https://bugs.llvm.org/show_bug.cgi?id=45951

There's a potential name collision between update_test_checks.py and -instnamer
and/or manually-generated IR test files because all of them try to use the
variable name that should never be used: "tmp".

This patch proposes to reduce the odds of collision and adds a warning if we
detect the problem. This will cause regression test churn when regenerating
CHECK lines on existing files.

Differential Revision: https://reviews.llvm.org/D80584
2020-05-31 10:46:11 -04:00
LLVM GN Syncbot 02f6f1ebb1 [gn build] Port cf6cc662ee 2020-05-29 23:53:23 +00:00
LLVM GN Syncbot 26c070c8db [gn build] Port 34cfed24eb 2020-05-29 23:53:22 +00:00
Nico Weber 7d77b0545d [gn build] (manually) port 0e265e3157 2020-05-29 19:49:11 -04:00
Louis Dionne dac21fd29c [lit] Add an option to print all features used in tests
Lit test suites can tend to accumulate annotations that are not necessarily
relevant as time goes by, for example XFAILS on old compilers or platforms.
To help spot old annotations that can be cleaned up, it can be useful to
look at all features used inside a test suite.

This commit adds a new Lit option '--show-used-features' that prints all
the features used in XFAIL, REQUIRES and UNSUPPORTED of all tests that
are discovered.

Differential Revision: https://reviews.llvm.org/D78589
2020-05-29 07:00:05 -04:00
LLVM GN Syncbot 3ea38b5b4e [gn build] Port a6deaeec37 2020-05-29 03:47:15 +00:00
LLVM GN Syncbot db923ce612 [gn build] Port 7cfdff7b4a 2020-05-28 16:49:43 +00:00
Cullen Rhodes e533a176b3 [TableGen] Fix non-standard escape warnings for braces in InstAlias
Summary:
TableGen interprets braces ('{}') in the asm string of instruction aliases as
variants but when defining aliases with literal braces they have to be escaped
to prevent them being removed.

Braces are escaped with '\\', for example:

  def FooBraces : InstAlias<"foo \\{$imm\\}", (foo IntOperand:$imm)>;

Although when TableGen is emitting the assembly writer (-gen-asm-writer)
the AsmString that gets emitted is:

  AsmString = "foo \{$\x01\}";

In c/c++ braces don't need to be escaped which causes compilation
warnings:

  warning: use of non-standard escape character '\{' [-Wpedantic]

This patch fixes the issue by unescaping the flattened alias asm string
in the asm writer, by replacing '\{\}' with '{}'.

Reviewed By: hfinkel

Differential Revision: https://reviews.llvm.org/D79991
2020-05-28 09:36:24 +00:00
LLVM GN Syncbot 4b94cee650 [gn build] Port 5921782f74 2020-05-28 08:08:39 +00:00
LLVM GN Syncbot f830b406c6 [gn build] Port 660cda572d 2020-05-28 02:47:12 +00:00
Fangrui Song eca963f244 [gn build] Add MLAnalysisTests after D80579 2020-05-27 17:21:05 -07:00
Fangrui Song dee2bb5810 [gn build] Port D80579 2020-05-27 17:12:12 -07:00
Michael Liao fa342b5c80 Enable `align <n>` to be used in the intrinsic definition.
- This allow us to specify the (minimal) alignment on an intrinsic's
  arguments and, more importantly, the return value.

Differential Revision: https://reviews.llvm.org/D80422
2020-05-27 16:38:18 -04:00
Michael Liao 03481287ca Refactor argument attribute specification in intrinsic definition. NFC.
- Argument attribute needs specifiying through `ArgIndex<n>`
  (corresponding to `FirstArgIndex`) to distinguish explicitly from the
  index number from the overloaded type list.
- In addition, `RetIndex` (corresponding to `ReturnIndex`) and
  `FuncIndex` (corresponding to `FunctionIndex`) are introduced for us
  to associate attributes on the return value and potentially function
  itself.

Differential Revision: https://reviews.llvm.org/D80422
2020-05-27 16:37:53 -04:00
LLVM GN Syncbot bed78845e5 [gn build] Port 0d20ed664f 2020-05-27 16:41:00 +00:00
Nico Weber 4f0eba28eb [gn build] (manually) port dedaf3a2ac 2020-05-27 12:31:59 -04:00
Ties Stuij ad5d319ee8 [IR][BFloat] add BFloat IR intrinsics support
Summary:
This patch is part of a series that adds support for the Bfloat16 extension of
the Armv8.6-a architecture, as detailed here:

https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a

The bfloat type, and its properties are specified in the Arm Architecture
Reference Manual:

https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile

Reviewers: scanon, fpetrogalli, sdesmalen, craig.topper, LukeGeeson

Reviewed By: fpetrogalli

Subscribers: LukeGeeson, pbarrio, kristof.beyls, hiraditya, jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79707
2020-05-27 14:37:47 +01:00
Ties Stuij 0508fb45df [CodeGen][BFloat] Add bfloat MVT type
Summary:
This patch adds BFloat MVT support. It also adds fixed and scalable vector MVT
types for BFloat.

This patch is part of a series that adds support for the Bfloat16 extension of the Armv8.6-a architecture, as
detailed here:

https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a

The bfloat type, and its properties are specified in the Arm Architecture
Reference Manual:

https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile

Reviewers: aemerson, huntergr, craig.topper, fpetrogalli, sdesmalen, LukeGeeson, ostannard

Reviewed By: ostannard

Subscribers: LukeGeeson, pbarrio, dschuff, kristof.beyls, hiraditya, aheejin, jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79706
2020-05-27 13:38:12 +01:00
LLVM GN Syncbot 10f0b18ed9 [gn build] Port d70ec366c9 2020-05-26 17:56:17 +00:00
Daniel Frampton e72cba9757 Use configure depends to trigger reconfiguration when LLVMBuild files change
Summary:
The existing logic has a workaround where configure_file is used to write a single dummy file output many times.

CMake has a feature to more directly add the dependency and avoid the dummy file (it is available in the minimum version specified).

Reviewers: theraven

Reviewed By: theraven

Subscribers: theraven, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80218
2020-05-26 16:30:20 +01:00
LLVM GN Syncbot e0aefaedb6 [gn build] Port ba92b27422 2020-05-25 18:14:50 +00:00
Matt Arsenault 421a40b325 TableGen: Don't reconstruct CodeGenDAGTarget
This is quite expensive and it's already available.

Just ReadLegalValueTypes is taking 4 seconds for me in a debug build
for AMDGPU's -gen-instr-info, and this was introducing a second call.
2020-05-23 12:15:44 -04:00
Michal Paszkowski fc12ead8ff Revert "[gn build] Port 14d358537f1"
This reverts commit a0c7108b99.
2020-05-23 13:51:07 +02:00
LLVM GN Syncbot a0c7108b99 [gn build] Port 14d358537f 2020-05-23 11:05:09 +00:00
Stephen Neuendorffer 0231227e5d Reapply "[lit] GoogleTest framework should report failures if test binary crashes"
This reverts commit 78dea0e8fb.

The offending lldb test (which is a real bug exposed by this patch)
has been disabled on windows (see a67b2faa7c)
and lldb is queued for inclusion into precommit testing, which would
have caught this.

Differential Revision: https://reviews.llvm.org/D80389
2020-05-22 14:01:08 -07:00
LLVM GN Syncbot c7e5454ace [gn build] Port 2e40cf06df 2020-05-22 04:58:19 +00:00
Nico Weber 5127d4b4ff [gn build] (manually) port 49a4f3f7d8 2020-05-21 23:09:18 -04:00
LLVM GN Syncbot bb7fb6d7b2 [gn build] Port 54e91a3c70 2020-05-21 23:43:28 +00:00
LLVM GN Syncbot abf4957204 [gn build] Port 92fd3971e0 2020-05-21 18:20:26 +00:00
Jonas Devlieghere 78dea0e8fb Revert "[lit] GoogleTest framework should report failures if test binary crashes"
This reverts commit ef21031822 because it
breaks the Windows bot:

http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/16447

Failing Tests (2):
  ...
  lldb-unit :: API/./APITests.exe/failed_to_discover_tests_from_gtest
2020-05-20 23:22:47 -07:00
LLVM GN Syncbot ca85d5a848 [gn build] Port d9a4a24413 2020-05-21 00:30:02 +00:00
Stephen Neuendorffer ef21031822 [lit] GoogleTest framework should report failures if test binary crashes
lit runs a gtest executable multiple times. First it runs it to
discover tests, then later it runs the executable again for each test.
However, if the discovery fails (perhaps because of a broken
executable), then no tests were previously run and no failures were
reported.  This patch creates a dummy test if discovery fails, which
will later fail when test are run and be reported as a failure.

Differential Revision: https://reviews.llvm.org/D80096
2020-05-20 13:36:08 -07:00
LLVM GN Syncbot aafdeeade8 [gn build] Port bcbd26bfe6 2020-05-20 09:58:47 +00:00
Nico Weber 1502941c1c [gn build] Try harder to unbreak Windows build after f8e833a501. 2020-05-19 17:14:08 -04:00
Nico Weber f8cccd126b [gn build] Try to unbreak Windows build after f8e833a501. 2020-05-19 16:14:04 -04:00
Sébastien Marchand f8e833a501 [gn build] Add a flag zlib_path to provide the path to zlib on Windows.
Also, automatically set llvm_enable_zlib to true when zlib_path is set.

Differential Revision: https://reviews.llvm.org/D80042
2020-05-19 16:00:54 -04:00
LLVM GN Syncbot a60baa3c43 [gn build] Port bcc0c894f3 2020-05-19 06:07:14 +00:00
LLVM GN Syncbot 0af40120ad [gn build] Port 62a9eca859 2020-05-19 05:18:58 +00:00
LLVM GN Syncbot a204f22b42 [gn build] Port e7e84ff24a 2020-05-19 02:41:51 +00:00
LLVM GN Syncbot a81f8fb78d [gn build] Port 9d69072fb8 2020-05-18 22:19:17 +00:00
Nico Weber d5e9b76253 [gn build] Put HAVE_LIBZ and HAVE_ZLIB_H behind llvm_enable_zlib too.
In the CMake build, the HAVE_ vars are set based on system inspection,
and LLVM_ENABLE_ZLIB is set to false if neither's found. The GN build
doesn't do autodetection like this.

With this change, people can set llvm_enable_zlib=true on Windows
and as long as they provide a zlib.lib things should actually work.

(https://reviews.llvm.org/D79219 will remove 2 of the 3 config.h
values, hopefully soon. This change here just makes things a tiny
bit easier until that change is in.)
2020-05-15 16:18:56 -04:00
Daniel Grumberg 558db27c49 [NFC] Whitespace fix inside OptParserEmitter 2020-05-15 11:27:13 -07:00
LLVM GN Syncbot 6894d95040 [gn build] Port 6b01b46538 2020-05-15 15:13:18 +00:00
Machiel van Hooren 7063a83a7c Add MSVC natvis visualisation of llvm::Type
llvm::Type has some difficult to decode member variables with different meanings
depending on the TypeID. Specifically SubclassData and ContainedTys. This natvis
visualisation decodes and visualises those members.
2020-05-15 09:38:37 -04:00
Stanislav Mekhanoshin 184b383457 Add v16f64 value type
We need to use it to handle <16 x double> indirect indexes
in the AMDGPU BE.

The only visible change from adding it is in ARM cost model.
To me it looks reasonable. With doubling a vector size it
quadruples the cost up to the size 8 and then it did only
double it. Now it also quadruples, which seems a logical
progression to me.

Actual AMDGPU code is to follow, this is a common part, plus
load/store legalization in the AMDGPU BE not to break what
works now.

Differential Revision: https://reviews.llvm.org/D79952
2020-05-14 14:28:00 -07:00
LLVM GN Syncbot b5d2bd74d7 [gn build] Port 2b7fe0863a 2020-05-14 21:21:41 +00:00
LLVM GN Syncbot 7b73e5e08d [gn build] Port 42a5560503 2020-05-14 17:59:56 +00:00
Pete Steinfeld 72416b136e Fixed a problem removing temp files
Summary:
Before making this change, whenever I ran "check-flang", I'd get an
error message like:

llvm-lit: /mnt/c/GitHub/f18/c751/flang/build/bin/../../../llvm/utils/lit/lit/main.py:252: warning: Failed to delete temp directory '/tmp/lit_tmp_gOKUIh'

With this change, there's no such message in the output, and the temp
directory is successfully removed.

Note that my working environment is on Windows 10 running Windows
Subsystem for Linux using the Ubuntu app.  I'm running Python version
2.7.1.

Earlier versions of Python do not contain `shutil`.  It may be that this
module was available on Windows systems later than other platforms.
Upgrading my version of Python made the problem go away

I don't believe that timing was a problem since inserting a long delay
didn't fix things.

So I added some text to the error message recommending that the user
upgrade their version of Python if they run into this problem.

Reviewers: yln, DavidTruby

Subscribers: delcypher, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79861
2020-05-13 11:40:19 -07:00
Amy Huang 641ae73f2e [NativeSession] Implement NativeSession::findSymbolByAddress.
Summary: This implements searching for function symbols and public symbols by address.

More specifically,
-Implements NativeSession::findSymbolByAddress for function symbols and
public symbols. I think data symbols are also searched for, but isn't
implemented in this patch.
-Adds classes for NativeFunctionSymbol and NativePublicSymbol
-Adds a '-use-native-pdb-reader' option to llvm-symbolizer, for testing
purposes.

Reviewers: rnk, amccarth, labath

Subscribers: mgorny, hiraditya, MaskRay, rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79269
2020-05-13 09:39:25 -07:00
Joel E. Denny a1fd188223 [FileCheck] Support comment directives
Sometimes you want to disable a FileCheck directive without removing
it entirely, or you want to write comments that mention a directive by
name.  The `COM:` directive makes it easy to do this.  For example,
you might have:

```
; X32: pinsrd_1:
; X32:    pinsrd $1, 4(%esp), %xmm0

; COM: FIXME: X64 isn't working correctly yet for this part of codegen, but
; COM: X64 will have something similar to X32:
; COM:
; COM:   X64: pinsrd_1:
; COM:   X64:    pinsrd $1, %edi, %xmm0
```

Without this patch, you need to use some combination of rewording and
directive syntax mangling to prevent FileCheck from recognizing the
commented occurrences of `X32:` and `X64:` above as directives.
Moreover, FileCheck diagnostics have been proposed that might complain
about the occurrences of `X64` that don't have the trailing `:`
because they look like directive typos:

  <http://lists.llvm.org/pipermail/llvm-dev/2020-April/140610.html>

I think dodging all these problems can prove tedious for test authors,
and directive syntax mangling already makes the purpose of existing
test code unclear.  `COM:` can avoid all these problems.

This patch also updates the small set of existing tests that define
`COM` as a check prefix:

- clang/test/CodeGen/default-address-space.c
- clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
- clang/test/Driver/hip-device-libs.hip
- llvm/test/Assembler/drop-debug-info-nonzero-alloca.ll

I think lit should support `COM:` as well.  Perhaps `clang -verify`
should too.

Reviewed By: jhenderson, thopre

Differential Revision: https://reviews.llvm.org/D79276
2020-05-13 11:29:48 -04:00
Victor Campos cac6a26f38 [TableGen] Fix register class handling in TableGen's DAG ISel Matcher Generator
Summary:
In TableGen's instruction selection table generator, references to
register classes were handled by generating a matcher table entry in the
form of "EmitStringInteger, MVT::i32, 'RegisterClassID'". This ID is in
fact the enum integer value corresponding to the register class.

However, both the table generator and the table consumer
(SelectionDAGISel) assume that this ID is less than or equal to 127,
i.e. at most 7 bits. Values greater than this threshold cause completely
wrong behaviours in the instruction selection process.

This patch adds a check to determine if the enum integer value is
greater than the limit of 127. In finding so, the generator emits an
"EmitInteger" instead, which properly supports values with arbitrary
sizes.

Commit f8d044bbcf fixed the very same bug
for register subindices. The present patch now extends this cover to
register classes.

Reviewers: rampitec

Reviewed By: rampitec

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79705
2020-05-13 10:17:03 +01:00
Joel E. Denny 2aa0217add [FileCheck] Make invalid prefix diagnostics more precise
This will prove especially helpful after D79276, which introduces
comment prefixes.  Specifically, identifying whether there's a
uniqueness violation will be helpful as prefixes will be required to
be unique across both check prefixes and comment prefixes.

Also, remove a related comment about `cl::list` that no longer seems
relevant now that FileCheck is also a library.

Reviewed By: jhenderson, thopre

Differential Revision: https://reviews.llvm.org/D79375
2020-05-11 21:11:58 -04:00
Nico Weber 91259bf9c6 [gn build] Use relative paths in generated lit.site.cfg.py files for llvm and clang.
This ports a16ba6fea2 to the GN build.

No intended behavior change.
2020-05-11 20:58:45 -04:00
Joel E. Denny e1ed4d9eb5 Revert "[FileCheck] Make invalid prefix diagnostics more precise"
This reverts commit a78e13745d to try to
fix a bot:

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23489
2020-05-11 19:41:22 -04:00
Joel E. Denny d0e7fd6b62 Revert "[FileCheck] Support comment directives"
This reverts commit 9a9a5f9893 to try to
fix a bot:

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23489
2020-05-11 19:41:22 -04:00
Nico Weber 18324bb3d9 [gn build] Make paths in generated llvm-lit relative.
This ports d4638cba and e613f0ee to the GN build.
Since paths in the generated lit.site.cfg.py files still contain
absolute paths in the GN build, this isn't very useful yet.

No intended behavior change.
2020-05-11 19:34:25 -04:00
Nico Weber 11e1cf51fb [gn build] Make config_map computation in llvm-lit more table-driven.
No behavior change.
2020-05-11 19:21:56 -04:00
Nico Weber 89d3031b3c llvm-lit.in: Use a raw string for LLVM_SOURCE_DIR
In case the path from cmake build dir contains a backslash
escape on Windows (which uses \ as path separator).

While here, consistently use one form of quotes in this file.

No intended behavior change.
2020-05-11 19:05:53 -04:00
Martin Storsjö 609ef94838 [CMake] Fix building with -DBUILD_SHARED_LIBS=ON on mingw
Set the right target name in clang/examples/Attribute.

Add a missing dependency in the TableGen GlobalISel sublibrary.

Skip building the Bye pass plugin example on windows; plugins
that should have undefined symbols that are found in the host
process aren't supported on windows - this matches what was done
for a unit test in bc8e442188.
2020-05-11 23:51:14 +03:00
LLVM GN Syncbot e0c291a682 [gn build] Port e97a3e5d9d 2020-05-11 20:09:12 +00:00
Joel E. Denny 9a9a5f9893 [FileCheck] Support comment directives
Sometimes you want to disable a FileCheck directive without removing
it entirely, or you want to write comments that mention a directive by
name.  The `COM:` directive makes it easy to do this.  For example,
you might have:

```
; X32: pinsrd_1:
; X32:    pinsrd $1, 4(%esp), %xmm0

; COM: FIXME: X64 isn't working correctly yet for this part of codegen, but
; COM: X64 will have something similar to X32:
; COM:
; COM:   X64: pinsrd_1:
; COM:   X64:    pinsrd $1, %edi, %xmm0
```

Without this patch, you need to use some combination of rewording and
directive syntax mangling to prevent FileCheck from recognizing the
commented occurrences of `X32:` and `X64:` above as directives.
Moreover, FileCheck diagnostics have been proposed that might complain
about the occurrences of `X64` that don't have the trailing `:`
because they look like directive typos:

  <http://lists.llvm.org/pipermail/llvm-dev/2020-April/140610.html>

I think dodging all these problems can prove tedious for test authors,
and directive syntax mangling already makes the purpose of existing
test code unclear.  `COM:` can avoid all these problems.

This patch also updates the small set of existing tests that define
`COM` as a check prefix:

- clang/test/CodeGen/default-address-space.c
- clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
- clang/test/Driver/hip-device-libs.hip
- llvm/test/Assembler/drop-debug-info-nonzero-alloca.ll

I think lit should support `COM:` as well.  Perhaps `clang -verify`
should too.

Reviewed By: jhenderson, thopre

Differential Revision: https://reviews.llvm.org/D79276
2020-05-11 14:53:48 -04:00
Joel E. Denny a78e13745d [FileCheck] Make invalid prefix diagnostics more precise
This will prove especially helpful after D79276, which introduces
comment prefixes.  Specifically, identifying whether there's a
uniqueness violation will be helpful as prefixes will be required to
be unique across both check prefixes and comment prefixes.

Also, remove a related comment about `cl::list` that no longer seems
relevant now that FileCheck is also a library.

Reviewed By: jhenderson, thopre

Differential Revision: https://reviews.llvm.org/D79375
2020-05-11 14:53:48 -04:00
Nico Weber b51df268eb [gn build] (manually) port bba38de50c 2020-05-11 13:46:21 -04:00
LLVM GN Syncbot e6615d71d8 [gn build] Port bf95cf4a68 2020-05-11 16:35:33 +00:00
Zola Bridges f056dacbd7 [llvm][utils] Remove git-svn folder + scripts
Summary:
These tools are no longer useful since we've migrated off of SVN, so
this patch deletes them.

RFC Link: http://lists.llvm.org/pipermail/llvm-dev/2020-May/141386.html

Unless there is opposition in the RFC thread, I'll submit the patch on
May 10, 2020.

I searched through the repo to confirm there were no mentions of the scripts
in other scripts or documentation.

Reviewed By: echristo, tstellar, MaskRay

Differential Revision: https://reviews.llvm.org/D79348
2020-05-11 09:26:29 -07:00
LLVM GN Syncbot b02473d508 [gn build] Port 48fa355ed4 2020-05-11 16:11:59 +00:00
LLVM GN Syncbot 1d2c1fcf41 [gn build] Port 35d867a790 2020-05-10 11:04:15 +00:00
David Tenty d26a8daa49 [AIX] Make sure we use export lists for plugins
Summary:
Besides just generating and consuming the lists, this includes:

 * Calling  nm with the right options in extract_symbols.py. Such as not
  demangling C++ names, which AIX nm does by default, and accepting both
  32/64-bit names.
 * Not having nm sort the list of symbols or we may run in to memory
   issues on debug builds, as nm calls a 32-bit sort.
 * Defaulting to having LLVM_EXPORT_SYMBOLS_FOR_PLUGINS on for AIX
 * CMake versions prior to 3.16 set the -brtl linker flag globally on
   AIX. Clear it out early on so we don't run into failures. We will set
   it as needed.

Reviewers: jasonliu, DiggerLin, stevewan, hubert.reinterpretcast

Reviewed By: hubert.reinterpretcast

Subscribers: hubert.reinterpretcast, mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70972
2020-05-08 14:00:25 -04:00
Nico Weber e20fcf0504 Unbreak clang-tidy tests after D79599 / e9b4113902. 2020-05-08 12:37:33 -04:00
Nico Weber e9b4113902 Add a flag that controls if clang-tidy and clang-include-fixer are built into libclang.
Based on the discussion on D55415, also make the flag default to false.
Having libclang depend on clang-tools-extra means check-clang builds all
of clang-tools-extra, which besides being a layering violation takes
quite some time, since clang-tools-extra has many files that are slow
to compile.

Longer term, we likely will want to remove this flag completely. If
people need this functionality, maybe there could be a
libclang-tools-extra that's libclang + clang-tidy and
clang-includes-fixer linked in.

Differential Revision: https://reviews.llvm.org/D79599
2020-05-08 11:41:45 -04:00
Simon Pilgrim 3561526208 DFAEmitter.h - remove unnecessary headers. NFC.
Reduce StringRef.h include to forward declaration and add implicit SmallVector.h and <map> include dependencies.
2020-05-08 14:53:10 +01:00
LLVM GN Syncbot 92c657920e [gn build] Port e3ffe7269b 2020-05-07 10:11:03 +00:00
Nico Weber f174f1c59a [gn build] (manually) merge 07f8ca6ab1 2020-05-05 06:15:20 -04:00
Julian Lettner 47b25c3323 [lit] Create one output file when `--output` is specified more than once
The argparse 'append' action concatenates multiple occurrences of an
argument (even when we specify `nargs=1` or `nargs='?'`).  This means
that we create multiple identical output files if the `--output`
argument is given more than once.  This isn't useful and we instead want
this to behave like a standard optional argument: last occurrence wins.
2020-05-04 21:36:20 -07:00
Julian Lettner 3610fd8c5c [lit] Disable test on Windows
abhinavgaba reported that that the custom-result-category.py test hangs
on a Windows build bot [1].  Disable it for now.

[1] https://reviews.llvm.org/D78164#2018178
2020-05-04 13:06:56 -07:00
Djordje Todorovic 0a4defe8c8 [llvm-dwarfdump][Stats] Clean up
This addresses:
  -Clean up the source code
  -Refactor the JSON fields
  -Fix the test cases
  -Improve the docs for the stats output

Differential Revision: https://reviews.llvm.org/D77789
2020-05-04 09:35:40 +02:00
LLVM GN Syncbot f914b500df [gn build] Port e64f99c51a 2020-05-03 12:08:26 +00:00
Nico Weber c5392e2eaf [gn build] (manually) port ad97ccf6b2 more, for include added in e64f99c51a 2020-05-03 08:07:52 -04:00
Nico Weber ae23bd3577 [gn build] Port 8f766e382b more and fix 2 llvm-config test failures.
The failures only happened in fully clean builds.

Also put all current dependencies of LibraryDependencies.inc in the
build graph, so that this type of thing will cause a failure in
incremental builds next time as well.
2020-05-02 14:11:50 -04:00
LLVM GN Syncbot 35e956b6d2 [gn build] Port fa1f4cf843 2020-05-02 12:54:28 +00:00
Julian Lettner 9ed6f03189 [lit] Don't use Python3 yet
String interpolation is a Python3 feature, we can't use it yet.
2020-05-01 17:36:21 -07:00
Julian Lettner 840bc47f8b [lit] Extract by_suite_and_test_path sort key function 2020-05-01 17:03:55 -07:00
Julian Lettner 3eb1d7ffb5 [lit] Create report generators during argument parsing 2020-05-01 17:03:55 -07:00
Julian Lettner 201e73cbbb [lit] Small refinements for xunit report output 2020-05-01 17:03:55 -07:00
Julian Lettner 7ffb5bc2a2 [lit] Factor out report generators into separate file
Factor out the report generators from main.py into reports.py.

I verified that we generate the exact same output by running `check-all`
and comparing the new and old output for both report flavors.
2020-05-01 17:03:55 -07:00
Julian Lettner 11e02d5c24 [lit] Only update specific fields from remote test object
Don't update whole test object from the remote (pickled) finished test
object.  Doing so also changes the config and suite members, which we
want to avoid.
2020-05-01 17:03:54 -07:00
LLVM GN Syncbot e676076c25 [gn build] Port 6cb073133c 2020-05-02 00:00:04 +00:00
Julian Lettner 70605ff452 [lit] Don't crash for --time-tests in aborted test run
Properly print the test times histogram even for aborted (user
interrupt, [Ctrl+C]) test runs.
2020-04-30 18:19:15 -07:00
Julian Lettner 8cb8fe909b [lit] Add EXCLUDED test result category
Track and print the number of tests that were discovered but not
executed due to test selection options:
  * --filter (regex filter)
  * --max-tests (limits number of tests)
  * sharding feature

With this change all discovered tests are accounted for: every
discovered test is included in one of the counts printed in the summary.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D78078
2020-04-30 17:58:11 -07:00
LLVM GN Syncbot 0ae6282389 [gn build] Port cfea3dc102 2020-04-30 22:15:14 +00:00
Julian Lettner 3cd6e02920 [lit] Push computation of workers into run_tests
This also avoids assigning to the option object.
2020-04-30 13:49:30 -07:00
Hans Wennborg 88aad9b9f0 lit googletest.py: Don't raise StopIteration in generator
The intention here seems to be to end the generator function, but with
modern Python, raising StopIteration causes a runtime error
(https://www.python.org/dev/peps/pep-0479/).

Differential revision: https://reviews.llvm.org/D79169
2020-04-30 18:16:17 +02:00
Julian Lettner fbdcfcd4c3 [lit] Provide extension API for custom result categories
The lnt test suite defines custom result codes [1].  Support those via
an extension API instead of "by accident", which should offer the
advantage of properly handling them when we print test results.

[1] https://reviews.llvm.org/D77986

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D78164
2020-04-29 19:45:55 -07:00
LLVM GN Syncbot 85aee35d82 [gn build] Port 9854edd817 2020-04-29 22:52:50 +00:00
Nico Weber aa545dcec1 [gn build] (manually) port ad97ccf6b2 2020-04-29 11:51:22 -04:00
Nico Weber 7585ac79dd Reland "[gn build] (manually) merge c4c3883"
The Python3 change relanded yet again, so merge it yet again.

This reverts commit f0019cdc47.
This reverts commit 854a7db46c.
2020-04-28 21:43:58 -04:00
LLVM GN Syncbot 2dd4596e2a [gn build] Port 8683f5de53 2020-04-29 00:53:06 +00:00
Nico Weber f0019cdc47 [gn build] fix typo 2020-04-28 20:52:51 -04:00
Nico Weber 854a7db46c Revert "[gn build] (manually) merge c4c3883"
This reverts commit cbaa74a098.
The Py3 change got (mostly, except compiler-rt) reverted again.
2020-04-28 20:48:29 -04:00
Reid Kleckner cbaa74a098 [gn build] (manually) merge c4c3883
PYTHON_EXECUTABLE changed to Python3_EXECUTABLE in the lit test suite.

Committing without review, since the gn build is currently broken. Going
forward, more gn build changes may be necessary to get gn to find Python
3 instead of Python 2.
2020-04-28 10:24:11 -07:00
Nico Weber cbb61831f5 Revert "[gn build] (manually) merge cd84bfb8142bc7ff3a0"
This reverts commit 825f583c86.
This reverts commit 45417ecbc1.

cd84bfb814 was reverted in be884b7935
2020-04-27 23:31:46 -04:00
Nico Weber 825f583c86 [gn build] (manually) merge cd84bfb814 more precisely 2020-04-27 21:55:02 -04:00
Nico Weber 45417ecbc1 [gn build] (manually) merge cd84bfb814 2020-04-27 21:45:58 -04:00
Nico Weber d9541b18e3 Revert "[gn build] (manually) merge 811c0c9eb46"
This reverts commit b160e9e539.
811c0c9eb4 was reverted in 96717125e8.
2020-04-27 09:00:21 -04:00
Nico Weber b160e9e539 [gn build] (manually) merge 811c0c9eb4 2020-04-27 06:39:40 -04:00
Benjamin Kramer ed766f1bb1 Sort EnumAttr so it matches Attribute::operator<
This means AttrBuilder will always create a sorted set of attributes and
we can skip the sorting step. Sorting attributes is surprisingly
expensive, and I recently made it worse by making it use array_pod_sort.
2020-04-26 17:00:25 +02:00
Fangrui Song 7016a4b5c3 llvm-tblgen -gen-dag-isel: Hoist SmallVector TmpBuf 2020-04-25 20:41:04 -07:00
Fangrui Song 58dbd5befd llvm-tblgen -gen-dag-isel: Reduce lib/Target/*/*GenDAGISel.inc
X86GenDAGISel.inc: 22597697 bytes -> 20874981 bytes
2020-04-25 20:02:04 -07:00
Fangrui Song 94d331a718 [X86] Shrink lib/Target/X86/X86GenDisassemblerTables.inc
6330853 bytes -> 5207842 bytes
2020-04-25 19:44:32 -07:00
Nico Weber 6121122a3b [gn build] update two comments 2020-04-24 11:52:49 -04:00
LLVM GN Syncbot 531bfa3e02 [gn build] Port 7aaff8fd2d 2020-04-24 15:06:14 +00:00
Nico Weber 446082b99f [gn build] minimally merge 67b2dbd5a3 even more 2020-04-24 11:05:58 -04:00
Nico Weber 76ea360036 [gn build] minimally merge 67b2dbd5a3 more 2020-04-24 10:23:22 -04:00
Nico Weber 0efb958bde [gn build] minimally merge 67b2dbd5a3 2020-04-24 09:58:19 -04:00
Nico Weber aed67a3df7 [gn build] (manually) merge 8f766e382b in a minimal way 2020-04-24 09:33:35 -04:00
Alex Richardson f50bc823fe [UpdateTestChecks] Make generation of UTC_ARGS: comment more robust
We now use the argparse Action objects to determine the name of the flags.
This fixes cases where the key for the stored result ('dest') is not the
same as the command line flag (e.g. --enable/--disable).
Also add a test that --disabled can be part of the initial UTC_ARGS.

This is split out from D78478

Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D78617
2020-04-23 13:12:27 +01:00
LLVM GN Syncbot dad6de4112 [gn build] Port 2360933147 2020-04-21 23:36:07 +00:00
LLVM GN Syncbot 67c6b80569 [gn build] Port 352fef3f11 2020-04-21 21:22:08 +00:00
LLVM GN Syncbot 73ea427818 [gn build] Port 060efd24c7 2020-04-21 21:22:07 +00:00
LLVM GN Syncbot 5a2a24f1e9 [gn build] Port 2214b9076f 2020-04-21 08:34:22 +00:00
Sriraman Tallam 365b60fc93 New pass to make internal linkage symbol names unique.
With clang option -funique-internal-linkage-symbols, symbols with
internal linkage get names with the module hash appended.

Differential Revision: https://reviews.llvm.org/D78243
2020-04-20 15:05:22 -07:00
LLVM GN Syncbot aa688ba047 [gn build] Port 12030494fc 2020-04-20 13:10:45 +00:00
Georgii Rymar 76e0ab23f6 [FileCheck] - Refactor the code related to string arrays. NFCI.
There are few `std::vector<std::string>` members in
`FileCheckRequest`. This patch changes these arrays to `std::vector<StringRef>`
and refactors the code related to cleanup/improve/simplify it.

Differential revision: https://reviews.llvm.org/D78202
2020-04-20 14:54:49 +03:00
Fangrui Song 041a3557f0 [CMake] Delete HAVE_SCHED_GETAFFINITY and HAVE_CPU_COUNT
sched_getaffinity (Linux specific) has been available

* in glibc since 2002-08-08 (commit 972e719e8154eec5f543b027e2a08dfa285d55d5)
* in musl since the initial check-in.
2020-04-19 08:50:23 -07:00
Luís Marques 60ce987bf3 [RISCV][PowerPC] Fix google/benchmark benchmark::cycleclock::Now
Cherrypick the upstream fix commit a77d5f7 onto llvm/utils/benchmark
and libcxx/utils/google-benchmark.
This fixes LLVM's 32-bit RISC-V compilation, and the issues
mentioned in https://github.com/google/benchmark/pull/955
An additional cherrypick of ecc1685 fixes some minor formatting
issues introduced by the preceding commit.

Differential Revision: https://reviews.llvm.org/D78084
2020-04-18 09:32:19 +01:00
LLVM GN Syncbot 7b72a17ee7 [gn build] Port 66037b84cf 2020-04-17 22:33:56 +00:00
LLVM GN Syncbot cceaf6b8ff [gn build] Port ff9379f4b2 2020-04-17 09:27:53 +00:00
LLVM GN Syncbot 634f173830 [gn build] Port 953a814aae 2020-04-17 00:58:15 +00:00
Joel E. Denny ce685455e4 [FileCheck] Fix --dump-input annotation sort per input line
Without this patch, `--dump-input` annotations on a single input line
are sorted by the associated directive's check-file line.  That seemed
fine because that's often identical to the order in which FileCheck
looks for matches for those directives.

The first problem is that an `--implicit-check-not` pattern has no
check-file line.  The logical equivalent is sorting in command-line
order, but that's not implemented.

The second problem is that, unlike a directive, an
`--implicit-check-not` pattern applies at many points, between many
different pairs of directives.  However, sorting in command-line order
gathers all its associated diagnostics together at one point in an
input line's list of annotations.

In general, it seems to be easier to understand FileCheck's logic when
annotations on a single input line are sorted in the order FileCheck
produced the associated diagnostics, so this patch makes that change.
As documented in the patch, the annotation sort order is also
especially relevant to `CHECK-LABEL`, `CHECK-NOT`, and `CHECK-DAG`, so
this patch updates or extends tests to check the sort makes sense for
them.  (However, the sort for `CHECK-DAG` annotations should not
actually be altered by this patch.)

Reviewed By: thopre

Differential Revision: https://reviews.llvm.org/D77607
2020-04-16 15:39:35 -04:00
Joel E. Denny b5a24610fa [FileCheck] Fix --dump-input implicit pattern location
Currently, `--dump-input` implies that all `--implicit-check-not`
patterns appear on line 1 by printing annotations like:

```
       1: foo bar baz
not:1         !~~     error: no match expected
```

This patch changes that to:

```
          1: foo bar baz
not:imp1         !~~     error: no match expected
```

`imp1` indicates the first `--implicit-check-not` pattern.

Reviewed By: thopre

Differential Revision: https://reviews.llvm.org/D77605
2020-04-16 15:39:35 -04:00
LLVM GN Syncbot 6aac98f4dd [gn build] Port d9085f65db 2020-04-16 17:47:41 +00:00
Nico Weber b9fd375d75 Revert "[lit] Keep original cfg file case around."
This reverts commit bc3f54de18.

The patch breaks in the following two scenarios:

1. When manually passing an absolute path to llvm-lit with a lower-case
   drive letter: `python bin\llvm-lit.py -sv c:\llvm-project\clang\test\PCH`

2. When the PWD has a lower-case drive letter, like after running
   `cd c:\` with a lower-case "c:" (cmd's default is upper-case, but
   it takes case-ness from what's passed to `cd` apparently).
2020-04-15 17:19:39 -04:00
Dimitry Andric 7fb79105fe Use maximum compression when packaging release tarballs.
Summary:
Since a full run of test-release.sh takes many hours (at least on my
poor systems), we might as well spend some extra time compressing the
tarball, in return for a quite a bit of gains for uploading and
downloading it.

As an example, the 10.0.0-rc4 .tar.xz tarball shrinks from 465MiB to
306MiB, about 52% smaller.

Reviewers: hans, tstellar, rovka

Reviewed By: hans

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76192
2020-04-15 20:30:26 +02:00
Dimitry Andric 9daadcec81 Turn off core dumps before starting the main body of test-release.sh.
Summary:
Some of the regression tests, such as those for the various sanitizers,
use huge shadow memory maps (showing up in top as 20 TiB).  If any of
those ever crashes, your test system's disk will be filled up until
everything falls over.  Set the ulimit for core dumps to 0 to prevent
this problem.

Reviewers: hans, tstellar, rovka

Reviewed By: hans

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76191
2020-04-15 20:29:40 +02:00
Nico Weber bc3f54de18 [lit] Keep original cfg file case around.
There's been some back and forth if the cfg paths in the
config_map should be normcase()d. The argument for is that
it allows using all-lower spelling in cmd on Windows, the
argument against that doing so is lossy.

Before the relative-paths-in-generated-lit.site.cfg.py work,
there was no downside to calling normcase(), but with it
we need a hack to recover the original case.

This time, normcase() the hashtable key, but store the original
cased key in addition to the value. This fixes both cons, at the
cost of a few bytes more memory.

Differential Revision: https://reviews.llvm.org/D78169
2020-04-15 14:18:11 -04:00
Nico Weber f42baaab4f Remove an apparently unneeded normcase() call.
I believe this call is unneeded after https://reviews.llvm.org/D34855.

Reviewed as part of https://reviews.llvm.org/D78169
2020-04-15 14:02:48 -04:00
Nico Weber 6a887d22a1 Remove a function that has been dead since r313889. 2020-04-15 12:02:30 -04:00
LLVM GN Syncbot b68daf5d06 [gn build] Port 8c11bc0cd0 2020-04-15 09:38:24 +00:00
LLVM GN Syncbot 1e5f149c3c [gn build] Port 44e09b59b8 2020-04-15 06:53:11 +00:00
LLVM GN Syncbot b8aa1e31ea [gn build] Port 2ada8e2525 2020-04-15 06:01:21 +00:00
Matt Arsenault cb5dc3765b TableGen/GlobalISel: Fix constraining REG_SEQUENCE operands
This was hitting the default instruction constraint code which uses
the register classes in the instruction def, which REG_SEQUENCE does
not have.

Fixes not constraining the register class for AMDGPU fneg/fabs
patterns, which would fail when the use was another generic,
unconstrained instruction.

Another oddity I noticed is that the temporary registers are created
with an unnecessary, but incorrect 16-bit LLT but this shouldn't
matter.

I'm also still unclear why root and sub-instructions have to be
handled differently.
2020-04-14 22:05:22 -04:00
LLVM GN Syncbot 7713635074 [gn build] Port ebf190fcda 2020-04-14 22:33:30 +00:00
LLVM GN Syncbot 474b248877 [gn build] Port 8cbe371c28 2020-04-14 22:33:30 +00:00
LLVM GN Syncbot 8d7778ce28 [gn build] Port 204c3b5516 2020-04-14 22:33:29 +00:00
Nico Weber b6b332e3a3 [gn build] (manually) port c8a5b30bac 2020-04-14 12:51:58 -04:00
LLVM GN Syncbot 935b836d65 [gn build] Port 4563024356 2020-04-14 14:20:02 +00:00
LLVM GN Syncbot 2fff0fd0dc [gn build] Port 36c76de678 2020-04-14 09:55:20 +00:00
Julian Lettner 23f896a096 [lit] Update local test objects "in place" from remote test objects
Update local test object "in place" from remote test object.  We need to
do this to ensure that discovered test object which is used for printing
test results reflect the changes.

> Why are we sending back the whole test object from the worker process
> (lit.worker.execute) instead of just the result?

Unfortunately, the test result is not the only "result" of test
execution.  Other members (e.g., xfails, requires) of the Test class are
set only during execution.  Those members affect the behavior of
`isExpectedToFail` and `setResult`, and are accessed when printing
results.  For example, xunit.xml test results include missing features
for "skip reasons".  The lack of separation between an immutable "test
definition" and "generated outputs" (including the primary result and
other secondary state) is unfortunate historical design decision in lit.

> Why do we update the initial test object instead of just discarding it
> and continuing with the pickled test object?

Both of these approaches would work.  However, note that we need a fully
populated test object for printing results.  Updating the existing one
seems to be the easier path.
2020-04-13 21:02:58 -07:00
LLVM GN Syncbot e124e83db6 [gn build] Port 384ca190ae 2020-04-14 00:27:34 +00:00
Nico Weber e27894c99e [gn build] (manually) merge 10df1563d some more 2020-04-13 20:18:47 -04:00
LLVM GN Syncbot 5f9166525b [gn build] Port 10df1563d6 2020-04-13 23:18:41 +00:00
Nico Weber 4d4fef22da Revert a few unsuccessful attempts at fixing bots.
I broke bots last week and tried a few things to fix them.
These were attempts that didn't help, so back them back out.

This reverts commit c7aff9a109.
This reverts commit 8838d6d356.
This reverts commit e875ba1509.
2020-04-13 17:09:21 -04:00
LLVM GN Syncbot bb0e6cc1dd [gn build] Port e823068306 2020-04-13 20:31:14 +00:00
LLVM GN Syncbot c88a567279 [gn build] Port 255cc202ea 2020-04-13 20:31:14 +00:00
Nico Weber 6b4cd6b62d [gn build] (manually) merge 6dbf1a1229 2020-04-13 13:57:20 -04:00
Louis Dionne dd3feecd73 [lit] Print substitutions with --show-suites
We already print available features, and it can be useful to print
substitutions as well since those are a pretty fundamental part of
a test suite. We could also consider printing other things like the
test environment, however the need doesn't appear to be as strong.

As a fly-by fix, we also always print available features, even when
there are none.

Before:

  $ lit -sv libcxx/test --show-suites
  -- Test Suites --
    libc++ - 6350 tests
      Source Root: [...]
      Exec Root  : [...]
      Available Features : -faligned-allocation -fsized-deallocation [...]

After:

  $ lit -sv libcxx/test --show-suites
  -- Test Suites --
    libc++ - 6350 tests
      Source Root: [...]
      Exec Root  : [...]
      Available Features: -faligned-allocation -fsized-deallocation [...]
      Available Substitutions: %{build_module} => [...]
                               %{build} => %{cxx} -o [...]

Differential Revision: https://reviews.llvm.org/D77818
2020-04-13 12:01:12 -04:00
Julian Lettner c610807afe [lit] Temporarily disable failing tests on Windows 2020-04-10 20:03:44 -07:00
Julian Lettner 15000650a6 [lit] Fix tests on Windows
max-time.py:
  Windows does not have a native `sleep` command, use `time.sleep()` in
  Python instead.

max-failures.py:
  The max-failure test reused the shtest-shell test inputs instead of
  defining its own "test domain".  However, the output of this
  shtest-shell "test domain" is slightly different on Windows, which now
  bites us since we made the max-failures test stricter.  Let's define
  our own "max failures" test domain.
2020-04-10 17:33:49 -07:00
Julian Lettner 5925c4a0ff [lit] Increase sleep time in timeout test
Fixup for cbe42a9d5f.  Increase values for testing the overall lit
timeout (--max-time) which wasn't enough for the test to complete on
very slow build bots.
2020-04-10 16:22:00 -07:00
Julian Lettner cbe42a9d5f [lit] Add SKIPPED test result category
Track and print the number of skipped tests.  Skipped tests are tests
that should have been executed but weren't due to:
  * user interrupt [Ctrl+C]
  * --max-time (overall lit timeout)
  * --max-failures

This is part of a larger effort to ensure that all discovered tests are
properly accounted for.

Add test for overall lit timeout feature (`--max-time` option) to
observe skipped tests.  Extend test for `--max-failures` option.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D77819
2020-04-10 15:13:30 -07:00
LLVM GN Syncbot 516a671b89 [gn build] Port ea11f4726f 2020-04-10 18:26:30 +00:00
LLVM GN Syncbot de3122a7e4 [gn build] Port 89f1321fe4 2020-04-10 15:51:31 +00:00
Jinsong Ji 6d7c25bbf9 [NFC][UpdateTestChecks] Fix typos in comments 2020-04-10 15:04:10 +00:00
Nico Weber 1bd70bcd50 [gn build] add scan-build target 2020-04-10 06:18:41 -04:00
Kang Zhang 8633ef0f43 [PowerPC][UpdateTestChecks] Remove the extra # when scrubbing loop comments
Summary:
The patch D63957 is to avoid empty string when scrubbing loop comments,
it will replace loop comments to a `#`, that's correct.
But if the line has something else not only loop comments, we will get
a extra `#`.
The patch is to remove the extra `#`.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D77357
2020-04-10 06:09:01 +00:00
John McCall 8423a6f363 Rename OptimalLayout to OptimizedStructLayout at Chris's request. 2020-04-10 00:14:20 -04:00
LLVM GN Syncbot 39caa68ae1 [gn build] Port 4275eb1331 2020-04-10 03:20:36 +00:00
LLVM GN Syncbot 0bcf2d8864 [gn build] Port 1229245df7 2020-04-10 00:51:20 +00:00
LLVM GN Syncbot 372cc5741e [gn build] Port a79b2fc44b 2020-04-09 22:50:22 +00:00
Kirill Naumov 6f85ec960b [Tools] Fixed bug with llvm/utils/chunk-print-before-all.py script.
Prior to the fix, the script was not annotating the first line of
chunk-0.ll. Because of that, a compilation with ./bin/opt was failing.

The extra if-statement ensures that the corner case is covered

Reviewed-By: apilipenko

Differential Revision: https://reviews.llvm.org/D76507
2020-04-09 22:24:55 +00:00
LLVM GN Syncbot f355e15104 [gn build] Port 44f0d7f136 2020-04-09 11:26:04 +00:00
LLVM GN Syncbot 61151500aa [gn build] Port a0275705bb 2020-04-09 10:13:53 +00:00
LLVM GN Syncbot 84e6d3ca08 [gn build] Port a3dc949000 2020-04-09 05:18:49 +00:00
Johannes Doerfert 0985554b70 [Attributor][NFC] Split AbstractAttributes out of Attributor.cpp
Attributor.cpp became quite big and we need to start provide structure.
The Attributor code is now in Attributor.cpp and the classes derived
from AbstractAttribute are in AttributorAttributes.cpp. Minor changes
were required but no intended functional changes.

We also minimized includes as part of this.

Reviewed By: baziotis

Differential Revision: https://reviews.llvm.org/D76873
2020-04-08 19:02:14 -05:00
LLVM GN Syncbot 072ec965e1 [gn build] Port 8b67853a83 2020-04-08 20:00:26 +00:00
Julian Lettner 0bc2eab6f5 [lit] Print slowest tests and time histogram before result groups 2020-04-07 22:19:50 -07:00
Julian Lettner 414745026c [lit] Improve test summary output
This change aligns the test summary output along the longest
category label.  We also properly align test counts.

Before:
```
Testing Time: 10.30s
  Unsupported Tests  : 1
  Expected Passes    : 30
```

After:
```
Testing Time: 10.29s
  Unsupported Tests:  1
  Expected Passes  : 30
```
2020-04-07 22:19:50 -07:00
LLVM GN Syncbot b21bfcca4a [gn build] Port f85ae058f5 2020-04-08 04:48:03 +00:00
Julian Lettner 09f345080e [lit] Print slowest test first when timing tests
lit supports `--time-tests` which will report the 20 slowest tests and
print a nice histogram for test times.  This change prints this list and
the histogram rows by decreasing test times.  After all, we are most
interested in the slowest tests.
2020-04-07 18:18:33 -07:00
Julian Lettner 2ac96d61c2 [lit] Improve consistency when printing test results 2020-04-07 18:12:18 -07:00
LLVM GN Syncbot 6fa0d0ae11 [gn build] Port 1adeeabb79 2020-04-07 23:30:51 +00:00
LLVM GN Syncbot 1a28d33f37 [gn build] Port 88c2137b6d 2020-04-07 18:26:53 +00:00
Julian Lettner eb5ca295d7 [lit] Cleanup printing of discovered suites and tests 2020-04-07 10:39:35 -07:00
Nico Weber 448b777b86 Stop passing site cfg files via --param to llvm-lit.
This has been unnecessary since https://reviews.llvm.org/D37756.

https://reviews.llvm.org/D37838 removed it for llvm.

This removes it from clang, lld, clang-tools-extra (and the GN build).

No intended behavior change.

Differential Revision: https://reviews.llvm.org/D77585
2020-04-07 08:20:40 -04:00
Julian Lettner 38edab1c40 [lit] Improve handling of parallelism group semaphores 2020-04-06 20:52:06 -07:00
Nico Weber e613f0ee8d Reland "Make llvm_source_root in llvm-lit relative too."
This reverts commit 3185881d69
and adds a missing "include(AddLLVM)" (similar lines already
exist elsewhere in compiler-rt).
2020-04-06 20:49:10 -04:00
Hubert Tong 3185881d69 Revert "Make llvm_source_root in llvm-lit relative too."
This reverts commit 6c1a9fb174.

Commit causes failures:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/49206
2020-04-06 17:29:49 -04:00
Nico Weber 0c9f750a13 [gn build] (manually) port 6c1a9fb174 2020-04-06 16:50:12 -04:00
Nico Weber 6c1a9fb174 Make llvm_source_root in llvm-lit relative too.
No intended behavior change.
2020-04-06 16:47:25 -04:00
Nico Weber cc54466dd9 Delete a variable that's been unused since r313407.
No intended behavior change.
2020-04-06 15:33:50 -04:00
LLVM GN Syncbot f32d4161db [gn build] Port 427c1dc4f4 2020-04-06 19:22:43 +00:00
Louis Dionne 8a42bf24ae [lit] Move the recursiveExpansionLimit setting to TestingConfig
The LitConfig is shared across the whole test suite. However, since
enabling recursive expansion can be a breaking change for some test
suites, it's important to confine the setting to test suites that
enable it explicitly.

Note that other issues were raised with the way recursiveExpansionLimit
operates. However, this commit simply moves the setting to the right
place -- the mechanism by which it works can be improved independently.

Differential Revision: https://reviews.llvm.org/D77415
2020-04-06 13:58:00 -04:00
LLVM GN Syncbot 6ddc525667 [gn build] Port 00a5755897 2020-04-06 17:54:02 +00:00
Nico Weber 2e1afe5232 try to fix tsan bot 2020-04-06 10:47:41 -04:00
Nico Weber d4638cbad7 Make paths in generated llvm-lit relative as well.
This builds on top of D77184. With this, I can rename my build directory
to a different name and `bin/llvm-lit ../llvm-project/clang/test
../llvm-project/llvm/test` still succeeds.

I haven't tried copying the build dir to a different machine to run
tests there yet, but I tried something like it a few months ago and it
worked back then.

Changes:
- Make configure_lit_site_cfg() store the main / generated config pair
  interleaved in the LLVM_LIT_CONFIG_FILES list and postpone converting
  it to python code to llvm-lit's CMakeList.
- Pull the relpath code into a new function make_paths_relative() and
  call that in llvm-lit's CMakeList, prior to converting the list to
  python code.
- Pull the path() function into a variable and use that in llvm-lit's
  CMakeList too.

Differential Revision: https://reviews.llvm.org/D77496
2020-04-06 09:18:23 -04:00
Lang Hames 1b39c6f62c [ORC] Add MachO universal binary support to StaticLibraryDefinitionGenerator.
Add a new overload of StaticLibraryDefinitionGenerator::Load that takes a triple
argument and supports loading archives from MachO universal binaries in addition
to regular archives.

The LLI tool is updated to use this overload.
2020-04-05 20:21:05 -07:00
LLVM GN Syncbot f9b570fbcf [gn build] Port 1d42c0db9a 2020-04-04 00:07:07 +00:00
LLVM GN Syncbot 275ee5d251 [gn build] Port c74dd640fd 2020-04-03 20:07:19 +00:00
Julian Lettner 6f8c45067b [lit] Cleanly exit on user keyboard interrupt
Graceful lit shutdown on user keyboard interrupt [Ctrl+C] was a
longstanding goal of mine.  After a few refactorings this revision
finally enables it.  We use the following strategy to deal with
KeyboardInterrupt:
https://noswap.com/blog/python-multiprocessing-keyboardinterrupt

Printing of a helpful summary for interrupted runs (just as the one for
completed runs) will be tackled in future revisions.

Reviewed By: serge-sans-paille, rnk

Differential Revision: https://reviews.llvm.org/D77365
2020-04-03 13:03:44 -07:00
LLVM GN Syncbot b947a84699 [gn build] Port f95a67d8b8 2020-04-03 19:47:51 +00:00
LLVM GN Syncbot 0a173fd9a5 [gn build] Port d65557d15d 2020-04-03 13:41:09 +00:00
LLVM GN Syncbot 0cfdce26ea [gn build] Port 71e8021d82 2020-04-03 04:56:02 +00:00
Julian Lettner 022f1e2cc8 [lit] Refine filter error handling
Picking a default filter `.*` that matches everything lets us streamline
some error handling code.
2020-04-02 14:45:54 -07:00
Julian Lettner cab904c6d3 [lit] Remove unnecessary indirection in progress_callback
On shutdown, the result complete handler is not racing with the main
thread anymore because we are now always waiting for process pool
termination via
```
  finally:
    pool.join()
```
2020-04-02 14:45:54 -07:00
Duncan P. N. Exon Smith 0c85c488e2 utils: Tweak clang-parse-diagnostics-file for modules includes
Diagnostics from modules do not have a `main-file` listed.  Tweak
`clang-parse-diagnostics-file` to patch this up.  Previously, the call
to `os.path.basename` would crash.

Radar-Id: rdar://problem/59000292
2020-04-02 14:16:26 -07:00
Nico Weber a16ba6fea2 Reland "Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang"
The problem on Windows was that the \b in "..\bin" was interpreted
as an escape sequence. Use r"" strings to prevent that.

This reverts commit ab11b9eefa,
with raw strings in the lit.site.cfg.py.in files.

Differential Revision: https://reviews.llvm.org/D77184
2020-04-02 16:12:03 -04:00
Fangrui Song 6acd300375 Reland D75382 "[lld] Initial commit for new Mach-O backend"
With a fix for http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/3636

Also trims some unneeded dependencies.
2020-04-02 12:03:43 -07:00
Nico Weber ab11b9eefa Revert "Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang"
This reverts commit fb80b6b2d5 and
follow-up 631ee8b24a.

Seems to not work on Windows:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/31684
http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/6512

Let's revert while I investigate.
2020-04-02 15:00:09 -04:00
Nico Weber fb80b6b2d5 Make it possible for lit.site.cfg to contain relative paths, and use it for llvm and clang
Currently, all generated lit.site.cfg files contain absolute paths.

This makes it impossible to build on one machine, and then transfer the
build output to another machine for test execution. Being able to do
this is useful for several use cases:

1. When running tests on an ARM machine, it would be possible to build
   on a fast x86 machine and then copy build artifacts over after building.

2. It allows running several test suites (clang, llvm, lld) on 3
   different machines, reducing test time from sum(each test suite time) to
   max(each test suite time).

This patch makes it possible to pass a list of variables that should be
relative in the generated lit.site.cfg.py file to
configure_lit_site_cfg(). The lit.site.cfg.py.in file needs to call
`path()` on these variables, so that the paths are converted to absolute
form at lit start time.

The testers would have to have an LLVM checkout at the same revision,
and the build dir would have to be at the same relative path as on the
builder.

This does not yet cover how to figure out which files to copy from the
builder machine to the tester machines. (One idea is to look at the
`--graphviz=test.dot` output and copy all inputs of the `check-llvm`
target.)

Differential Revision: https://reviews.llvm.org/D77184
2020-04-02 13:53:16 -04:00
LLVM GN Syncbot 2e9d223dba [gn build] Port c00cb76274 2020-04-02 16:36:36 +00:00
LLVM GN Syncbot 7ea64499bf [gn build] Port 24bb2d1e77 2020-04-02 16:36:35 +00:00