Commit Graph

9145 Commits

Author SHA1 Message Date
LLVM GN Syncbot 0c4ea27510 [gn build] Port 276f9e8cfa 2020-07-29 17:37:10 +00:00
Valentin Clement e8d4038efb [openmp][openacc][NFC] Add wrapper for records in DirectiveEmitter
Add wrapper classes to to access record's fields. This makes it easier to
pass record information to the diverse functions for code generation.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D84612
2020-07-28 20:47:40 -04:00
Joel E. Denny d680711b94 [FileCheck] Extend -dump-input with substitutions
Substitutions are already reported in the diagnostics appearing before
the input dump in the case of failed directives, and they're reported
in traces (produced by `-vv -dump-input=never`) in the case of
successful directives.  However, those reports are not always
convenient to view while investigating the input dump, so this patch
adds the substitution report to the input dump too.  For example:

```
$ cat check
CHECK: hello [[WHAT:[a-z]+]]
CHECK: [[VERB]] [[WHAT]]

$ FileCheck -vv -DVERB=goodbye check < input |& tail -8
<<<<<<
           1: hello world
check:1       ^~~~~~~~~~~
           2: goodbye word
check:2'0     X~~~~~~~~~~~ error: no match found
check:2'1                  with "VERB" equal to "goodbye"
check:2'2                  with "WHAT" equal to "world"
>>>>>>
```

Without this patch, the location reported for a substitution for a
directive match is the directive's full match range.  This location is
misleading as it implies the substitution itself matches that range.
This patch changes the reported location to just the match range start
to suggest the substitution is known at the start of the match.  (As
in the above example, input dumps don't mark any range for
substitutions.  The location info in that case simply identifies the
right line for the annotation.)

Reviewed By: mehdi_amini, thopre

Differential Revision: https://reviews.llvm.org/D83650
2020-07-28 19:15:18 -04:00
Varun Gandhi 417d3d495f [docs] [lit] Add a more helpful description for lit.py's -s flag.
Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D82808
2020-07-28 14:36:03 -07:00
Roman Lebedev e1dd212c87
[X86] Remove disabled miscompiling X86CondBrFolding pass
As briefly discussed in IRC with @craig.topper,
the pass is disabled basically since it's original introduction (nov 2018)
due to  known correctness issues (miscompilations),
and there hasn't been much work done to fix that.

While i won't promise that i will "fix" the pass,
i have looked at it previously, and i'm sure i won't try to fix it
if that requires actually fixing this existing code.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D84775
2020-07-28 23:35:04 +03:00
Fangrui Song 26fc91eb5d Revert "[gn build] (manually) merge d054c7ee2e9"
This reverts commit ab73b6da95.
2020-07-28 13:30:29 -07:00
Jinsong Ji d28f86723f Re-land "[PowerPC] Remove QPX/A2Q BGQ/BGP CNK support"
This reverts commit bf544fa1c3.

Fixed the typo in PPCInstrInfo.cpp.
2020-07-28 14:00:11 +00:00
Anirudh Prasad d3557ecede [Support] Use InitLLVM in llvm-stress, sancov and TableGen
This patch refactors the llvm tools namely, llvm-stress and sancov,
as well as the llvm TableGen utility, to use the new InitLLVM
interface which encapsulates PrettyStackTrace.

This is from https://reviews.llvm.org/D70702, but only for LLVM.

Reviewed-by: Kai

Differential Revision: https://reviews.llvm.org/D83484
2020-07-28 07:50:45 -04:00
Matt Arsenault 930fc0b300 TableGen: Check if pattern outputs matches instruction defs
Attempt to fix address sanitizer bots when building ARM.
2020-07-27 21:08:40 -04:00
Matt Arsenault ee3feef5aa TableGen/GlobalISel: Allow output instructions with multiple defs
The DAG behavior allows matchching input patterns with a single result
to the first result of an output instruction that defines multiple
results. The remaining defs are implicitly dead.

This starts to fix using manual selection for AMDGPU add/sub (although
it's still needed, mostly because it's also still needed for
G_PTR_ADD).
2020-07-27 18:31:13 -04:00
Jinsong Ji bf544fa1c3 Revert "[PowerPC] Remove QPX/A2Q BGQ/BGP CNK support"
This reverts commit adffce7153.

This is breaking test-suite, revert while investigation.
2020-07-27 21:07:00 +00:00
Jinsong Ji adffce7153 [PowerPC] Remove QPX/A2Q BGQ/BGP CNK support
Per RFC http://lists.llvm.org/pipermail/llvm-dev/2020-April/141295.html
no one is making use of QPX/A2Q/BGQ/BGP CNK anymore.

This patch remove the support of QPX/A2Q in llvm, BGQ/BGP in clang,
CNK support in openmp/polly.

Reviewed By: hfinkel

Differential Revision: https://reviews.llvm.org/D83915
2020-07-27 19:24:39 +00:00
LLVM GN Syncbot e77ff4abb3 [gn build] Port ee7caa7593 2020-07-27 16:45:49 +00:00
Nico Weber b6902d977a [gn build] Make syncing to single-line source files work after 1afd889d0b 2020-07-27 12:44:47 -04:00
Nico Weber 52dd18ab1d [gn build] (manually) merge 48c948abeb 2020-07-27 12:30:09 -04:00
Jon Roelofs 88ce9f9b44 [TableGen][CGS] Print better errors on overlapping InstRW
Differential Revision: https://reviews.llvm.org/D83588
2020-07-27 09:41:10 -06:00
Logan Smith a52aea0ba6 Use INTERFACE_COMPILE_OPTIONS to disable -Wsuggest-override for any target that links to gtest
This cleans up several CMakeLists.txt's where -Wno-suggest-override was manually specified. These test targets now inherit this flag from the gtest target.

