Joel E. Denny [Mon, 29 Jun 2020 22:35:22 +0000 (18:35 -0400)]
[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
Joel E. Denny [Mon, 29 Jun 2020 22:35:11 +0000 (18:35 -0400)]
[FileCheck][NFC] Clean up RUN style in verbose.txt test
Reviewed By: jhenderson, thopre
Differential Revision: https://reviews.llvm.org/D82658
James Y Knight [Mon, 29 Jun 2020 22:27:02 +0000 (18:27 -0400)]
Clang Driver: refactor support for writing response files to be
specified at Command creation, rather than as part of the Tool.
This resolves the hack I just added to allow Darwin toolchain to vary
its level of support based on `-mlinker-version=`.
The change preserves the _current_ settings for response-file support.
Some tools look likely to be declaring that they don't support
response files in error, however I kept them as-is in order for this
change to be a simple refactoring.
Differential Revision: https://reviews.llvm.org/D82782
James Y Knight [Mon, 29 Jun 2020 22:26:53 +0000 (18:26 -0400)]
Clang Driver: Use Apple ld64's new @response-file support.
In XCode 12, ld64 got support for @files, in addition to the old
-filelist mechanism. Response files allow passing all command-line
arguments to the linker via a file, rather than just filenames, and is
therefore preferred.
Because of the way response-file support is currently implemented as
part of the Tool class in Clang, this change requires an ugly backdoor
function to access Args. A follow-up commit fixes this, but I've
ordered this change first, for easier backportability.
I've added no tests here, because unfortunately, there don't appear to
be _any_ response-file emission automated tests, and I don't see an
obvious way to add them. I've tested that this change works as
expected locally.
Differential Revision: https://reviews.llvm.org/D82777
Christopher Tetreault [Mon, 29 Jun 2020 21:46:25 +0000 (14:46 -0700)]
[SVE] Remove calls to VectorType::getNumElements from Instrumentation
Reviewers: efriedma, pcc, gchatelet, kmclaughlin, sdesmalen
Reviewed By: sdesmalen
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82241
Petr Hosek [Thu, 11 Jun 2020 03:00:53 +0000 (20:00 -0700)]
[CMake][compiler-rt] Only set lld as available when it was built
The `-fuse-ld=lld` check might succeed because there's a system lld,
but that lld may be out-of-date which would cause any tests that
attempt to use for LTO fail. This was observed on some of the bots.
Differential Revision: https://reviews.llvm.org/D81629
Rahul Joshi [Mon, 29 Jun 2020 14:31:48 +0000 (07:31 -0700)]
[MLIR] Add variadic isa<> for Type, Value, and Attribute
- Also adopt variadic llvm::isa<> in more places.
- Fixes https://bugs.llvm.org/show_bug.cgi?id=46445
Differential Revision: https://reviews.llvm.org/D82769
Christopher Tetreault [Mon, 29 Jun 2020 21:21:39 +0000 (14:21 -0700)]
[CMake] Fix incorrect handling of get_target_property failure
Summary:
add_unittest was checking that the result of get_target_property was not
"NOTFOUND", but despite what the documentation says, get_target_property
returns <the var>-NOTFOUND on failure.
Reviewers: efriedma, thakis, serge-sans-paille, chandlerc
Reviewed By: serge-sans-paille
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81762
Richard Smith [Mon, 29 Jun 2020 21:12:14 +0000 (14:12 -0700)]
Fix a few cases that were incorrectly parsed as unary-expressions
instead of postfix-expressions, and improve error recovery for postfix
operators after unary-expressions.
This covers nullptr, __null, and some calls to type traits with special
parsing rules. We would previously not parse a postfix-expression suffix
for these expressions, so would reject expressions such as
__is_trivial(int)["foo"].
For the case where a postfix-expression suffix is *not* permitted after
a unary-expression (for example, after a new-expression or sizeof
expression), produce a diagnostic if one appears there anyway. That's
always ill-formed, but previously produced very bad diagnostics.
Adam D Straw [Mon, 29 Jun 2020 17:35:11 +0000 (19:35 +0200)]
[mlir] add unsigned comparison builders to Affine EDSC
Current Affine comparison builders, which use operator overload, default to signed comparison. This creates the possibility of misuse of these builders and potential correctness issues when dealing with unsigned integers. This change makes the distinction between signed and unsigned comparison builders and forces the caller to make a choice between the two.
Differential Revision: https://reviews.llvm.org/D82323
Eric Schweitz [Mon, 29 Jun 2020 17:28:12 +0000 (10:28 -0700)]
[flang] Add coarray lowering hooks.
Differential review: https://reviews.llvm.org/D82790
Lei Huang [Mon, 29 Jun 2020 21:13:02 +0000 (16:13 -0500)]
[PowerPC] Fix FeatureISA3_1 def in PPC.td to imply FeatureISA3_0.
Simon Pilgrim [Sun, 28 Jun 2020 22:26:48 +0000 (23:26 +0100)]
[X86] Add common prefixes to merge more hadd/sub tests checks
Sam McCall [Mon, 29 Jun 2020 21:05:07 +0000 (23:05 +0200)]
[clangd] config() -> Config::current to avoid confict with NS
Jason Molenda [Mon, 29 Jun 2020 21:04:44 +0000 (14:04 -0700)]
Simplify conditionals in DNBArchMachARM64::EnableHardwareSingleStep
aartbik [Mon, 29 Jun 2020 20:28:12 +0000 (13:28 -0700)]
[mlir] [VectorOps] Extend vector reduction integration test with reassoc=true cases.
Reviewed By: reidtatge
Differential Revision: https://reviews.llvm.org/D82674
Sam McCall [Mon, 29 Jun 2020 20:22:12 +0000 (22:22 +0200)]
[ADT] Use more explicit from to initialize member. Appease MSVC?
Or at least get a clearer error message:
http://lab.llvm.org:8011/builders/mlir-windows/builds/3958/steps/build-unified-tree/logs/stdio
Leonard Chan [Mon, 29 Jun 2020 20:06:42 +0000 (13:06 -0700)]
[clang][RelativeVTablesABI] Update CodeGenCXX/RelativeVTablesABI/dynamic-cast.cpp
After
c7bcd431d9c4bfeb631a3599f1d628603e6351d6, this test started failing when
running with the new pass manager. One of the CHECKs in this file checks how the
vtable is loaded for a void cast, which involves taking 2 bitcasts from the pointer
to the original object. The order of these bitcasts changes under the new PM.
The order doesn't matter, so this relaxes the CHECKs.
Differential Revision: https://reviews.llvm.org/D82802
Nick Desaulniers [Mon, 29 Jun 2020 19:42:37 +0000 (12:42 -0700)]
Reland "[clang][SourceManager] cache Macro Expansions""
This reverts commit
33d63f02ce408d181e13089ee5a667fb2e1cdc78.
Differential Revision: https://reviews.llvm.org/D80681
Nick Desaulniers [Mon, 29 Jun 2020 19:41:56 +0000 (12:41 -0700)]
Revert "[clang][SourceManager] cache Macro Expansions"
This reverts commit
dffc1420451f674731cb36799c8ae084104ff0b5.
Missed a hunk (D82690).
Sam McCall [Mon, 29 Jun 2020 19:46:40 +0000 (21:46 +0200)]
Reland [clangd] Config: config struct propagated through Context
This reverts commit
a3684dfc45c3a7bbdf72750d8a527e07e776b608.
Sam McCall [Mon, 29 Jun 2020 19:41:57 +0000 (21:41 +0200)]
Revert "[clangd] Config: config struct propagated through Context"
This reverts commit
9963d93b0731e21dd1c9c1cebf8baaecf2010330.
Fails on mac/win:
http://45.33.8.238/win/18704/step_9.txt
http://45.33.8.238/mac/16341/step_9.txt
Sam McCall [Mon, 29 Jun 2020 19:00:46 +0000 (21:00 +0200)]
Reland [ADT] Support const-qualified unique_functions
This reverts commit
09b6dffb8ed19d624fddc7a57ce886f8be3c45b2.
Now compiles with GCC!
Davide Italiano [Mon, 29 Jun 2020 19:38:27 +0000 (12:38 -0700)]
[ProcessGDBRemote] Get rid of an unused function.
The define was wrong. I could've fixed it, but given this is
unused I decided to drop the function altogether.
peter klausler [Mon, 29 Jun 2020 17:45:02 +0000 (10:45 -0700)]
[flang] Defer stmt function body analysis until specification part complete
Expression analysis was being invoked on the bodies of statement functions
as they were being encountered during name resolution. This led to failures
on some FCVS tests in cases where those expressions contained implicitly
typed objects. Defer the analysis of statemet function bodies to the end
of the specification part, at which time the symbols of the enclosing scope
will have been typed.
Reviewed By: tskeith
Differential Revision: https://reviews.llvm.org/D82796
Mircea Trofin [Mon, 29 Jun 2020 15:44:38 +0000 (08:44 -0700)]
[llvm][NFC] Use llvm_canonicalize_cmake_booleans for LLVM_HAVE_TF_AOT
Reviewers: thakis
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82776
Reid Kleckner [Mon, 29 Jun 2020 19:24:10 +0000 (12:24 -0700)]
[gn build] Add missing llvm-lipo dep to check-lld
Updates gn files for
918948db4dc8718cb7aae8765653c27cba3cfe86
Alex Lorenz [Mon, 29 Jun 2020 17:23:16 +0000 (10:23 -0700)]
[darwin][driver] isMacosxVersionLT should check against the minimum supported OS version
This change ensures that the Darwin driver doesn't add unsupported libraries to the link
invocation when linking the Apple Silicon macOS slice.
rdar://
61011136
Differential Revision: https://reviews.llvm.org/D82696
Matt Arsenault [Fri, 26 Jun 2020 19:18:30 +0000 (15:18 -0400)]
X86: Upgrade a test to not rely on byval pointee type
Matt Arsenault [Mon, 29 Jun 2020 18:21:46 +0000 (14:21 -0400)]
LowerConstantIntrinsics: Fix missing test for byval behavior
Matt Arsenault [Sun, 28 Jun 2020 14:46:56 +0000 (10:46 -0400)]
X86: Use MOV32r0 pseudo instead of directly emitting xor
This was producing reg = xor undef reg, undef reg. This looks similar
to a use of a value to define itself, and I want to disallow undef
uses for SSA virtual registers. If this were to use implicit_def,
there's no guarantee the two operands end up using the same register
(I think no guarantee exists even if the two operands start out as the
same register, but this was violated when I switched this to use an
explicit implicit_def). The MOV32r0 pseudo evidently exists to handle
this case, so use it instead. This was more work than I expected for
the 64-bit case, but I didn't see any helper for materializing a
64-bit 0.
Reid Kleckner [Mon, 29 Jun 2020 18:39:49 +0000 (11:39 -0700)]
Silence unused var warning in NDEBUG build
LLVM GN Syncbot [Mon, 29 Jun 2020 18:36:28 +0000 (18:36 +0000)]
[gn build] Port
9963d93b073
Martijn Vels [Fri, 19 Jun 2020 18:24:03 +0000 (14:24 -0400)]
Add optimization to basic_string::assign for compile-time known constant values.
Summary:
This change optimizes the assign() methods for string where either the contents or lengths are compile time known constants. For small strings (< min_cap) we can execute the assignment entirely inline. For strings up to 128 bytes we allow the compiler to efficiently inline the copy operation after we call the offline __resize<>() method. Short / long branches are taken at the call site for better branch prediction and allowing FDO optimizations.
Benchmarks (unstable / google perflab):
```
name old time/op new time/op delta
BM_StringAssignAsciiz_Empty_Opaque 5.69ns ± 7% 5.97ns ± 7% ~ (p=0.056 n=5+5)
BM_StringAssignAsciiz_Empty_Transparent 5.39ns ± 7% 0.79ns ± 8% -85.36% (p=0.008 n=5+5)
BM_StringAssignAsciiz_Small_Opaque 11.2ns ± 5% 11.0ns ± 6% ~ (p=0.548 n=5+5)
BM_StringAssignAsciiz_Small_Transparent 10.1ns ± 7% 1.0ns ± 8% -89.76% (p=0.008 n=5+5)
BM_StringAssignAsciiz_Large_Opaque 23.5ns ± 7% 23.8ns ± 7% ~ (p=0.841 n=5+5)
BM_StringAssignAsciiz_Large_Transparent 21.4ns ± 7% 12.7ns ± 7% -40.83% (p=0.008 n=5+5)
BM_StringAssignAsciiz_Huge_Opaque 336ns ± 4% 327ns ± 7% ~ (p=0.421 n=5+5)
BM_StringAssignAsciiz_Huge_Transparent 331ns ± 5% 324ns ± 7% ~ (p=0.548 n=5+5)
BM_StringAssignAsciizMix_Opaque 13.6ns ±10% 13.7ns ± 9% ~ (p=0.690 n=5+5)
BM_StringAssignAsciizMix_Transparent 12.9ns ± 8% 3.6ns ± 8% -71.82% (p=0.008 n=5+5)
```
Reviewers: EricWF, #libc!
Subscribers: jfb, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D82221
Nikita Popov [Mon, 29 Jun 2020 18:33:50 +0000 (20:33 +0200)]
[IndVars] Regenerate test checks (NFC)
Nikita Popov [Mon, 29 Jun 2020 18:26:22 +0000 (20:26 +0200)]
Revert "[ADT] Support const-qualified unique_functions"
This reverts commit
01bf8cdf5fa9bc71869e15e5e351b2b68c39feb6.
Breaks the build:
llvm/include/llvm/ADT/FunctionExtras.h:223:7: error: explicit template argument list not allowed
223 | Callbacks<CallableT, CalledAs, EnableIfTrivial<CallableT>>;
Sam McCall [Thu, 25 Jun 2020 21:42:36 +0000 (23:42 +0200)]
[clangd] Config: config struct propagated through Context
Summary:
This introduces the "semantic form" of config exposed to features,
contrasted with the "syntactic form" exposed to users in
e9fb1506b83d.
The two are not connected, CompiledFragment and Provider will bridge that gap.
Nor is configuration actually set: that needs changes to ClangdServer,
TUScheduler, and BackgroundQueue.
Reviewers: hokein, kadircet
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82606
Alexey Bataev [Mon, 29 Jun 2020 17:30:29 +0000 (13:30 -0400)]
[DEBUGINFO]Add a test for packed bitfields, NFC.
Sam McCall [Thu, 25 Jun 2020 16:25:53 +0000 (18:25 +0200)]
[ADT] Support const-qualified unique_functions
Summary:
This technique should extend to rvalue-qualified etc, but I didn't add any.
I removed "volatile" from the future plans, which seems... speculative at best.
While here I moved the callbacks object out of the constructor into a
variable template, which I believe addresses the fixme there about unused
objects.
(I'm not a template guru, so it's always possible the old version was designed
for compile-time performance in a way I'm missing)
Reviewers: kadircet
Subscribers: dexonsmith, llvm-commits, chandlerc
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82581
Christopher Tetreault [Mon, 29 Jun 2020 17:30:43 +0000 (10:30 -0700)]
[SVE] Remove calls to VectorType::getNumElements from X86
Reviewers: efriedma, RKSimon, craig.topper, fpetrogalli, c-rhodes
Reviewed By: RKSimon
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82508
Louis Dionne [Fri, 26 Jun 2020 04:55:29 +0000 (00:55 -0400)]
[runtimes] Remove the ability to select the old libc++ testing format
As announced on libcxx-dev at [1], the old libc++ testing format is being
removed in favour of the new one. Follow-up commits will clean up the
code that is dead after the removal of this option.
[1]: http://lists.llvm.org/pipermail/libcxx-dev/2020-June/000885.html
Christopher Tetreault [Mon, 29 Jun 2020 17:15:00 +0000 (10:15 -0700)]
[SVE] Remove calls to VectorType::getNumElements from mlir
Reviewers: efriedma, ftynse, rriddle
Reviewed By: ftynse, rriddle
Subscribers: tschuett, rkruppe, psnobl, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D82583
Nemanja Ivanovic [Mon, 29 Jun 2020 16:37:03 +0000 (11:37 -0500)]
[PowerPC] Fix crash for shuffle canonicalization with elt 0 from RHS
Commit
1fed131660b2 assumed that shuffle vector canonicalization will
always ensure that the shuffle mask will be ordered so that element
zero comes from the LHS vector. However there is code out there for
which this is not the case. This patch simply removes that unsafe
assumption and makes the code work regardless of the source of the
first element.
Cullen Rhodes [Fri, 26 Jun 2020 16:35:00 +0000 (16:35 +0000)]
[AArch64][SVE] Add bfloat16 to outstanding tuple vector intrinsics
Summary:
* svget2/3/4
* svset2/3/4
* svcreate2/3/4
* svundef/2/3/4
Reviewers: sdesmalen, kmclaughlin, fpetrogalli, efriedma
Reviewed By: fpetrogalli
Differential Revision: https://reviews.llvm.org/D82665
Balazs Benics [Mon, 29 Jun 2020 16:51:24 +0000 (18:51 +0200)]
[analyzer][Z3-refutation] Fix a refutation BugReporterVisitor bug
FalsePositiveRefutationBRVisitor had a bug where the constraints were not
properly collected thus crosschecked with Z3.
This patch demonstratest and fixes that bug.
Bug:
The visitor wanted to collect all the constraints on a BugPath.
Since it is a visitor, it stated the visitation of the BugPath with the node
before the ErrorNode. As a final step, it visited the ErrorNode explicitly,
before it processed the collected constraints.
In principle, the ErrorNode should have visited before every other node.
Since the constraints were collected into a map, mapping each symbol to its
RangeSet, if the map already had a mapping with the symbol, then it was skipped.
This behavior was flawed if:
We already had a constraint on a symbol, but at the end in the ErrorNode we have
a tighter constraint on that. Therefore, this visitor would not utilize that
tighter constraint during the crosscheck validation.
Differential Revision: https://reviews.llvm.org/D78457
Cullen Rhodes [Fri, 26 Jun 2020 17:25:56 +0000 (17:25 +0000)]
[AArch64][SVE] clang: Add missing svbfloat16_t tests
Summary:
Patch adds tests for mangling of svbfloat16_t and several other type
related tests.
Reviewers: sdesmalen, kmclaughlin, fpetrogalli, efriedma
Reviewed By: sdesmalen, fpetrogalli
Differential Revision: https://reviews.llvm.org/D82668
Jonas Devlieghere [Mon, 29 Jun 2020 16:44:26 +0000 (09:44 -0700)]
[Sphinx] Support older recommonmark versions.
The "new way" of enabling recommonmark is only supported in recommonmark
0.5 and later. Use the deprecated approach with versions of Sphinx that
still support it.
If I understand correctly there's no way to use older versions of
recommonmark (<0.5) with newer versions of Sphinx (>3.0) because the old
approach got removed.
Differential revision: https://reviews.llvm.org/D75284
Louis Dionne [Mon, 29 Jun 2020 16:39:39 +0000 (12:39 -0400)]
[libc++] Enable tests and documentation by default when building standalone
Since we can always find the rest of the LLVM tree, we can always run the
tests in the standalone mode. Do it so that the default behavior is the
same in the standalone and non-standalone modes.
Louis Dionne [Mon, 29 Jun 2020 16:25:10 +0000 (12:25 -0400)]
[libc++] Provide a default LLVM_PATH when building standalone
Since we require that libc++ is built as part of the monorepo layout, we
can assume the path of the rest of LLVM and avoid requiring that LLVM_PATH
be set explicitly.
Muhammad Omair Javaid [Mon, 29 Jun 2020 14:29:23 +0000 (19:29 +0500)]
[LLDB] skip TestCreateDuringInstructionStep on aarch64/linux
TestCreateDuringInstructionStep have started failing again on
aarch64/linux after moving to new machine. I am going mark it skipped
for aarch64/linux.
LLVM GN Syncbot [Mon, 29 Jun 2020 16:19:53 +0000 (16:19 +0000)]
[gn build] Port
fe0a555aa3c
Balazs Benics [Mon, 29 Jun 2020 16:18:43 +0000 (18:18 +0200)]
[analyzer][NFC] Add unittest for FalsePositiveRefutationBRVisitor
Adds the test infrastructure for testing the FalsePositiveRefutationBRVisitor.
It will be extended in the D78457 patch, which demonstrates and fixes a bug in
the visitor.
Differential Revision: https://reviews.llvm.org/D78704
serge-sans-paille [Mon, 29 Jun 2020 10:07:26 +0000 (12:07 +0200)]
Correctly report Changed status in FoldBranchToCommonDest
It's possible for the first loop trip(s) to set the `Changed` Status, and to a
later one to early exit, in which case `Changed` must be return.
Differential Revision: https://reviews.llvm.org/D82753
Francesco Petrogalli [Fri, 19 Jun 2020 21:27:46 +0000 (21:27 +0000)]
[sve][acle] Implement some of the C intrinsics for brain float.
Summary:
The following intrinsics have been extended to support brain float types:
svbfloat16_t svclasta[_bf16](svbool_t pg, svbfloat16_t fallback, svbfloat16_t data)
bfloat16_t svclasta[_n_bf16](svbool_t pg, bfloat16_t fallback, svbfloat16_t data)
bfloat16_t svlasta[_bf16](svbool_t pg, svbfloat16_t op)
svbfloat16_t svclastb[_bf16](svbool_t pg, svbfloat16_t fallback, svbfloat16_t data)
bfloat16_t svclastb[_n_bf16](svbool_t pg, bfloat16_t fallback, svbfloat16_t data)
bfloat16_t svlastb[_bf16](svbool_t pg, svbfloat16_t op)
svbfloat16_t svdup[_n]_bf16(bfloat16_t op)
svbfloat16_t svdup[_n]_bf16_m(svbfloat16_t inactive, svbool_t pg, bfloat16_t op)
svbfloat16_t svdup[_n]_bf16_x(svbool_t pg, bfloat16_t op)
svbfloat16_t svdup[_n]_bf16_z(svbool_t pg, bfloat16_t op)
svbfloat16_t svdupq[_n]_bf16(bfloat16_t x0, bfloat16_t x1, bfloat16_t x2, bfloat16_t x3, bfloat16_t x4, bfloat16_t x5, bfloat16_t x6, bfloat16_t x7)
svbfloat16_t svdupq_lane[_bf16](svbfloat16_t data, uint64_t index)
svbfloat16_t svinsr[_n_bf16](svbfloat16_t op1, bfloat16_t op2)
Reviewers: sdesmalen, kmclaughlin, c-rhodes, ctetreau, efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D82345
dfukalov [Mon, 29 Jun 2020 13:34:00 +0000 (16:34 +0300)]
[NFC] Fixed ignored .hip test.
Reviewers: hliao
Reviewed By: hliao
Subscribers: yaxunl, cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82764
Louis Dionne [Mon, 29 Jun 2020 15:51:15 +0000 (11:51 -0400)]
[libc++] Do not try creating llvm-lit when LIBCXX_INCLUDE_TESTS is OFF in the standalone build
Doing so doesn't work reliably, since it relies on LLVM_* implementation
detail variables being set. Furthermore, since we rely on the lit.site.cfg
being generated, running the tests requires LIBCXX_INCLUDE_TESTS=ON anyway.
Christudasan Devadasan [Wed, 17 Jun 2020 08:39:04 +0000 (14:09 +0530)]
[AMDGPU] Moving SI_RETURN_TO_EPILOG handling out of SIInsertSkips.
For now, moving it to SIPreEmitPeephole.
Should find a right place to have this code.
Reviewed By: nhaehnle
Differential revision: https://reviews.llvm.org/D77544
Dmitri Gribenko [Mon, 29 Jun 2020 15:05:43 +0000 (17:05 +0200)]
RecursiveASTVisitor: inline a macro that is only used once
Reviewers: eduucaldas, ymandel
Reviewed By: ymandel
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82760
Nathan James [Mon, 29 Jun 2020 15:05:51 +0000 (16:05 +0100)]
[clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D82661
Dmitri Gribenko [Mon, 29 Jun 2020 15:01:58 +0000 (17:01 +0200)]
Compile the RecursiveASTVisitor callbacks test with "/bigobj"
Summary:
This file was exceeding a limit in MSVC:
fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj
Reviewers: erichkeane
Reviewed By: erichkeane
Subscribers: jmorse, gribozavr2, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82766
David Green [Mon, 29 Jun 2020 12:53:19 +0000 (13:53 +0100)]
[ARM] Better reductions
MVE has native reductions for integer add and min/max. The others need
to be expanded to a series of extract's and scalar operators to reduce
the vector into a single scalar. The default codegen for that expands
the reduction into a series of in-order operations.
This modifies that to something more suitable for MVE. The basic idea is
to use vector operations until there are 4 remaining items then switch
to pairwise operations. For example a v8f16 fadd reduction would become:
Y = VREV X
Z = ADD(X, Y)
z0 = Z[0] + Z[1]
z1 = Z[2] + Z[3]
return z0 + z1
The awkwardness (there is always some) comes in from something like a
v4f16, which is first legalized by adding identity values to the extra
lanes of the reduction, and which can then not be optimized away through
the vrev; fadd combo, the inserts remain. I've made sure they custom
lower so that we can produce the pairwise additions before the extra
values are added.
Differential Revision: https://reviews.llvm.org/D81397
Simon Pilgrim [Mon, 29 Jun 2020 14:59:53 +0000 (15:59 +0100)]
Fix MSVC truncation of constant value warning.
Dmitri Gribenko [Mon, 29 Jun 2020 14:59:40 +0000 (16:59 +0200)]
Revert "[analyzer][NFC] Add unittest for FalsePositiveRefutationBRVisitor"
This reverts commit
e22cae32c5c4cf8c49b674cea34c105a6cb015f9. It broke
the build:
FalsePositiveRefutationBRVisitorTest.cpp:112:3: error: use of undeclared identifier 'LLVM_WITH_Z3'
Bjorn Pettersson [Mon, 29 Jun 2020 14:56:35 +0000 (16:56 +0200)]
[llvm-objcopy] Fix "unused-function" warning in NDEBUG builds
Fixup of commit
b925ca37a8f28851 to allow building with
-Werror -Wunused-function.
Balazs Benics [Tue, 21 Apr 2020 13:44:34 +0000 (15:44 +0200)]
[analyzer][NFC] Add unittest for FalsePositiveRefutationBRVisitor
Adds the test infrastructure for testing the FalsePositiveRefutationBRVisitor.
It will be extended in the D78457 patch, which demonstrates and fixes a bug in
the visitor.
Differential Revision: https://reviews.llvm.org/D78704
Simon Pilgrim [Mon, 29 Jun 2020 14:24:49 +0000 (15:24 +0100)]
[X86][SSE] MatchVectorAllZeroTest - handle OR vector reductions (REAPPLIED)
This patch extends MatchVectorAllZeroTest to handle OR vector reduction patterns where the result is compared against zero.
Reapplied with a fix for a chromium regression due to a missing isNullConstant() check in combineSetCC: https://bugs.chromium.org/p/chromium/issues/detail?id=1097758
Fixes PR45378
Differential Revision: https://reviews.llvm.org/D81547
Nemanja Ivanovic [Mon, 29 Jun 2020 10:14:30 +0000 (05:14 -0500)]
[PowerPC] Don't combine SCALAR_TO_VECTOR without VSX
Most of the patterns for PPCISD::SCALAR_TO_VECTOR_PERMUTED require
VSX. So don't emit them if the subtarget doesn't have VSX.
This resolves the issue reported on
https://reviews.llvm.org/rG1fed131660b2c5d3ea7007e273a7a5da80699445
Jonas Devlieghere [Mon, 29 Jun 2020 14:47:37 +0000 (07:47 -0700)]
[lldb/Test] Skip TestVSCode_disconnect on Darwin
It's failing on the sanitized bot on GreenDragon.
Matt Arsenault [Fri, 26 Jun 2020 16:00:44 +0000 (12:00 -0400)]
Inliner: Add missing test for alignment assume with byval
No tests were stressing the behavior for hasPassPointeeByValueAttr.
Sanjay Patel [Mon, 29 Jun 2020 14:29:59 +0000 (10:29 -0400)]
[VectorCombine] try to form vector compare and binop to eliminate scalar ops
binop i1 (cmp Pred (ext X, Index0), C0), (cmp Pred (ext X, Index1), C1)
-->
vcmp = cmp Pred X, VecC
ext (binop vNi1 vcmp, (shuffle vcmp, Index1)), Index0
This is a larger pattern than the existing extractelement folds because we can't
reasonably vectorize the sub-patterns with constants based on cost model calcs
(it doesn't usually make sense to replace a single extracted scalar op with
constant operand with a vector op).
I salvaged as much of the existing logic as I could, but there might be better
ways to share and reduce code.
The motivating case from PR43745:
https://bugs.llvm.org/show_bug.cgi?id=43745
...is the special case of a 2-way reduction. We tried to get SLP to handle that
particular pattern in D59710, but that caused crashing and regressions.
This patch is more general, but hopefully safer.
The v2f64 test with SSE2 surprised me - the cost model accounting looks like this:
OldCost = 0 (free extract of f64 at index 0) + 1 (extract of f64 at index 1) + 2 (scalar fcmps) + 1 (and of bools) = 4
NewCost = 2 (vector fcmp) + 1 (shuffle) + 1 (vector 'and') + 1 (extract of bool) = 5
Differential Revision: https://reviews.llvm.org/D82474
Stephan Herhut [Mon, 29 Jun 2020 10:01:53 +0000 (12:01 +0200)]
[mlir] Clean up NVVM intrinsics definitions a little.
Differential Revision: https://reviews.llvm.org/D82750
Nathan James [Mon, 29 Jun 2020 14:28:07 +0000 (15:28 +0100)]
[clang-tidy] Fix hicpp-named-paramater
Currently this alias instantiates the readability-identifier-naming check, just swap it out to use the readability-named-paramater check.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D82711
Bevin Hansson [Fri, 26 Jun 2020 14:32:30 +0000 (16:32 +0200)]
[CodeGen] Use the common semantic for fixed-point codegen, not the result semantic.
Summary:
Using the result semantic is wrong in some cases, such as
unsigned fixed-point + signed integer. In this case, the
result semantic is unsigned and the common semantic is
signed.
Reviewers: leonardchan
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82662
Matt Arsenault [Sun, 28 Jun 2020 20:11:48 +0000 (16:11 -0400)]
AMDGPU: Use IsSSA property check instead of asserting on isSSA
Also fix an SSA violation in a test the MIRParser/verifier fails to
catch. It's illegal to define a subregister in SSA. For the purpose of
the test, it just needs to define the super-register to use the
subregister in the use operand.
Jake Merdich [Fri, 26 Jun 2020 01:59:33 +0000 (21:59 -0400)]
[clang-format] Preserve whitespace in selected macros
Summary:
https://bugs.llvm.org/show_bug.cgi?id=46383
When the c preprocessor stringizes tokens, the generated string literals
are affected by the whitespace. This means clang-format can affect
codegen silently, adding spaces and newlines to strings. Practically
speaking, the vast majority of cases will be harmless, only affecting
single identifiers or debug macros.
In the interest of doing no harm in other cases though, this introduces
a blacklist option 'WhitespaceSensitiveMacros', which contains a list of
names of function-like macros whose contents should not be touched by
clang-format, period. Clang-format can't automatically detect these
without a real compile context, so users will have to specify it
explicitly (it still beats clang-format off'ing at every invocation).
Defaults include "STRINGIZE", "PP_STRINGIZE", and "BOOST_PP_STRINGIZE".
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82620
Sanjay Patel [Mon, 29 Jun 2020 13:47:13 +0000 (09:47 -0400)]
[VectorCombine] refactor - make helper function for extract to shuffle logic; NFC
Preliminary for D82474
LLVM GN Syncbot [Mon, 29 Jun 2020 13:37:16 +0000 (13:37 +0000)]
[gn build] Port
2cb0644f90b
Luís Marques [Mon, 29 Jun 2020 10:03:26 +0000 (11:03 +0100)]
[RISCV] Split the pseudo instruction splitting pass
Extracts the atomic pseudo-instructions' splitting from `riscv-expand-pseudo`
/ `RISCVExpandPseudo` into its own pass, `riscv-expand-atomic-pseudo` /
`RISCVExpandAtomicPseudo`. This allows for the expansion of atomic operations
to continue to happen late (the new pass is added in `addPreEmitPass2`, so
those expansions continue to happen in the same place), while the remaining
pseudo-instructions can now be expanded earlier and benefit from more
optimization passes. The nonatomics pass is now added in `addPreSched2`.
Differential Revision: https://reviews.llvm.org/D79635
Balázs Kéri [Mon, 29 Jun 2020 12:35:00 +0000 (14:35 +0200)]
[Analyzer][StreamChecker] Use BugType instead of BuiltinBug (NFC) .
Summary:
I do not like the BuiltinBug class.
And it takes no SuppressOnSink parameter that may be needed in the future.
Reviewers: Szelethus, baloghadamsoftware, gamesh411
Reviewed By: Szelethus
Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82741
Pavel Labath [Mon, 29 Jun 2020 12:55:36 +0000 (14:55 +0200)]
[lldb] Deduplicate Scalar integral getters
These functions all follow the same pattern. Use template functions to
deduplicate.
Sven van Haastregt [Mon, 29 Jun 2020 13:13:12 +0000 (14:13 +0100)]
[OpenCL] Reject block arguments
OpenCL 2.0 does not allow block arguments, primarily because it is
difficult to support function pointers on the various architectures
that OpenCL targets. Clang was still accepting them.
Rename and reuse the `err_opencl_half_param` diagnostic.
Fixes PR46324.
Differential Revision: https://reviews.llvm.org/D82313
Guillaume Chatelet [Mon, 29 Jun 2020 13:00:37 +0000 (13:00 +0000)]
[NFC] Fix typos
LLVM GN Syncbot [Mon, 29 Jun 2020 12:53:46 +0000 (12:53 +0000)]
[gn build] Port
b56b467a9a8
Guillaume Chatelet [Mon, 29 Jun 2020 12:48:44 +0000 (12:48 +0000)]
[ADT] Add Bitfield utilities
Context:
--------
There are places in LLVM where we need to pack typed fields into opaque values.
For instance, the `XXXInst` classes in `llvm/include/llvm/IR/Instructions.h` that extract informations from `Value::SubclassData` via `getSubclassDataFromInstruction()`.
The bit twiddling is done manually: this impairs readability and prevent consistent handling of out of range values (e.g. https://github.com/llvm/llvm-project/blob/
435b458ad0a4630e6126246a6865748104ccad06/llvm/include/llvm/IR/Instructions.h#L564)
More importantly, the bit pattern is scattered throughout the implementation making it hard to pack additionnal fields or check for overlapping bits.
Design decisions:
-----------------
The Bitfield structs are to be declared together so it is clear which bits are used or not.
The code is designed with simplicity in mind, hence a few limitations:
- Storage is limited to a single integer,
- Enum values have to be `unsigned`,
- Storage type has to be `unsigned`,
- There are no automatic detection of overlapping fields (packed bitfield declaration should help though),
- The interface is C like so `storage` needs to be passed in everytime (code is simpler and lifetime considerations more obvious)
RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-June/142196.html
Differential Revision: https://reviews.llvm.org/D81580
Sebastian Neubauer [Fri, 12 Jun 2020 09:48:36 +0000 (11:48 +0200)]
Add intrinsic helper function
It simplifies getting generic argument types from intrinsics.
Differential Revision: https://reviews.llvm.org/D81084
Sander de Smalen [Mon, 29 Jun 2020 10:41:22 +0000 (11:41 +0100)]
[AArch64][SVE] NFCI: Choose consistent naming for predicated SDAG nodes
This patch proposes a naming convention for operations that take
a general predicate (and are thus predicated) that specifies
what happens to the false lanes.
Currently the _PRED suffix is used, which doesn't really say much other
than that it takes a predicate. In some instances this means it has
merging predication and in other cases it means zeroing-predication.
This patch also changes the order of operands to
AArch64ISD::DUP_MERGE_PASSTHRU, to pass the predicate as the first
operand, which is in line with all other predicates nodes. It takes the
passthru value as an explicit passthru value, which is always passed as
the last operand.
Reviewers: paulwalker-arm, cameron.mcinally, eli.friedman, dancgr, efriedma
Reviewed By: paulwalker-arm
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81850
Guillaume Chatelet [Mon, 29 Jun 2020 12:16:25 +0000 (12:16 +0000)]
[NFC] Introduce a helper in BasicTTIImpl.h to cast to T
This patch makes access to `this` as a `T` uniform accross the file.
Differential Revision: https://reviews.llvm.org/D82648
John Brawn [Mon, 29 Jun 2020 12:13:12 +0000 (13:13 +0100)]
[Driver] When forcing a crash print the bug report message
Commit
a945037e8fd0c30e250a62211469eea6765a36ae moved the printing of the
"PLEASE submit a bug report" message to the crash handler, but that means we
don't print it when forcing a crash using FORCE_CLANG_DIAGNOSTICS_CRASH. Fix
this by adding a function to get the bug report message and printing it when
forcing a crash.
Differential Revision: https://reviews.llvm.org/D81672
Guillaume Chatelet [Mon, 29 Jun 2020 11:56:06 +0000 (11:56 +0000)]
[Alignment][NFC] Migrate AMDGPU backend to Align
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
Differential Revision: https://reviews.llvm.org/D82743
Guillaume Chatelet [Mon, 29 Jun 2020 11:24:36 +0000 (11:24 +0000)]
[Alignment][NFC] migrate DataLayout::getPreferredAlignment
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
Differential Revision: https://reviews.llvm.org/D82752
Simon Pilgrim [Mon, 29 Jun 2020 11:18:27 +0000 (12:18 +0100)]
[X86] Add vector support to targetShrinkDemandedConstant for OR/XOR opcodes
If a constant is only allsignbits in the demanded/active bits, then sign extend it to an allsignbits bool pattern for OR/XOR ops.
This also requires SimplifyDemandedBits XOR handling to be modified to call ShrinkDemandedConstant on any (non-NOT) XOR pattern to account for non-splat cases.
Next step towards fixing PR45808 - with this patch we now get a <-1,-1,0,0> v4i64 constant instead of <1,1,0,0>.
Differential Revision: https://reviews.llvm.org/D82257
AndreyChurbanov [Mon, 29 Jun 2020 11:14:56 +0000 (14:14 +0300)]
[openmp][NFC] Cleanup: guard __kmp_mic_type by KMP_MIC_SUPPORTED macro.
Differential Revision: https://reviews.llvm.org/D82301
Cullen Rhodes [Fri, 19 Jun 2020 10:00:41 +0000 (10:00 +0000)]
[AArch64][SVE] Add bfloat16 support to svext intrinsic
Reviewers: sdesmalen, kmclaughlin, efriedma, david-arm, fpetrogalli
Reviewed By: sdesmalen, fpetrogalli
Differential Revision: https://reviews.llvm.org/D82391
Kerry McLaughlin [Mon, 29 Jun 2020 09:51:41 +0000 (10:51 +0100)]
[AArch64][SVE] Bail out of performPostLD1Combine for scalable types
Summary:
performPostLD1Combine will introduce either a LD1LANEpost
or LD1DUPpost node, which will cause selection failure if the
return type is a scalable vector.
Reviewers: sdesmalen, c-rhodes, efriedma
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82670
LLVM GN Syncbot [Mon, 29 Jun 2020 10:55:06 +0000 (10:55 +0000)]
[gn build] Port
8e5a56865f2
Dmitri Gribenko [Mon, 29 Jun 2020 10:47:51 +0000 (12:47 +0200)]
Move TestClangConfig into libClangTesting and use it in AST Matchers tests
Summary:
Previously, AST Matchers tests were using a custom way to run a test
with a specific C++ standard version. I'm migrating them to a shared
infrastructure to specify a Clang target from libClangTesting. I'm also
changing tests for AST Matchers to run in multiple language standards
versions, and under multiple triples that have different behavior with
regards to templates.
To keep the size of the patch manageable, in this patch I'm only
migrating one file to get the process started and get feedback on this
approach.
One caveat is that increasing the number of test configuration does
significantly increase the runtime of AST Matchers tests. On my machine,
the test runtime increases from 2.0 to 6.0s. I think it is worth the
improved test coverage.
Reviewers: jdoerfert, ymandel
Reviewed By: ymandel
Subscribers: gribozavr2, jfb, sstefan1, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82179
Simon Pilgrim [Mon, 29 Jun 2020 10:24:26 +0000 (11:24 +0100)]
[TargetLowering] Add DemandedElts arg to ShrinkDemandedConstant
Pre-commit for D82257, this adds a DemandedElts arg to ShrinkDemandedConstant/targetShrinkDemandedConstant which will allow future patches to (optionally) add vector support.
Joachim Protze [Mon, 29 Jun 2020 10:43:41 +0000 (12:43 +0200)]
[OpenMP][Tool] Fix buffer overflow in ompt-multiplex.h
Reviewed by: runlieb
Differential Revision: https://reviews.llvm.org/D82452
Dmitri Gribenko [Mon, 29 Jun 2020 10:21:14 +0000 (12:21 +0200)]
Add tests for sequences of callbacks that RecursiveASTVisitor produces
Summary:
These tests show a bug: post-order traversal introduces an extra call to
WalkUp*, that is not present in pre-order traversal. I'm fixing this bug
in a follow-up commit.
Reviewers: ymandel, eduucaldas
Reviewed By: ymandel, eduucaldas
Subscribers: gribozavr2, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82485
Tobias Gysi [Mon, 29 Jun 2020 09:32:46 +0000 (11:32 +0200)]
[mlir] make the bitwidth of device side index computations configurable (reland)
Summary:
The patch makes the index type lowering of the GPU to NVVM/ROCDL conversion configurable. It introduces a pass option that controls the bitwidth used when lowering index computations and uses the LowerToLLVMOptions structure to control the Standard to LLVM lowering.
This commit fixes a use-after-free bug introduced by the reverted commit d10b1a3. It implements the following changes:
- Added a getDefaultOptions method to the LowerToLLVMOptions struct that returns a reference to statically allocated default options.
- Use the getDefaultOptions method to provide default LowerToLLVMOptions (instead of an initializer list).
- Added comments to clarify the required lifetime of the LowerToLLVMOptions
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D82475