1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
Commit Graph

8928 Commits

Author SHA1 Message Date
Guillaume Chatelet
f6fc4bd10b [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
269f60d02e NFC: Formatting fix in TableGEn/OptParserEmitter.cpp 2020-06-05 10:51:10 +01:00
LLVM GN Syncbot
76c6e46a0d [gn build] Port e53f5580578 2020-06-04 17:56:21 +00:00
LLVM GN Syncbot
548f790d0e [gn build] Port c973ad1878f 2020-06-04 17:56:21 +00:00
LLVM GN Syncbot
403aff8065 [gn build] Port ba2a01645b5 2020-06-04 17:56:20 +00:00
LLVM GN Syncbot
4ca0e4c2fe [gn build] Port 69fa84a6e95 2020-06-04 17:56:20 +00:00
LLVM GN Syncbot
79249979c7 [gn build] Port 6756a2c9533 2020-06-04 17:56:19 +00:00
LLVM GN Syncbot
8107fad723 [gn build] Port 49a4f3f7d88 2020-06-04 17:56:19 +00:00
Fangrui Song
732a71a860 [gn build] Port b5fc1deb5ba1f3cd432ecb8b86c2536470463163 2020-06-04 09:22:59 -07:00
Denis Antrushin
99d7b2a3a2 [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
5c6a96f031 [gn build] Port 48cd9d9dd86 2020-06-04 12:56:45 +00:00
Nico Weber
d1ee7e0d1c [gn build] port some -Wno flags for gcc from the cmake build. 2020-06-04 08:10:29 -04:00
LLVM GN Syncbot
681892253c [gn build] Port e636e6b79ac 2020-06-03 21:16:03 +00:00
LLVM GN Syncbot
d54ef3e6c9 [gn build] Port 7f50c15be5c 2020-06-03 21:16:02 +00:00
Nico Weber
3ece07dc76 [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
8de1b296de [gn build] Port add51e152aa 2020-06-03 10:50:20 +00:00
LLVM GN Syncbot
d96290b617 [gn build] Port 755a8959152 2020-06-03 08:27:24 +00:00
LLVM GN Syncbot
0638ffd642 [gn build] Port f99d5f8c32a 2020-06-02 20:36:52 +00:00
dstuttar
11327a08da [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
50523c63f4 [gn build] (manually) port 44f989e7809 2020-06-02 08:18:42 -04:00
Sanjay Patel
804d4bd875 [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
6f003d58d9 [gn build] (semi-manually) port a8ca0ec2670 2020-05-31 22:06:11 -04:00
Sanjay Patel
2ca9a76699 [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
5fe4b2e043 [gn build] Port cf6cc662eee 2020-05-29 23:53:23 +00:00
LLVM GN Syncbot
c3d7034d49 [gn build] Port 34cfed24ebd 2020-05-29 23:53:22 +00:00
Nico Weber
04ebb19444 [gn build] (manually) port 0e265e31578 2020-05-29 19:49:11 -04:00
Louis Dionne
47070492b5 [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
b93f22afc2 [gn build] Port a6deaeec370 2020-05-29 03:47:15 +00:00
LLVM GN Syncbot
08b2f1da9b [gn build] Port 7cfdff7b4a6 2020-05-28 16:49:43 +00:00
Cullen Rhodes
c219487139 [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
a688a48908 [gn build] Port 5921782f744 2020-05-28 08:08:39 +00:00
LLVM GN Syncbot
ff792d0b41 [gn build] Port 660cda572d6 2020-05-28 02:47:12 +00:00
Fangrui Song
48475697c0 [gn build] Add MLAnalysisTests after D80579 2020-05-27 17:21:05 -07:00
Fangrui Song
14bc926139 [gn build] Port D80579 2020-05-27 17:12:12 -07:00
Michael Liao
13be0b6424 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
e47439baae 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
86ef92541e [gn build] Port 0d20ed664ff 2020-05-27 16:41:00 +00:00
Nico Weber
4ccba34366 [gn build] (manually) port dedaf3a2ac5 2020-05-27 12:31:59 -04:00
Ties Stuij
f14df40a71 [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
4ee1151142 [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
e3bc7c71ba [gn build] Port d70ec366c91 2020-05-26 17:56:17 +00:00
Daniel Frampton
a847c4e14a 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
779e563e6f [gn build] Port ba92b274225 2020-05-25 18:14:50 +00:00
Matt Arsenault
00f5ca799d 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
3e0dd903f1 Revert "[gn build] Port 14d358537f1"
This reverts commit a0c7108b99f834cd7571ae57872116a4ef2682d9.
2020-05-23 13:51:07 +02:00
LLVM GN Syncbot
c534a27833 [gn build] Port 14d358537f1 2020-05-23 11:05:09 +00:00
Stephen Neuendorffer
b899bacfbc Reapply "[lit] GoogleTest framework should report failures if test binary crashes"
This reverts commit 78dea0e8fb6cc5c0fae64d65b7f40560cab7b329.

The offending lldb test (which is a real bug exposed by this patch)
has been disabled on windows (see a67b2faa7c4cfbceffb4213f46769c45a5a9291a)
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
23c2f4acc8 [gn build] Port 2e40cf06df0 2020-05-22 04:58:19 +00:00
Nico Weber
2806221b83 [gn build] (manually) port 49a4f3f7d88 2020-05-21 23:09:18 -04:00
LLVM GN Syncbot
d9ef95eb07 [gn build] Port 54e91a3c701 2020-05-21 23:43:28 +00:00
LLVM GN Syncbot
837832af2a [gn build] Port 92fd3971e0d 2020-05-21 18:20:26 +00:00
Jonas Devlieghere
769a6f0193 Revert "[lit] GoogleTest framework should report failures if test binary crashes"
This reverts commit ef2103182244c96f5206b02164b62b9c9e0cbce8 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
d464efe516 [gn build] Port d9a4a244138 2020-05-21 00:30:02 +00:00
Stephen Neuendorffer
fb36a60665 [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
3a4cea3f74 [gn build] Port bcbd26bfe61 2020-05-20 09:58:47 +00:00
Nico Weber
f292439160 [gn build] Try harder to unbreak Windows build after f8e833a501. 2020-05-19 17:14:08 -04:00
Nico Weber
9846f00871 [gn build] Try to unbreak Windows build after f8e833a501. 2020-05-19 16:14:04 -04:00
Sébastien Marchand
5acc4e3b48 [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
b8f2bd0df3 [gn build] Port bcc0c894f38 2020-05-19 06:07:14 +00:00
LLVM GN Syncbot
c8b778bfd6 [gn build] Port 62a9eca859d 2020-05-19 05:18:58 +00:00
LLVM GN Syncbot
8ff874aead [gn build] Port e7e84ff24a5 2020-05-19 02:41:51 +00:00
LLVM GN Syncbot
8d5e57fd01 [gn build] Port 9d69072fb80 2020-05-18 22:19:17 +00:00
Nico Weber
7b857d8924 [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
f9d3b095c9 [NFC] Whitespace fix inside OptParserEmitter 2020-05-15 11:27:13 -07:00
LLVM GN Syncbot
b3ce3d8512 [gn build] Port 6b01b465388 2020-05-15 15:13:18 +00:00
Machiel van Hooren
086582cdf8 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
09c1b93999 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
6f91b843f2 [gn build] Port 2b7fe0863ac 2020-05-14 21:21:41 +00:00
LLVM GN Syncbot
648d085229 [gn build] Port 42a55605034 2020-05-14 17:59:56 +00:00
Pete Steinfeld
f0ebfa87e8 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
48fecb2d18 [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
f717458fdf [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
14293748bd [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 f8d044bbcfdc9e1ddc02247ffb86fe39e1f277f0 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
b000ffc696 [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
b70556d176 [gn build] Use relative paths in generated lit.site.cfg.py files for llvm and clang.
This ports a16ba6fea2e554f to the GN build.

No intended behavior change.
2020-05-11 20:58:45 -04:00
Joel E. Denny
cbd9bd8f7e Revert "[FileCheck] Make invalid prefix diagnostics more precise"
This reverts commit a78e13745d4ee4a42e41ebbe698159f651515fc5 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
2412893f8a Revert "[FileCheck] Support comment directives"
This reverts commit 9a9a5f9893c8db05cebc8818eb8485bff61f7c74 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
2e90998173 [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
f35557899b [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
92c330d982 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ö
183b44f305 [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 bc8e44218810c0db6328b9809c959ceb7d43e3f5.
2020-05-11 23:51:14 +03:00
LLVM GN Syncbot
77df5b2390 [gn build] Port e97a3e5d9d4 2020-05-11 20:09:12 +00:00
Joel E. Denny
efde2f4800 [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
cfbaeca35c [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
6c9d2b0609 [gn build] (manually) port bba38de50c9 2020-05-11 13:46:21 -04:00
LLVM GN Syncbot
2335724fe5 [gn build] Port bf95cf4a681 2020-05-11 16:35:33 +00:00
Zola Bridges
e8f3b2a2f3 [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
c62f0dfec9 [gn build] Port 48fa355ed4b 2020-05-11 16:11:59 +00:00
LLVM GN Syncbot
1121238a83 [gn build] Port 35d867a790c 2020-05-10 11:04:15 +00:00
David Tenty
dc5f5241a9 [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
d7a7871a9b Unbreak clang-tidy tests after D79599 / e9b4113902850. 2020-05-08 12:37:33 -04:00
Nico Weber
784f6b5a79 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
a789997cb1 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
a04e836dc5 [gn build] Port e3ffe7269b6 2020-05-07 10:11:03 +00:00
Nico Weber
2c78fa68d7 [gn build] (manually) merge 07f8ca6ab19 2020-05-05 06:15:20 -04:00
Julian Lettner
bf1a04832c [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
e10b1c7564 [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
c074cdefc8 [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
7085467187 [gn build] Port e64f99c51a8 2020-05-03 12:08:26 +00:00
Nico Weber
36ca962385 [gn build] (manually) port ad97ccf6b26a more, for include added in e64f99c51a8 2020-05-03 08:07:52 -04:00
Nico Weber
c540e1ca3f [gn build] Port 8f766e382b77e 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
d9e54390e0 [gn build] Port fa1f4cf8432 2020-05-02 12:54:28 +00:00
Julian Lettner
18b974f8de [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
08d05ef4bc [lit] Extract by_suite_and_test_path sort key function 2020-05-01 17:03:55 -07:00
Julian Lettner
36dc482004 [lit] Create report generators during argument parsing 2020-05-01 17:03:55 -07:00
Julian Lettner
c62715658f [lit] Small refinements for xunit report output 2020-05-01 17:03:55 -07:00
Julian Lettner
8c252224cc [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
63e5e7b26a [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
c626aa36ec [gn build] Port 6cb073133c5 2020-05-02 00:00:04 +00:00
Julian Lettner
5f254f88ba [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
8760dcd6cf [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
c74ac5ecb6 [gn build] Port cfea3dc1021 2020-04-30 22:15:14 +00:00
Julian Lettner
d8f1064fae [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
65362574e7 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
5d3d0aa563 [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
c4aa35950b [gn build] Port 9854edd817c 2020-04-29 22:52:50 +00:00
Nico Weber
7d27d0c9d0 [gn build] (manually) port ad97ccf6b26a 2020-04-29 11:51:22 -04:00
Nico Weber
931dacf0e0 Reland "[gn build] (manually) merge c4c3883"
The Python3 change relanded yet again, so merge it yet again.

This reverts commit f0019cdc47f59e94b9bc3291b83a9b4cec1bf62b.
This reverts commit 854a7db46c0a9750d9d9f932d5d49c3d64a85153.
2020-04-28 21:43:58 -04:00
LLVM GN Syncbot
3d60a5a4e0 [gn build] Port 8683f5de535 2020-04-29 00:53:06 +00:00
Nico Weber
d17a3fee6f [gn build] fix typo 2020-04-28 20:52:51 -04:00
Nico Weber
3c883f5963 Revert "[gn build] (manually) merge c4c3883"
This reverts commit cbaa74a0981833537e88a8eeac9c9df0f528833c.
The Py3 change got (mostly, except compiler-rt) reverted again.
2020-04-28 20:48:29 -04:00
Reid Kleckner
78563b8158 [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
9865602ea1 Revert "[gn build] (manually) merge cd84bfb8142bc7ff3a0"
This reverts commit 825f583c86ca856e930b434c6e3462398461eb9a.
This reverts commit 45417ecbc1cddb667d044c709ee980c9426d5eb2.

cd84bfb8142bc7ff3a0 was reverted in be884b79352de89
2020-04-27 23:31:46 -04:00
Nico Weber
e996644e2f [gn build] (manually) merge cd84bfb8142bc7ff3a0 more precisely 2020-04-27 21:55:02 -04:00
Nico Weber
5ca1d4fdcc [gn build] (manually) merge cd84bfb8142bc7ff3a0 2020-04-27 21:45:58 -04:00
Nico Weber
f91590220f Revert "[gn build] (manually) merge 811c0c9eb46"
This reverts commit b160e9e5394ca1f52a94b5f44c3610567b7bb420.
811c0c9eb46 was reverted in 96717125e852.
2020-04-27 09:00:21 -04:00
Nico Weber
5f69f7f199 [gn build] (manually) merge 811c0c9eb46 2020-04-27 06:39:40 -04:00
Benjamin Kramer
6c1cc25022 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
9d80c8826f llvm-tblgen -gen-dag-isel: Hoist SmallVector TmpBuf 2020-04-25 20:41:04 -07:00
Fangrui Song
8a65a8b210 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
f88ef63bc2 [X86] Shrink lib/Target/X86/X86GenDisassemblerTables.inc
6330853 bytes -> 5207842 bytes
2020-04-25 19:44:32 -07:00
Nico Weber
948c22b786 [gn build] update two comments 2020-04-24 11:52:49 -04:00
LLVM GN Syncbot
8f4d6745a5 [gn build] Port 7aaff8fd2da 2020-04-24 15:06:14 +00:00
Nico Weber
124fdff49d [gn build] minimally merge 67b2dbd5a33583fe148fd12 even more 2020-04-24 11:05:58 -04:00
Nico Weber
745f48bf35 [gn build] minimally merge 67b2dbd5a33583fe148fd12 more 2020-04-24 10:23:22 -04:00
Nico Weber
e4591aa54e [gn build] minimally merge 67b2dbd5a33583fe148fd12 2020-04-24 09:58:19 -04:00
Nico Weber
081145a3ea [gn build] (manually) merge 8f766e382b77eef in a minimal way 2020-04-24 09:33:35 -04:00
Alex Richardson
425ae3721b [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
85fa188140 [gn build] Port 23609331472 2020-04-21 23:36:07 +00:00
LLVM GN Syncbot
2fd1216c39 [gn build] Port 352fef3f11f 2020-04-21 21:22:08 +00:00
LLVM GN Syncbot
e202557326 [gn build] Port 060efd24c7f 2020-04-21 21:22:07 +00:00
LLVM GN Syncbot
26f7fe74a1 [gn build] Port 2214b9076f1 2020-04-21 08:34:22 +00:00
Sriraman Tallam
a427ed091b 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
c35192c3a0 [gn build] Port 12030494fce 2020-04-20 13:10:45 +00:00
Georgii Rymar
f2e06d7e57 [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
54333e55dd [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
2f34a6844a [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
6ea6ceec29 [gn build] Port 66037b84cf5 2020-04-17 22:33:56 +00:00
LLVM GN Syncbot
e054c3e72f [gn build] Port ff9379f4b2d 2020-04-17 09:27:53 +00:00
LLVM GN Syncbot
4ca1ec485b [gn build] Port 953a814aae4 2020-04-17 00:58:15 +00:00