Some unittests CMakeLists.txt's, in particular Flang and LLDB, are not touched by this patch. Flang manually adds the gtest sources itself in some configurations, rather than linking to LLVM's gtest target, so this fix would be insufficient to cover those cases. Similarly, LLDB has subdirectories that manually add the gtest headers to their include path without linking to the gtest target, so those subdirectories still need -Wno-suggest-override to be manually specified to compile without warnings.

Differential Revision: https://reviews.llvm.org/D84554
2020-07-27 08:37:01 -07:00
Sergej Jaskiewicz 4dd5c2bee3 [lit] Don't expand escapes until all substitutions have been applied
Otherwise, if a Lit script contains escaped substitutions (like %%p in this test https://github.com/llvm/llvm-project/blob/master/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-with-module-map.cpp#L10), they are unescaped during recursive application of substitutions, and the results are unexpected.

We solve it using the fact that double percent signs are first replaced with #_MARKER_#, and only after all the other substitutions have been applied, #_MARKER_# is replaced with a single percent sign. The only change is that instead of replacing #_MARKER_# at each recursion step, we replace it once after the last recursion step.

Differential Revision: https://reviews.llvm.org/D83894
2020-07-27 18:09:00 +03:00
Hans Wennborg 0de629d7ae [gn] Set CLANGD_ENABLE_REMOTE=0
To fix the build after 37ac559fcc.
2020-07-27 14:05:03 +02:00
Alex Richardson 18df607dbe [lit] Don't include tests skipped due to sharding in reports
When running multiple shards, don't include skipped tests in the xunit
output since merging the files will result in duplicates.
In our CHERI Jenkins CI, I configured the libc++ tests to run using sharding
(since we are testing using a single-CPU QEMU). We then merge the generated
XUnit xml files to produce a final result, but if the individual XMLs
report tests excluded due to sharding each test is included N times in the
final result. This also makes it difficult to find the tests that were
skipped due to missing REQUIRES: etc.

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D84235
2020-07-26 11:39:22 +01:00
LLVM GN Syncbot 48c3228c5c [gn build] Port 136c8f50e9 2020-07-25 18:51:58 +00:00
David Truby 4ef2e594d5 [flang] Run non-gtest unit tests with lit.
Summary:
As a corrollary, these tests are now run as part of the check-flang
target.

Reviewers: sscalpone

Subscribers: mgorny, delcypher, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83946
2020-07-24 14:49:39 +01:00
Nico Weber 0bbaacc8ca [gn build] (manually) port 10b1b4a23 more 2020-07-24 08:48:14 -04:00
Nico Weber 2ad56119f5 [gn build] (manually) port 10b1b4a23 2020-07-24 08:37:57 -04:00
Nico Weber 0ed660f9e5 [gn build] (manually) port 228f8d89 2020-07-24 08:29:36 -04:00
Nico Weber ab73b6da95 [gn build] (manually) merge d054c7ee2e 2020-07-23 22:28:23 -04:00
LLVM GN Syncbot 23d1800433 [gn build] Port 92874d2866 2020-07-23 15:07:01 +00:00
Alex Richardson 722e5d6aae [lit] Include total elapsed time in xunit output
The time= attribute can also be used for the testsuites tag. While this
attribute appears to be ignored by Jenkins (bab34bcc96/src/main/java/hudson/tasks/junit/SuiteResult.java (L202)),
it is still useful if you manually inspect the xml file.

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D84230
2020-07-23 11:19:18 +01:00
Logan Smith 77e0e9e17d Reapply "Try enabling -Wsuggest-override again, using add_compile_options instead of add_compile_definitions for disabling it in unittests/ directories."
add_compile_options is more sensitive to its location in the file than add_definitions--it only takes effect for sources that are added after it. This updated patch ensures that the add_compile_options is done before adding any source files that depend on it.

Using add_definitions caused the flag to be passed to rc.exe on Windows and thus broke Windows builds.
2020-07-22 17:50:19 -07:00
LLVM GN Syncbot 23cc19d1cf [gn build] Port 13ad00be98 2020-07-22 23:32:03 +00:00
LLVM GN Syncbot bd9b223770 [gn build] Port 27650ec554 2020-07-22 23:08:46 +00:00
Logan Smith 97a0f80c46 Revert "Try enabling -Wsuggest-override again, using add_compile_options instead of add_compile_definitions for disabling it in unittests/ directories."
This reverts commit 388c9fb1af.
2020-07-22 15:07:01 -07:00
Logan Smith 388c9fb1af Try enabling -Wsuggest-override again, using add_compile_options instead of add_compile_definitions for disabling it in unittests/ directories.
Using add_compile_definitions caused the flag to be passed to rc.exe on Windows and thus broke Windows builds.
2020-07-22 14:19:34 -07:00
Nico Weber dfecad4ccf [gn build] Remove something I missed in 1afd889d0 2020-07-22 16:36:25 -04:00
LLVM GN Syncbot f3e667bf86 [gn build] Port 418121c30a 2020-07-22 18:37:02 +00:00
Louis Dionne afa1afd410 [CMake] Bump CMake minimum version to 3.13.4
This upgrade should be friction-less because we've already been ensuring
that CMake >= 3.13.4 is used.

This is part of the effort discussed on llvm-dev here:

  http://lists.llvm.org/pipermail/llvm-dev/2020-April/140578.html

Differential Revision: https://reviews.llvm.org/D78648
2020-07-22 14:25:07 -04:00
Hans Wennborg 3eec657825 Revert "Enable -Wsuggest-override in the LLVM build" and the follow-ups.
After lots of follow-up fixes, there are still problems, such as
-Wno-suggest-override getting passed to the Windows Resource Compiler
because it was added with add_definitions in the CMake file.

Rather than piling on another fix, let's revert so this can be re-landed
when there's a proper fix.

This reverts commit 21c0b4c1e8.
This reverts commit 81d68ad27b.
This reverts commit a361aa5249.
This reverts commit fa42b7cf29.
This reverts commit 955f87f947.
This reverts commit 8b16e45f66.
This reverts commit 308a127a38.
This reverts commit 274b6b0c7a.
This reverts commit 1c7037a2a5.
2020-07-22 20:23:58 +02:00
Nico Weber d074749423 [gn build] (manually) port 746b5fad5b 2020-07-22 14:10:17 -04:00
LLVM GN Syncbot a1d99aff7c [gn build] Port a5e0194709 2020-07-22 16:56:06 +00:00
LLVM GN Syncbot 28e0298d1d [gn build] Port 2a6c871596 2020-07-22 16:56:05 +00:00
Fangrui Song 0788ba0066 [gn build] Handle X86InstCombineIntrinsic.cpp in 2a6c871596 2020-07-22 09:49:27 -07:00
Fangrui Song 88ba9fa6a4 [gn build] Port 2a6c871596 & 44a6bda19b 2020-07-22 09:40:50 -07:00
David Green f8abecf337 [ARM] Extra MVE select(binop) patterns
This is very similar to 243970d03cace2, but handling a slightly
different form of predicated operations. When starting with a pattern of
the form select(p, BinOp(x, y), x), Instcombine will often transform
this to BinOp(x, select(p, y, 0)), where 0 is the identity value of the
binop (0 for adds/subs, 1 for muls, -1 for ands etc). This adds the
patterns that transforms those back into predicated binary operations.

There is also a very minor adjustment to tablegen null_frag in here, to
allow it to also be recognized as a PatLeaf node, so that it can be used
in MVE_TwoOpPattern to easily exclude the cases where we do not need the
alternate transform.

Differential Revision: https://reviews.llvm.org/D84091
2020-07-22 14:08:29 +01:00
Marcel Hlopko b49d47f6a0 Make lit TestRunner.py work in Python 3
Summary: In Python3 SubstituteCaptures are no longer converted to String implicitly behind the scenes. Converting explicitly makes the TestRunner to work in Python3.

Reviewers: gribozavr2, compnerd

Reviewed By: gribozavr2

Subscribers: tbkka, delcypher, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81361
2020-07-22 11:44:00 +02:00
Brian Cain cf55866185 [test-release] fallback to py3's venv module
If virtualenv is not available, we can look for py3's venv instead. We only
use this particular env for installing and running the test suite.
2020-07-21 19:51:15 -05:00
Nico Weber 4fe912f186 Build: Move TF source file inclusion from build system to source files
Outside of compiler-rt (where it's arguably an anti-pattern too),
LLVM tries to keep its build files as simple as possible. See e.g.
llvm/docs/SupportLibrary.rst, "Code Organization".

Differential Revision: https://reviews.llvm.org/D84243
2020-07-21 13:02:34 -04:00
Nico Weber e37b220442 [gn build] (manually) hack around 70f8d0ac8a 2020-07-21 06:35:36 -04:00
Logan Smith 8b16e45f66 Enable -Wsuggest-override in the LLVM build
This patch adds Clang's new (and GCC's old) -Wsuggest-override to the warning flags for the LLVM build. The warning is a stronger form of -Winconsistent-missing-override which warns _everywhere_ that override is missing, not just in places where it's inconsistent within a class.

Some directories in the monorepo need the warning disabled for compatibility's, or sanity's, sake; in particular, libcxx/libcxxabi, and any code implementing or interoperating with googletest, googlemock, or google benchmark (which do not themselves use override). This patch adds -Wno-suggest-override to the relevant CMakeLists.txt's to accomplish this.

Differential Revision: https://reviews.llvm.org/D84126
2020-07-20 12:32:47 -07:00
LLVM GN Syncbot c6f84ebf84 [gn build] Port e1270b16c9 2020-07-20 17:51:57 +00:00
Simon Pilgrim a0ed0e3fac CodeGenDAGPatterns.h - remove unnecessary ComplexPattern forward declaration. NFCI.
This is defined in CodeGenTarget.h which we have to explicitly include already.
2020-07-20 15:17:19 +01:00
Simon Pilgrim 93c338fd0f CodeGenDAGPatterns.h - remove unused CodeGenHwModes.h include. NFCI. 2020-07-20 15:17:18 +01:00
Simon Pilgrim 68a1cbe11a SubtargetFeatureInfo.h - remove unnecessary include and forward declarations. NFCI.
Move necessary include down to SubtargetFeatureInfo.cpp.
2020-07-20 13:39:24 +01:00
sstefan1 cf11050696 [Utils][Fix] remove unnecessary ; at the end 2020-07-19 20:48:28 +02:00
sstefan1 937bad3594 [Utils] Check function attributes in update_test_checks
Summary:
This introduces new flag to the update_test_checks and
update_cc_test_checks that allows for function attributes
to be checked in a check-line. If the flag is not set,
the behavior should remain the same.

Reviewers: jdoerfert

Subscribers: arichardson, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83629
2020-07-19 20:07:24 +02:00
Michael Spencer 7fcc1bb4b6 [clangd] Fix the build with clang <3.9.
In clang <3.9 the `unique_ptr` constructor that is supposed to allow
for Derived to Base conversion does not work. Remove this if we drop
support for such configurations.

This is the same fix as in fda901a987, and it updates the comments
to better reflect the actual issue. The same thing reproduces with
libc++ with older clangs.
2020-07-17 16:12:31 -06:00
Michael Spencer fda901a987 [Clang] Fix building with Clang < 3.9.
This is a workaround for a bug in older versions of Clang when. The
constructor that is supposed to allow for Derived to Base conversion
does not work. Remove this if we drop support for such configurations.
2020-07-17 13:33:15 -06:00
Nico Weber 9551ae22fc [gn build] Run `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format` 2020-07-17 12:31:42 -04:00
Nico Weber 16458b5a6d [gn build] (manually) merge 6c43ed608 2020-07-17 12:27:21 -04:00
Nico Weber 1afd889d0b [gn build] Make sync_source_lists_from_cmake handle one-line sources lines
sync_source_lists_from_cmake now also looks for source files in
`sources += [ "foo.cc" ]` lines, which allows us to remove most
`# Make `gn format` not collapse this` comments.

(sync_source_lists_from_cmake doesn't look for `foo_headers += [...]`
still, so the comment is still needed in two places for that.)

No intentional behavior change.
2020-07-17 11:53:42 -04:00
Nico Weber 63f0b10b8c [gn format] (manually) merge 6bddd099ac 2020-07-17 11:21:42 -04:00
LLVM GN Syncbot 6831f8ae58 [gn build] Port 6bddd099ac 2020-07-17 14:58:08 +00:00
LLVM GN Syncbot 8475981b30 [gn build] Port c7562e77b3 2020-07-17 14:38:56 +00:00
Hans Wennborg 033ef8420c Add -flang flag to the test-release.sh script
The flag is off by default.
2020-07-17 13:30:14 +02:00
Jay Foad 1cfb207737 [TableGen] Report an error instead of asserting
This gives a nice error if you accidentally try to use an empty list for
the RegTypes of a RegisterClass.

Differential Revision: https://reviews.llvm.org/D78285
2020-07-17 11:32:46 +01:00
LLVM GN Syncbot f6275ca256 [gn build] Port 9870f77441 2020-07-16 23:07:46 +00:00
LLVM GN Syncbot 75e2040e93 [gn build] Port 0f6220ddd6 2020-07-16 23:07:45 +00:00
LLVM GN Syncbot c1cc3a8652 [gn build] Port 0e940d55f8 2020-07-16 23:07:45 +00:00
Nico Weber 0beac5b815 [gn build] (manually) merge 9870f77441 2020-07-16 19:07:28 -04:00
serge-sans-paille 515bc8c155 Harmonize Python shebang
Differential Revision: https://reviews.llvm.org/D83857
2020-07-16 21:53:45 +02:00
LLVM GN Syncbot 4e2f72ce19 [gn build] Port 5e8b4be9f8 2020-07-16 19:08:09 +00:00
Nadav Rotem b3417d80ae [TableGen] Change std::vector to SmallVector
The size of VTList that is pushed into this container is usually 1, but
often 6 or 7. Change the vector to SmallVector to eliminate frequent
mallocs.  This happens hundreds of thousands of times in each tablegen
execution during the LLVM/clang build.

https://reviews.llvm.org/D83849
2020-07-16 11:32:44 -07:00
Nico Weber d9b7a18ebd [gn build] Fix merge script mishap 2020-07-16 13:46:45 -04:00
LLVM GN Syncbot c74cfd4045 [gn build] Port 1360e140cc 2020-07-16 16:14:13 +00:00
Craig Topper 71b49aa438 [X86] Allow lsl/lar to be parsed with a GR16, GR32, or GR64 as source register.
This matches GNU assembler behavior. Operand size is determined
only from the destination register.
2020-07-15 23:51:37 -07:00
LLVM GN Syncbot be8c59606d [gn build] Port 4a539faf74 2020-07-15 17:53:38 +00:00
Hans Wennborg 7ab7b979d2 Bump the trunk major version to 12
and clear the release notes.
2020-07-15 12:05:05 +02:00
LLVM GN Syncbot 670e8372b3 [gn build] Port 0750757e80 2020-07-15 02:13:43 +00:00
Nico Weber 75c0f0d762 [gn build] (manually) merge c1e2f73c 2020-07-14 20:43:59 -04:00
Louis Dionne eaca1e4e54 [libc++] Automatically detect whether RTTI is enabled
Instead of detecting it automatically but also allowing for the setting
to be specified explicitly, always detect whether exceptions are enabled
based on whether -fno-rtti (or equivalent) is used. It's less confusing
to have a single way of tweaking that knob.

This change follows the lead of 71d88cebfb.
2020-07-14 16:51:37 -04:00
Valentin Clement 0a90ffa772 [flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.

Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby

Reviewed By: klausler

Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits

Tags: #llvm, #flang

Differential Revision: https://reviews.llvm.org/D83649
2020-07-14 14:29:40 -04:00
Matt Arsenault 1254f6d531 TableGen/GlobalISel: Partially fix nontrivial, custom predicates
Currently custom code predicates can only really be used for
contextless checks tied to a single instruction (e.g. check the def
for hasOneUse). If you do want to inspect the input instructions in
the source pattern, you cannot without re-verifying the opcode and
type checks implied by the patterns, since this check was emitted
before any operand constraints. Really, these are pattern level
predicates that implicitly depend on the instruction and operand
checks.

Introduce a filtering function so the custom predicate is emitted
last. I'm not sure this is the most elegant solution. It seems like
this is really a different thing from the InstructionMatcher/IPM_
predicate kinds. I initially tried keeping this in a separate
predicate list, but that also seemed awkward.

This only half fixes the problem I'm trying to solve. The AMDGPU
pattern I'm attempting to port also uses the PredicateCodeUsesOperands
feature to allow checks on the source operands when the input pattern
is commuted. Really the emitter should reject the pattern since it
doesn't handle this case, but at this point it would be more
productive to just implement this.
2020-07-14 14:26:51 -04:00
Richard Barton f4476b72fb [lit] Prevent hang when lit sees non-ASCII characters
As per discussion in D69207, have lit ignore UnicodeDecodeErrors
when running with python 2 in an ASCII shell.

Differential Revision: https://reviews.llvm.org/D82754
2020-07-14 18:41:15 +01:00
Simon Tatham 86d362f489 [utils] New script `check_ninja_deps.py`
Summary:
This can be run after a ninja-based build, and analyzes the ninja
build files and dependency database to spot any missing dependencies
in the build scripts.

I wrote it in the course of investigating D82659, and it seems likely
to be useful again.

Reviewers: thakis, chandlerc, theraven

Reviewed By: thakis

Subscribers: riccibruno, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83032
2020-07-14 14:54:08 +01:00
LLVM GN Syncbot 3ae9f5d179 [gn build] Port dd6faf13d8 2020-07-14 09:36:07 +00:00
LLVM GN Syncbot 242a736a14 [gn build] Port c15e04ee5e 2020-07-14 09:31:18 +00:00
LLVM GN Syncbot b8460fb2cd [gn build] Port caf395ee8c 2020-07-13 23:39:28 +00:00
LLVM GN Syncbot 540277d084 [gn build] Port 9908a3b9f5 2020-07-13 20:18:59 +00:00
LLVM GN Syncbot c1efd6675a [gn build] Port fdb69539bc 2020-07-13 18:10:37 +00:00
Matt Arsenault 2e2af6026b TableGen/GlobalISel: Emit enum names for reg class ID instead of value
This was emitting the raw value for the reg class ID with a comment
for the actual class name. Switch to emitting the qualified enum name
instead, which obviates the need for the comment and also helps keep
the lit tests on the emitter output more stable.
2020-07-13 14:02:08 -04:00
LLVM GN Syncbot 44899ed659 [gn build] Port 83080a294a 2020-07-13 17:19:05 +00:00
clementval 8f183d9f3d [openmp] Remove unused variable in DirectiveEmitter 2020-07-11 12:59:52 -04:00
Valentin Clement 6e42a417ba [flang][openmp] Check clauses allowed semantic with tablegen generated map
Summary:
This patch is enabling the generation of clauses enum sets for semantics check in Flang through
tablegen. Enum sets and directive - sets map is generated by the new tablegen infrsatructure for OpenMP
and other directive languages.
The semantic checks for OpenMP are modified to use this newly generated map.

Reviewers: DavidTruby, sscalpone, kiranchandramohan, ichoyjx, jdoerfert

Reviewed By: DavidTruby, ichoyjx

Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, aaron.ballman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83326
2020-07-11 12:45:12 -04:00
Nico Weber 09a95f51fb [gn build] (manually) merge 943660fd15 2020-07-11 06:44:28 -04:00
Nathan James 35af6f11e0
Reland Fix gn build after 943660f 2020-07-11 11:42:05 +01:00
Nathan James 8fb91dfeed Revert "Fix gn builds after 943660fd1"
This reverts commit 4abdcdb45e.
2020-07-11 10:45:17 +01:00
Nathan James 4abdcdb45e
Fix gn builds after 943660fd1 2020-07-11 10:42:57 +01:00
Valentin Clement 7b67bc16ef [openmp] Fix warning in generated OMP.cpp 2020-07-10 21:13:12 -04:00
Valentin Clement 943660fd15 [openmp] Remove OMPConstants.cpp and replace it by OMP.cpp generated by tablegen
Summary:
Diff D83176 moved the last piece of code from OMPConstants.cpp and now this file was only
useful to include the tablegen generated file. This patch replace OMPConstants.cpp with OMP.cpp
generated by tablegen.

Reviewers: sstefan1, jdoerfert, jdenny

Reviewed By: sstefan1

Subscribers: mgorny, yaxunl, hiraditya, guansong, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83583
2020-07-10 20:11:57 -04:00
Joel E. Denny 6dda6ff0e0 [FileCheck] Fix up -dump-input* docs
In FileCheck.rst, add `-dump-input-context` and `-dump-input-filter`,
and fix some `-dump-input` documentation.

In `FileCheck -help`, `cl::value_desc("kind")` is being ignored for
`-dump-input-filter`, so just drop it.

Extend `-dump-input=help` to mention FILECHECK_OPTS.
2020-07-10 17:21:01 -04:00
Joel E. Denny 9fd4b5faac [FileCheck] Implement -dump-input-filter
This makes the input dump filtering implemented by D82203 more
configurable.  D82203 enables filtering out everything but the initial
input lines of error diagnostics (plus some context).  This patch
enables including any line with any kind of annotation.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D83097
2020-07-10 11:02:11 -04:00
Joel E. Denny 77b6ddf1bd [FileCheck] In input dump, elide only if ellipsis is shorter
For example, given `-dump-input-context=3 -vv`, the following now
shows more leading context for the error than requested because a
leading ellipsis would occupy the same number of lines as it would
elide:

```
<<<<<<
         1: foo6
         2: foo5
         3: foo4
         4: foo3
         5: foo2
         6: foo1
         7: hello world
check:1     ^~~~~
check:2           X~~~~ error: no match found
         8: foo1
check:2     ~~~~
         9: foo2
check:2     ~~~~
        10: foo3
check:2     ~~~~
         .
         .
         .
>>>>>>
```

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D83526
2020-07-10 11:02:11 -04:00
Joel E. Denny bce8fced41 [FileCheck] Implement -dump-input-context
This patch is motivated by discussions at each of:

* <https://reviews.llvm.org/D81422>
* <http://lists.llvm.org/pipermail/llvm-dev/2020-June/142369.html>

When input is dumped as specified by `-dump-input=fail`, this patch
filters the dump to show only input lines that are the starting lines
of error diagnostics plus the number of contextual lines specified
`-dump-input-context` (defaults to 5).

When `-dump-input=always`, there might be not be any errors, so all
input lines are printed, as without this patch.

Here's some sample output with `-dump-input-context=3 -vv`:

```
<<<<<<
           .
           .
           .
          13: foo
          14: foo
          15: hello world
check:1       ^~~~~~~~~~~
          16: foo
check:2'0     X~~ error: no match found
          17: foo
check:2'0     ~~~
          18: foo
check:2'0     ~~~
          19: foo
check:2'0     ~~~
           .
           .
           .
          27: foo
check:2'0     ~~~
          28: foo
check:2'0     ~~~
          29: foo
check:2'0     ~~~
          30: goodbye word
check:2'0     ~~~~~~~~~~~~
check:2'1     ?            possible intended match
          31: foo
check:2'0     ~~~
          32: foo
check:2'0     ~~~
          33: foo
check:2'0     ~~~
           .
           .
           .
>>>>>>
```

Reviewed By: mehdi_amini, arsenm, jhenderson, rsmith, SjoerdMeijer, Meinersbur, lattner

Differential Revision: https://reviews.llvm.org/D82203
2020-07-10 11:02:10 -04:00
SharmaRithik e71c7b593a [CodeMoverUtils] Move OrderedInstructions to CodeMoverUtils
Summary: This patch moves OrderedInstructions to CodeMoverUtils as It was
the only place where OrderedInstructions is required.
Authored By: RithikSharma
Reviewer: Whitney, bmahjour, etiotto, fhahn, nikic
Reviewed By: Whitney, nikic
Subscribers: mgorny, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D80643
2020-07-10 11:22:43 +05:30
Joel E. Denny 839f8e4fe2 [FileCheck] Improve -dump-input documentation
Document the default of `fail` in `-help`.  Extend `-dump-input=help`
to help users find related command-line options, but let `-help`
provide their full documentation.

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D83091
2020-07-09 18:00:30 -04:00
Roman Lebedev 03640ee0fa
[llvm-reduce] Reducing attributes
Summary:
This handles all three places where attributes could currently be - `GlobalVariable`, `Function` and `CallBase`.
For last two, it correctly handles all three possible attribute locations (return value, arguments and function itself)

There was a previous attempt at it D73853,
which was committed in rGfc62b36a000681c01e993242b583c5ec4ab48a3c,
but then reverted all the way back in rGb12176d2aafa0ccb2585aa218fc3b454ba84f2a9
due to some (osx?) test failures.

Reviewers: nickdesaulniers, dblaikie, diegotf, george.burgess.iv, jdoerfert, Tyker, arsenm

Reviewed By: nickdesaulniers

Subscribers: wdng, MaskRay, arsenm, llvm-commits, mgorny

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83351
2020-07-09 23:10:43 +03:00
Julian Lettner f06d2420b7 [lit] Add --show-xxx command line options
Provide `--show-xxx` flags for all non-failure result codes, just as we
already do for `--show-xfail` and `--show-unsupported`.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D82233
2020-07-08 17:01:05 -07:00
Valentin Clement 23084878e9 [openmp] Use switch in isAllowedClauseForDirective instead of multiple if
Summary:
Change the test in isAllowedClauseForDirective from if with multiple conditions
to a main switch on directive and then switches on clause for each directive. Version
check is still done with a condition in the return statment.

Reviewers: jdoerfert, jdenny

Reviewed By: jdenny

Subscribers: yaxunl, guansong, sstefan1, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83363
2020-07-08 19:54:59 -04:00
LLVM GN Syncbot 3101fc692d [gn build] Port d999cbc988 2020-07-08 22:37:03 +00:00
Alex Richardson a80afc0328 [UpdateTestChecks] Add UTC_ARGS support for update_{llc,cc}_test_checks.py
https://reviews.llvm.org/D69701 added support for on-the-fly argument
changes for update scripts. I recently wanted to keep some manual check
lines in a test generated by update_cc_test_checks.py in our CHERI fork, so
this commit adds support for UTC_ARGS in update_cc_test_checks.py. And since
I was refactoring the code to be in common.py, I also added it for
update_llc_test_checks.py.

Reviewed By: jdoerfert, MaskRay
Differential Revision: https://reviews.llvm.org/D78478
2020-07-08 11:00:10 +01:00
Alex Richardson aae413462f [UpdateTestChecks] Move more update_test_checks.py logic to common.py
I intend to reuse this to add UTC_ARGS support for update_llc_test_checks.py
and update_cc_test_checks.py in D78478.

Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D78618
2020-07-08 10:59:28 +01:00
LLVM GN Syncbot d8dfd6dcc1 [gn build] Port 20e271a98d 2020-07-08 07:52:15 +00:00
Nico Weber fe13ee875b [gn build] Port baca8f977e 2020-07-07 22:29:19 -04:00
LLVM GN Syncbot 907f15c591 [gn build] Port dfa0db79d0 2020-07-07 17:49:12 +00:00
LLVM GN Syncbot fc67b25426 [gn build] Port 939d8309db 2020-07-07 02:20:39 +00:00
Valentin Clement 65482e8a70 [openmp] Move isAllowedClauseForDirective to tablegen + add clause version to OMP.td
Summary:
Generate the isAllowedClauseForDirective function from tablegen. This patch introduce
the VersionedClause in the tablegen file so that clause can be encapsulated in this class to
specify a range of validity on a directive.

VersionedClause has default minVersion, maxVersion so it can be used without them or
minVersion.

Reviewers: jdoerfert, jdenny

Reviewed By: jdenny

Subscribers: yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82982
2020-07-06 22:20:06 -04:00
LLVM GN Syncbot 7a3258912c [gn build] Port 05f2b5ccfc 2020-07-07 00:37:49 +00:00
LLVM GN Syncbot bfa8bda046 [gn build] Port 2020-07-07 00:37:49 +00:00
Roman Lebedev 05f2b5ccfc
[llvm-reduce] Reducing call operand bundles
Summary:
This would have been marginally useful to me during/for rG7ea46aee3670981827c04df89b2c3a1cbdc7561b.

With ongoing migration to representing assumes via operand bundles on the assume, this will be gradually more useful.

Reviewers: nickdesaulniers, diegotf, dblaikie, george.burgess.iv, jdoerfert, Tyker

Reviewed By: nickdesaulniers

Subscribers: hiraditya, mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83177
2020-07-07 01:16:37 +03:00
Shuhong Liu 2402f9385e [AIX] Add system-aix to lit config file
Summary: This is a complementary patch to D82100 since the aix builbot is still running the unsupported test shtest-format-argv0. Add system-aix to the sub llvm-lit config.

Reviewers: daltenty, hubert.reinterpretcast

Reviewed By: hubert.reinterpretcast

Subscribers: delcypher, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82905
2020-07-06 12:54:12 -04:00
Nico Weber 90a35bd074 [gn build] fix link of libclang_rt.asan_osx_dynamic.dylib if command line tools are not installed 2020-07-04 20:26:39 -04:00
Nico Weber 05c5ff5ab0 [gn build] make stage2_unix_toolchain set clang_base_path
This fixes the build of compiler-rt on macOS when _not_ using
clang_base_path in args.gn: Xcode clang knows where to find the
SDK, but regular clang doesn't and needs a -isysroot parameter.
We correctly add that parameter when clang_base_path is set,
but else we omit it. If clang_base_path was not set, we also
didn't add the flag for stage2_unix_toolchain() when we build
compiler-rt with just-built clang.

Make stage2_unix_toolchain() use clang_base_path instead of setting
cc / cxx. It's less code, and it gets things like this right.
2020-07-04 19:36:09 -04:00
LLVM GN Syncbot 07d4d84676 [gn build] Port b6cbe6cb03 2020-07-04 12:02:31 +00:00
LLVM GN Syncbot 2ac9c45910 [gn build] Port 8bd000a65f 2020-07-04 08:53:11 +00:00
Louis Dionne 71d88cebfb [libc++/libc++abi] Automatically detect whether exceptions are enabled
Instead of detecting it automatically (in libc++) and relying on
_LIBCXXABI_NO_EXCEPTIONS being set explicitly (in libc++abi), always
detect whether exceptions are enabled automatically.

This commit also removes support for specifying -D_LIBCPP_NO_EXCEPTIONS
and -D_LIBCXXABI_NO_EXCEPTIONS explicitly -- those should just be inferred
from using -fno-exceptions (or an equivalent flag).

Allowing both -D_FOO_NO_EXCEPTIONS to be provided explicitly and trying
to detect it automatically is just confusing, especially since we did
specify it explicitly when building libc++abi. We should have only one
way to detect whether exceptions are enabled, but it should be robust.
2020-07-03 14:58:09 -04:00
Craig Topper b94e9b7f05 [X86] Remove MODRM_SPLITREGM from the disassembler tables.
This offers a very minor table size reduction due to only being
used for one AMX opcode.
2020-07-03 00:16:20 -07:00
Nico Weber 39f4b1c86e [gn build] get everything to build when llvm_targets_to_build is just AArch64 2020-07-02 18:52:05 -04:00
Nico Weber 5416fc014a [gn build] make building on an arm mac work
Currently requires `llvm_targets_to_build = [ "X86", "AArch64" ]`:
building just the host arch (i.e. aarch64) causes some linker errors.
2020-07-02 14:22:33 -04:00
LLVM GN Syncbot 559685d0bb [gn build] Port 804d968744 2020-07-02 09:46:36 +00:00
Xiang1 Zhang aded4f0cc0 [X86-64] Support Intel AMX instructions
Summary:
INTEL ADVANCED MATRIX EXTENSIONS (AMX).
AMX is a new programming paradigm, it has a set of 2-dimensional registers
(TILES) representing sub-arrays from a larger 2-dimensional memory image and
operate on TILES.

Spec can be found in Chapter 3 here https://software.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html

Reviewers: LuoYuanke, annita.zhang, pengfei, RKSimon, xiangzhangllvm

Reviewed By: xiangzhangllvm

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82705
2020-07-02 08:57:04 +08:00
LLVM GN Syncbot 9d347f6efa [gn build] Port f12cd99c44 2020-07-01 08:09:43 +00:00
LLVM GN Syncbot 52e0582440 [gn build] Port 4da65c2920 2020-07-01 07:02:27 +00:00
Nico Weber 679d101e7c [gn build] (semi-manually) port ce6153a528 2020-06-30 19:30:13 -04:00
Reid Kleckner 926fab7c4f [gn build] Update build for new OpenMP tablegen logic
Ports 1a70077b5a to gn from cmake.
2020-06-30 16:02:05 -07:00
Valentin Clement 1a70077b5a [openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc

Reviewers: jdoerfert, jdenny, thakis

Reviewed By: jdoerfert, jdenny

Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82405
2020-06-30 14:51:59 -04:00
Hsiangkai Wang a7b0f39185 [MVT] Add new MVT types for RISC-V vector.
In RISC-V vector extension, users could group multiple vector registers
as one pseudo register. In mixed width operations, users could use
partial vector registers to reduce the register pressure. The parameter
to control register grouping and partial use is called LMUL. LMUL is a
part of the type. So, we have a bunch of vector types. In order to
support all these types, we need new MVT types in LLVM. In this patch, I
added several MVT types that are used in RISC-V vector implementation.
This is a standalone patch for MVT types without RISC-V related implementation.

Differential revision: https://reviews.llvm.org/D81724
2020-07-01 01:07:50 +08:00
Louis Dionne 9c795481e2 [libc++abi] Remove empty source file cxa_unexpected.cpp 2020-06-30 11:18:26 -04:00
sstefan1 aa93d84db9 [IR] NoFree IntrinsicProperty.
Summary:
Separate introduction of IntrNoFree property as suggested in D70365

Reviewers: arsenm, nhaehnle

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82587
2020-06-30 11:26:00 +02:00
Joel E. Denny 782585a214 [FileCheck] Permit multiple -v or -vv
`FILECHECK_OPTS` was implemented so that a test runner, such as CI,
can specify FileCheck debugging options, such as `-v` and `-vv`.
However, if a test suite has a FileCheck call that already specifies
`-v` or `-vv`, then that call will fail if `FILECHECK_OPTS` also
specifies it.

For `-vv`, this problem already exists:

`clang/test/CodeGen/aarch64-v8.2a-fp16-intrinsics-constrained.c`

It's not yet clear if the `-vv` in that test was intentional, but this
usage shouldn't fail anyway.  It's already true that FileCheck permits
`-vv` and `-v` together even though `-vv` implies `-v`.

Compare D70784, which fixed the same problem for `-dump-input`.

Reviewed By: jhenderson, thopre

Differential Revision: https://reviews.llvm.org/D82601
2020-06-29 18:35:22 -04:00
Reid Kleckner 1c15229ba3 [gn build] Add missing llvm-lipo dep to check-lld
Updates gn files for 918948db4d
2020-06-29 12:24:23 -07:00
LLVM GN Syncbot a450e0d8d0 [gn build] Port 9963d93b07 2020-06-29 18:36:28 +00:00
LLVM GN Syncbot 0f95f4c659 [gn build] Port fe0a555aa3 2020-06-29 16:19:53 +00:00
LLVM GN Syncbot 876df18aec [gn build] Port 2cb0644f90 2020-06-29 13:37:16 +00:00
LLVM GN Syncbot db5500a1a5 [gn build] Port b56b467a9a 2020-06-29 12:53:46 +00:00
LLVM GN Syncbot 07af106810 [gn build] Port 8e5a56865f 2020-06-29 10:55:06 +00:00
LLVM GN Syncbot 5edecc151d [gn build] Port 8f9ca561a2 2020-06-29 08:10:01 +00:00
Paul Walker 2c09e91054 [MVT] Add missing floating point types for 1024/2048-bit vectors.
Summary:
This patch adds entries for:
  v64f16
  v128f16
  v64bf16
  v128bf16
  v32f64

Subscribers: dschuff, hiraditya, aheejin, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82466
2020-06-25 21:13:31 +00:00
LLVM GN Syncbot ed87d774a3 [gn build] Port e9fb1506b8 2020-06-25 21:03:06 +00:00
LLVM GN Syncbot 821271ea27 [gn build] Port 9878996c70 2020-06-25 18:14:55 +00:00
LLVM GN Syncbot dbf7603be6 [gn build] Port 63a89693f0 2020-06-25 17:59:53 +00:00
Joel E. Denny 3b83501c29 [FileCheck][NFC] Remove redundant DumpInputDefault
Reviewed By: mehdi_amini, jhenderson

Differential Revision: https://reviews.llvm.org/D82480
2020-06-25 12:35:03 -04:00