Georgii Rymar [Mon, 13 Apr 2020 11:46:41 +0000 (14:46 +0300)]
[ADT/STLExtras.h] - Add llvm::is_sorted wrapper and update callers.
It can be used to avoid passing the begin and end of a range.
This makes the code shorter and it is consistent with another
wrappers we already have.
Differential revision: https://reviews.llvm.org/D78016
Tres Popp [Tue, 7 Apr 2020 12:12:04 +0000 (14:12 +0200)]
[MLIR] Constant fold multiplies in deriveStaticUpperBound.
Summary:
This operation occurs during collapseParallelLoops, so we constant fold
them also to allow more situations of determining a loop invariant upper
bound when lowering to the GPU dialect from the Loop dialect.
Differential Revision: https://reviews.llvm.org/D77723
Haojian Wu [Fri, 3 Apr 2020 09:00:16 +0000 (11:00 +0200)]
[AST] Dont invalide VarDecl even the default initializaiton is failed.
Summary:
This patch would cause clang emit more diagnostics, but it is much better than https://reviews.llvm.org/D76831
```cpp
struct A {
A(int);
~A() = delete;
};
void k() {
A a;
}
```
before the patch:
/tmp/t3.cpp:24:5: error: no matching constructor for initialization of 'A'
A a;
^
/tmp/t3.cpp:20:3: note: candidate constructor not viable: requires 1 argument, but 0 were provided
A(int);
^
/tmp/t3.cpp:19:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided
struct A {
After the patch:
/tmp/t3.cpp:24:5: error: no matching constructor for initialization of 'A'
A a;
^
/tmp/t3.cpp:20:3: note: candidate constructor not viable: requires 1 argument, but 0 were provided
A(int);
^
/tmp/t3.cpp:19:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided
struct A {
^
/tmp/t3.cpp:24:5: error: attempt to use a deleted function
A a;
^
/tmp/t3.cpp:21:3: note: '~A' has been explicitly marked deleted here
~A() = delete;
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77395
Florian Hahn [Tue, 14 Apr 2020 10:15:20 +0000 (11:15 +0100)]
Recommit "[SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef."
This includes a fix reported with simplifications in the presence of
NaN.
This reverts the revert commit
06408451bf12d4baed1fb1312d8af6e6bbb6a797.
Tyker [Tue, 14 Apr 2020 09:57:19 +0000 (11:57 +0200)]
[AssumeBundles] preserve knowledge in DCE
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77403
Tyker [Tue, 14 Apr 2020 09:56:56 +0000 (11:56 +0200)]
[AssumeBundles] preserve knowledge in DSE
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77404
Tyker [Tue, 14 Apr 2020 09:56:38 +0000 (11:56 +0200)]
[AssumeBundles] preserve information in NewGVN
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: Prazek, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77406
Tyker [Tue, 14 Apr 2020 09:56:16 +0000 (11:56 +0200)]
[AssumeBundles] preserve information in LICM
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: hiraditya, asbirlea, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77407
Tyker [Tue, 14 Apr 2020 09:55:56 +0000 (11:55 +0200)]
[AssumeBundles] adapte GVN to assume bundles
Summary:
prevent GVN from removing assume bundles
make GVN preserve information from removed instructions
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77405
Balázs Kéri [Tue, 14 Apr 2020 09:14:17 +0000 (11:14 +0200)]
[Analyzer][StreamChecker] Added evaluation of fseek.
Summary:
Function `fseek` is now evaluated with setting error return value
and error flags.
Reviewers: Szelethus, NoQ, xazax.hun, rnkovacs, dcoughlin, baloghadamsoftware, martong
Reviewed By: Szelethus
Subscribers: ASDenysPetrov, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75851
Georgii Rymar [Tue, 14 Apr 2020 10:20:51 +0000 (13:20 +0300)]
[LLD][ELF][Test] - Fixed the broken test case.
There was no ":" after "SEC", hence the check was
disabled. Found with the use of D78024.
LLVM GN Syncbot [Tue, 14 Apr 2020 09:55:20 +0000 (09:55 +0000)]
[gn build] Port
36c76de6789
Kerry McLaughlin [Tue, 14 Apr 2020 08:52:04 +0000 (09:52 +0100)]
[AArch64][SVE] Add a pass for SVE intrinsic optimisations
Summary:
Creates the SVEIntrinsicOpts pass. In this patch, the pass tries
to remove unnecessary reinterpret intrinsics which convert to
and from svbool_t (llvm.aarch64.sve.convert.[to|from].svbool)
For example, the reinterprets below are redundant:
%1 = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %a)
%2 = call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %1)
The pass also looks for ptest intrinsics and phi instructions where
the operands are being needlessly converted to and from svbool_t.
Reviewers: sdesmalen, andwar, efriedma, cameron.mcinally, c-rhodes, rengolin
Reviewed By: efriedma
Subscribers: mgorny, tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76078
Peter Smith [Mon, 13 Apr 2020 07:55:07 +0000 (08:55 +0100)]
[MC][ARM] Emit R_ARM_BASE_PREL for _GLOBAL_OFFSET_TABLE_ expressions
The _GLOBAL_OFFSET_TABLE_ in SysVr4 ELF is conventionally the base of the
.got or .got.prel sections. Expressions such as _GLOBAL_OFFSET_TABLE_
- (.L1 +8) are used in assembler code to calculate offsets into the .got.
At present MC outputs a R_ARM_REL32 with respect to the
_GLOBAL_OFFSET_TABLE_ symbol, whereas gas outputs a R_ARM_BASE_PREL
relocation with respect to the _GLOBAL_OFFSET_TABLE_ symbol. While both are
correct the R_ARM_REL32 depends on the value of the _GLOBAL_OFFSET_TABLE_
symbol, wheras te R_ARM_BASE_PREL relocation is idependent of the symbol.
The R_ARM_BASE_PREL is therefore slightly more robust to linker's that may
not follow the conventional placement of _GLOBAL_OFFSET_TABLE_; for example
LLD for some time defined _GLOBAL_OFFSET_TABLE_ to 0.
Differential Revision: https://reviews.llvm.org/D46319
Pavel Labath [Mon, 6 Apr 2020 20:24:51 +0000 (22:24 +0200)]
[lldb/test] Make TestLoadUnload compatible with windows
Summary:
This patch introduces a header "dylib.h" which can be used in tests to
handle shared libraries semi-portably. The shared library APIs on
windows and posix systems look very different, but their underlying
functionality is relatively similar, so the mapping is not difficult.
It also introduces two new macros to wrap the functinality necessary to
export/import function across the dll boundary on windows. Previously we
had the LLDB_TEST_API macro for this purpose, which automagically
changed meaning depending on whether we were building the shared library
or the executable. While convenient for simple cases, this approach was
not sufficient for the more complicated setups where one deals with
multiple shared libraries.
Lastly it rewrites TestLoadUnload, to make use of the new APIs. The
trickiest aspect there is the handling of DYLD_LIBRARY_PATH on macos --
previously setting this variable was not needed as the test used
@executable_path-relative dlopens, but the new generic api does not
support that. Other systems do not support such dlopens either so the
test already contained support for setting the appropriate path
variable, and this patch just makes that logic more generic. In doesn't
seem that the purpose of this test was to exercise @executable_path
imports, so this should not be a problem.
These changes are sufficient to make some of the TestLoadUnload tests
pass on windows. Two other tests will start to pass once D77287 lands.
Reviewers: amccarth, jingham, JDevlieghere, compnerd
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D77662
Pratyai Mazumder [Tue, 14 Apr 2020 06:49:31 +0000 (23:49 -0700)]
[SanitizerCoverage] The section name for inline-bool-flag was too long for darwin builds, so shortening it.
Summary:
Following up on the comments on D77638.
Not undoing rGd6525eff5ebfa0ef1d6cd75cb9b40b1881e7a707 here at the moment, since I don't know how to test mac builds. Please let me know if I should include that here too.
Reviewers: vitalybuka
Reviewed By: vitalybuka
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77889
Balázs Kéri [Tue, 14 Apr 2020 07:20:22 +0000 (09:20 +0200)]
[Analyzer][VLASize] Support multi-dimensional arrays.
Summary:
Check the size constraints for every (variable) dimension of the array.
Try to compute array size by multiplying size for every dimension.
Reviewers: Szelethus, martong, baloghadamsoftware, gamesh411
Reviewed By: Szelethus, martong
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/D77305
Alex Brachet [Tue, 14 Apr 2020 08:02:27 +0000 (04:02 -0400)]
[libc] Add very basic stdio FILE and fwrite
Summary:
This patch adds a very basic `FILE` type and basic `fwrite`.
It also removes `snprintf` from `StdIO`'s function spec because `VarArgType` was causing the generation to fail.
Reviewers: sivachandra, PaulkaToast
Reviewed By: sivachandra
Subscribers: mgorny, MaskRay, tschuett, libc-commits
Differential Revision: https://reviews.llvm.org/D77626
Alex Brachet [Tue, 14 Apr 2020 07:27:10 +0000 (03:27 -0400)]
[libc] Remove <functional> dependency in syscall_test.cpp
Summary: Create self contained functional header which has a type similar to `std::function`
Reviewers: sivachandra, PaulkaToast
Reviewed By: sivachandra
Subscribers: mgorny, tschuett, libc-commits
Differential Revision: https://reviews.llvm.org/D77948
Kazushi (Jam) Marukawa [Tue, 14 Apr 2020 06:56:44 +0000 (08:56 +0200)]
[VE] Remove unnecessary iz pattern
Summary:
This iz pattern is a special pattern of im pattern. This im pattern
has been supported by https://reviews.llvm.org/D77769, so removing
iz pattern as a continuous patch.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D77770
Craig Topper [Tue, 14 Apr 2020 06:04:52 +0000 (23:04 -0700)]
[CallSite removal][CodeGen] Replace ImmutableCallSite with CallBase in isInTailCallPosition.
Mircea Trofin [Tue, 14 Apr 2020 04:41:25 +0000 (21:41 -0700)]
[llvm][NFC][CallSite] Remove CallSite from CGSCCPassManager
Reviewers: craig.topper, dblaikie, davidxl
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78080
Fangrui Song [Tue, 14 Apr 2020 05:28:31 +0000 (22:28 -0700)]
[XRay] Define uint64_t Address = Sled.Address; NFC
This makes it easy to change the address stored in a sled from an
absolute address to a PC-relative address.
Chris Lattner [Mon, 13 Apr 2020 23:37:00 +0000 (16:37 -0700)]
Fix the MLIR integer attribute parser to be correct in the face of large integer attributes, it was previously artificially limited to 64 bits.
Reviewers: rriddle!
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78065
Mircea Trofin [Mon, 13 Apr 2020 23:39:52 +0000 (16:39 -0700)]
[llvm][NFC] CallSite removal from inliner-related files
Summary: This removes CallSite from inliner files. Some dependencies where thus affected.
Reviewers: dblaikie, davidxl, craig.topper
Subscribers: arsenm, jvesely, nhaehnle, eraman, hiraditya, aheejin, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77991
Uday Bondhugula [Tue, 14 Apr 2020 04:24:19 +0000 (09:54 +0530)]
Fix MLIR test case failure caused by
89e0662dee5fa541f284e6be0af9e36e7f39f947
Fix MLIR test case failure introduced by
89e0662dee5fa541f284e6be0af9e36e7f39f947. LLVM's IR builder
now automatically sets the alignment on alloca.
Uday Bondhugula [Mon, 13 Apr 2020 19:48:37 +0000 (01:18 +0530)]
[MLIR] Remove dead affine.applys while generating pointwise copies
This makes no impact on the test cases because affine-data-copy-generate
runs whole function canonicalization at its end; however, the latter
will be removed in a pending revision. It is thus useful to clean up
these affine.applys right here, and eventually, not even generate
these (when the right API to compose by construction is in place).
Differential Revision: https://reviews.llvm.org/D78055
Craig Topper [Tue, 14 Apr 2020 03:43:43 +0000 (20:43 -0700)]
[X86] Use a more realisitic cost for truncate v16i64->v16i8 with avx512f.
Still not great and we could probably codegen this better, but
11 was clearly ridiculous.
Craig Topper [Tue, 14 Apr 2020 02:29:33 +0000 (19:29 -0700)]
[X86] Split AVX512 getCastInstrCost into tables that require useAVX512Regs() and those that just operate on 256 or smaller vectors.
Use useAVX512Regs() to skip lookups instead of using type legalization
action.
Craig Topper [Tue, 14 Apr 2020 01:59:09 +0000 (18:59 -0700)]
[X86] Add a more accurate truncate cost for v8i64->v8i8
Craig Topper [Tue, 14 Apr 2020 01:37:23 +0000 (18:37 -0700)]
[X86] Add truncate cost model tests to min-legal-vector-width.ll for when we're avoiding 512 bit vectors.
Julian Lettner [Tue, 14 Apr 2020 03:44:15 +0000 (20:44 -0700)]
[lit] Update local test objects "in place" from remote test objects
Update local test object "in place" from remote test object. We need to
do this to ensure that discovered test object which is used for printing
test results reflect the changes.
> Why are we sending back the whole test object from the worker process
> (lit.worker.execute) instead of just the result?
Unfortunately, the test result is not the only "result" of test
execution. Other members (e.g., xfails, requires) of the Test class are
set only during execution. Those members affect the behavior of
`isExpectedToFail` and `setResult`, and are accessed when printing
results. For example, xunit.xml test results include missing features
for "skip reasons". The lack of separation between an immutable "test
definition" and "generated outputs" (including the primary result and
other secondary state) is unfortunate historical design decision in lit.
> Why do we update the initial test object instead of just discarding it
> and continuing with the pickled test object?
Both of these approaches would work. However, note that we need a fully
populated test object for printing results. Updating the existing one
seems to be the easier path.
Fangrui Song [Tue, 14 Apr 2020 02:54:39 +0000 (19:54 -0700)]
[VE] Adapt D77995 CallSite removal
Matt Arsenault [Sat, 11 Apr 2020 17:57:15 +0000 (13:57 -0400)]
GlobalISel: Fix casted unmerge of G_CONCAT_VECTORS
This was assuming a scalarizing unmerge, and would fail assert if the
unmerge was to smaller vector types.
Brian Cain [Fri, 10 Apr 2020 21:19:30 +0000 (16:19 -0500)]
Add duplex to R_HEX_GOT_16_X
Building 'espresso' from llvm-test-suite revealed missing support
for duplex instructions with R_HEX_GOT_16_X.
LLVM GN Syncbot [Tue, 14 Apr 2020 00:27:34 +0000 (00:27 +0000)]
[gn build] Port
384ca190ae7
Mehdi Amini [Tue, 14 Apr 2020 00:27:08 +0000 (00:27 +0000)]
Revert "Move ModuleSummaryAnalysis from libAnalysis to libObject to break the dependency from Analysis to Object"
This reverts commit
10df1563d608323a3144afc5f6038ecb81869b92.
Some buildbots are broken.
Nico Weber [Tue, 14 Apr 2020 00:15:01 +0000 (20:15 -0400)]
[gn build] (manually) merge
10df1563d some more
Christopher Tetreault [Mon, 13 Apr 2020 23:00:10 +0000 (16:00 -0700)]
[SVE] Change return type of getNumElements to unsigned
Reviewers: efriedma, sdesmalen, craig.topper, dexonsmith
Reviewed By: efriedma, sdesmalen
Subscribers: tschuett, hiraditya, rkruppe, psnobl, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77763
LLVM GN Syncbot [Mon, 13 Apr 2020 23:18:41 +0000 (23:18 +0000)]
[gn build] Port
10df1563d60
Matt Arsenault [Sun, 29 Mar 2020 16:34:35 +0000 (12:34 -0400)]
AMDGPU/GlobalISel: Combines for V_CVT_F32_UBYTE[0-3]
Ports the existing DAG combines, minus the simplify demanded bits
which seems to have no equivalent now. Without these, this isn't
particularly helpful in most of the IR sample cases.
Mehdi Amini [Mon, 13 Apr 2020 04:21:40 +0000 (04:21 +0000)]
Move ModuleSummaryAnalysis from libAnalysis to libObject to break the dependency from Analysis to Object
ModuleSummaryAnalysis is the only file in libAnalysis that brings a
dependency on the CodeGen layer from libAnalysis, moving it breaks this
dependency.
Differential Revision: https://reviews.llvm.org/D77994
Austin Kerbow [Mon, 13 Apr 2020 06:25:18 +0000 (23:25 -0700)]
[AMDGPU][GlobalISel] Fix div_scale in FDIV lowering
Differential Revision: https://reviews.llvm.org/D78004
Artem Belevich [Mon, 13 Apr 2020 21:55:26 +0000 (14:55 -0700)]
[CUDA] Fix missed CUDA version mappings.
Heejin Ahn [Fri, 10 Apr 2020 23:46:39 +0000 (16:46 -0700)]
[WebAssembly] Fix try placement in fixing unwind mismatches
Summary:
In CFGStackify, `fixUnwindMismatches` function fixes unwind destination
mismatches created by `try` marker placement. For example,
```
try
...
call @qux ;; This should throw to the caller!
catch
...
end
```
When `call @qux` is supposed to throw to the caller, it is possible that
it is wrapped inside a `catch` so in case it throws it ends up unwinding
there incorrectly. (Also it is possible `call @qux` is supposed to
unwind to another `catch` within the same function.)
To fix this, we wrap this inner `call @qux` with a nested
`try`-`catch`-`end` sequence, and within the nested `catch` body, branch
to the right destination:
```
block $l0
try
...
try ;; new nested try
call @qux
catch ;; new nested catch
local.set n ;; store exnref to a local
br $l0
end
catch
...
end
end
local.get n ;; retrieve exnref back
rethrow ;; rethrow to the caller
```
The previous algorithm placed the nested `try` right before the `call`.
But it is possible that there are stackified instructions before the
call from which the call takes arguments.
```
try
...
i32.const 5
call @qux ;; This should throw to the caller!
catch
...
end
```
In this case we have to place `try` before those stackified
instructions.
```
block $l0
try
...
try ;; this should go *before* 'i32.const 5'
i32.const 5
call @qux
catch
local.set n
br $l0
end
catch
...
end
end
local.get n
rethrow
```
We correctly handle this in the first normal `try` placement phase
(`placeTryMarker` function), but failed to handle this in this
`fixUnwindMismatches`.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77950
Jean-Luc Brouillet [Mon, 13 Apr 2020 22:40:56 +0000 (15:40 -0700)]
Fix a typo in the error message for an incorrect prototype.
Summary: Cut & paste error had the error message mentionning "}" rather than ")".
Differential Revision: https://reviews.llvm.org/D77625
Ayke van Laethem [Sat, 14 Mar 2020 17:52:01 +0000 (18:52 +0100)]
[AVR] Support aliases in non-zero address space
This fixes code like the following on AVR:
void foo(void) {
}
void bar(void) __attribute__((alias("foo")));
Code like this is present in compiler-rt, which I'm trying to build.
Differential Revision: https://reviews.llvm.org/D76182
Louis Dionne [Wed, 8 Apr 2020 14:42:56 +0000 (10:42 -0400)]
[libunwind] Enable the new libc++ testing format by default
The new format should be equivalent to the old format, and it is now the
default format when running the libc++ and libc++abi tests. This commit
changes the libunwind tests to use the new format by default too. If
unexpected failures are discovered, it should be fine to revert this
commit until they are addressed.
Also note that it is still possible to use the old format by passing
`--param=use_old_format=True` when running Lit for the time being.
Differential Revision: https://reviews.llvm.org/D77733
jasonliu [Mon, 13 Apr 2020 21:39:10 +0000 (21:39 +0000)]
Remove '<' from test for better yam2obj input consumption
Address post-commit comment:
https://reviews.llvm.org/D77580#inline-713676
yaml2obj does not record the source filename in the output,
which may make FileCheck tests brittle sometimes.
Louis Dionne [Mon, 13 Apr 2020 21:38:40 +0000 (17:38 -0400)]
[libc++] Mark test failing with macos < 10.13 as unsupported
River Riddle [Mon, 13 Apr 2020 21:07:38 +0000 (14:07 -0700)]
[mlir][NFC] Replace mlir/Support/Functional.h with llvm equivalents.
Summary: Functional.h contains many different methods that have a direct, and more efficient, equivalent in LLVM. This revision replaces all usages with the LLVM equivalent, and removes the header. This is part of larger cleanup, pr45513, merging MLIR support facilities into LLVM.
Differential Revision: https://reviews.llvm.org/D78053
Louis Dionne [Mon, 13 Apr 2020 20:52:34 +0000 (16:52 -0400)]
[libc++] NFC: Remove unused Lit features in the test suite
The libc++ test suite currently defines several features that are not
used anywhere in the tests, or that are redundant with other features.
For the purpose of simplifying config.py and to ease the bring up of a
new configuration, this commit removes some of these features:
- rename dylib-has-no-filesystem to c++filesystem-disabled, which exists
- rename apple-darwin to just darwin, which is already set
- remove useless setting of libstdc++, which is already set correctly
- remove libcpp-abi-unstable, which is not used anywhere
- remove the glibc-XXX features, which are not used anywhere
Benjamin Kramer [Mon, 13 Apr 2020 21:03:03 +0000 (23:03 +0200)]
[CHR] Clean up some code and reduce copying. NFCI.
Nico Weber [Mon, 13 Apr 2020 20:53:06 +0000 (16:53 -0400)]
Revert a few unsuccessful attempts at fixing bots.
I broke bots last week and tried a few things to fix them.
These were attempts that didn't help, so back them back out.
This reverts commit
c7aff9a109b611e4954a3055061a8076b4baa385.
This reverts commit
8838d6d3566d940859fd26b20aed4cb57d490988.
This reverts commit
e875ba1509955dc4b3512d820edecc0da26fa38d.
Sterling Augustine [Mon, 13 Apr 2020 20:09:22 +0000 (13:09 -0700)]
Use a temporary file, to allow running on read-only file systems
Louis Dionne [Mon, 13 Apr 2020 20:50:11 +0000 (16:50 -0400)]
[libc++] NFC: Remove unused method call
Craig Topper [Mon, 13 Apr 2020 17:44:59 +0000 (10:44 -0700)]
[CallSite removal][TargetLowering] Replace ImmutableCallSite with CallBase
Differential Revision: https://reviews.llvm.org/D77995
Eli Friedman [Sun, 12 Apr 2020 23:58:30 +0000 (16:58 -0700)]
Make IRBuilder automatically set alignment on load/store/alloca.
This is equivalent in terms of LLVM IR semantics, but we want to
transition away from using MaybeAlign to represent the alignment of
these instructions.
Differential Revision: https://reviews.llvm.org/D77984
Dan Liew [Tue, 7 Apr 2020 01:57:54 +0000 (18:57 -0700)]
[Darwin] Fix a bug where the symbolizer would examine the wrong process.
Summary:
Previously `AtosSymbolizer` would set the PID to examine in the
constructor which is called early on during sanitizer init. This can
lead to incorrect behaviour in the case of a fork() because if the
symbolizer is launched in the child it will be told examine the parent
process rather than the child.
To fix this the PID is determined just before the symbolizer is
launched.
A test case is included that triggers the buggy behaviour that existed
prior to this patch. The test observes the PID that `atos` was called
on. It also examines the symbolized stacktrace. Prior to this patch
`atos` failed to symbolize the stacktrace giving output that looked
like...
```
#0 0x100fc3bb5 in __sanitizer_print_stack_trace asan_stack.cpp:86
#1 0x10490dd36 in PrintStack+0x56 (/path/to/print-stack-trace-in-code-loaded-after-fork.cpp.tmp_shared_lib.dylib:x86_64+0xd36)
#2 0x100f6f986 in main+0x4a6 (/path/to/print-stack-trace-in-code-loaded-after-fork.cpp.tmp_loader:x86_64+0x100001986)
#3 0x7fff714f1cc8 in start+0x0 (/usr/lib/system/libdyld.dylib:x86_64+0x1acc8)
```
After this patch stackframes `#1` and `#2` are fully symbolized.
This patch is also a pre-requisite refactor for rdar://problem/
58789439.
Reviewers: kubamracek, yln
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D77623
Dan Liew [Tue, 7 Apr 2020 00:25:47 +0000 (17:25 -0700)]
[Sanitizer Common] Show command used to launch symbolizer process at high verbosity level.
Summary:
In preparation for writing a test for a bug fix we need to be able to
see the command used to launch the symbolizer process. This feature
will likely be useful for debugging how the Sanitizers use the
symbolizer in general.
This patch causes the command line used to launch the process to be
shown at verbosity level 3 and higher.
A small test case is included.
Reviewers: kubamracek, yln, vitalybuka, eugenis, kcc
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D77622
LLVM GN Syncbot [Mon, 13 Apr 2020 20:31:14 +0000 (20:31 +0000)]
[gn build] Port
e823068306e
LLVM GN Syncbot [Mon, 13 Apr 2020 20:31:14 +0000 (20:31 +0000)]
[gn build] Port
255cc202ea6
Lang Hames [Mon, 13 Apr 2020 20:29:59 +0000 (13:29 -0700)]
[Support] Add missing files from
e823068306e.
Martin Storsjö [Wed, 8 Apr 2020 21:42:50 +0000 (00:42 +0300)]
[LLD] [COFF] Fix alignment of thunks for ARM/ARM64
The alignment of ARM64 range extension thunks was fixed in
7c816492197a, but ARM range extension thunks, and import
and delay import thunks also need aligning (like all code on ARM
platforms).
I'm adding a test for alignment of ARM64 import thunks - not
specifically adding tests for misalignment of all of them though.
Differential Revision: https://reviews.llvm.org/D77796
MaheshRavishankar [Sun, 12 Apr 2020 06:02:09 +0000 (23:02 -0700)]
[mlir][Linalg] NFC: Add utility function to tile, fuse and set marker to use loop.parallel.
This change is NFC since the facility to tile and generate
loop.parallel loops already exists in Linalg.
Differential Revision: https://reviews.llvm.org/D77965
MaheshRavishankar [Sun, 12 Apr 2020 06:01:40 +0000 (23:01 -0700)]
[mlir][Linalg] NFC : Fix check for scalar case handling in LinalgToLoops
The invertPermutation method does not return a nullptr anymore, but
rather returns an empty map for the scalar case. Update the check in
LinalgToLoops to reflect this.
Also add test case for generating scalar code.
MaheshRavishankar [Mon, 13 Apr 2020 16:33:34 +0000 (09:33 -0700)]
[mlir][Linalg] Add loop.parallel lowering for all Linalg Ops.
The outer parallel loops of a linalg operation is lowered to
loop.parallel, with the other loops lowered to loop.for. This gets the
lowering to loop.parallel on par with the loop.for lowering. In future
the reduction loop could also be lowered to loop.parallel.
Also add a utility function that returns the loops that are
created.
Differential Revision: https://reviews.llvm.org/D77678
Sam McCall [Mon, 13 Apr 2020 20:14:27 +0000 (22:14 +0200)]
[Support] Fix CMakeLists after
e823068306e98e9
Reid Kleckner [Mon, 13 Apr 2020 20:12:42 +0000 (13:12 -0700)]
Fix target_info.test on Windows with a hack
Add a quote character to the sed command to cause it to be quoted.
Hopefully, which will help both gnuwin and MSys versions of sed tokenize
the command line the same way.
Sam McCall [Fri, 10 Apr 2020 01:27:37 +0000 (03:27 +0200)]
[clangd] Rebuild dependent files when a header is saved.
Summary:
Caveats:
- only works when the header is changed in the editor and the editor provides
the notification
- we revalidate preambles for all open files (stat all their headers) rather
than taking advantage of the fact that we know which file changed.
This is much simpler!
Fixes https://github.com/clangd/clangd/issues/107
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77847
Christopher Tetreault [Mon, 13 Apr 2020 19:30:53 +0000 (12:30 -0700)]
Clean up usages of asserting vector getters in Type
Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Reviewers: sdesmalen, efriedma, krememek
Reviewed By: sdesmalen, efriedma
Subscribers: dexonsmith, Charusso, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77257
Lang Hames [Mon, 13 Apr 2020 19:51:46 +0000 (12:51 -0700)]
[ORC] Update ORCv2 docs to reflect removal of ExecutionSession::getMainJITDylib.
Thanks to Dibyendu Majumdar for spotting the issue.
Lang Hames [Sat, 11 Apr 2020 00:23:20 +0000 (17:23 -0700)]
[Support] Add support RTTI support for open class hierarchies.
This patch extracts the RTTI part of llvm::ErrorInfo into its own class
(RTTIExtends) so that it can be used in other non-error hierarchies, and makes
it compatible with the existing LLVM RTTI function templates (isa, cast,
dyn_cast, dyn_cast_or_null) by adding the classof method.
Differential Revision: https://reviews.llvm.org/D39111
Denis Khalikov [Mon, 13 Apr 2020 18:11:08 +0000 (21:11 +0300)]
[mlir][spirv] Add a `spirv::InterfaceVarABIAttr`.
Summary:
Add a proper dialect-specific attribute for interface variable ABI.
Differential Revision: https://reviews.llvm.org/D77941
Lei Zhang [Mon, 13 Apr 2020 19:33:35 +0000 (15:33 -0400)]
[mlir][spirv] NFC: use Optional to replace SPV_Optional
Differential Revision: https://reviews.llvm.org/D78046
Chris Lattner [Mon, 13 Apr 2020 18:51:59 +0000 (11:51 -0700)]
Remove the Identifier::is() method, it is now equivalent to operator==. NFC.
Summary: Depends on D78042.
Reviewers: rriddle!
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78043
Christopher Tetreault [Mon, 13 Apr 2020 17:51:25 +0000 (10:51 -0700)]
Clean up usages of asserting vector getters in Type
Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.
Reviewers: rriddle, sdesmalen, efriedma
Reviewed By: efriedma
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77259
Rahman Lavaee [Mon, 13 Apr 2020 19:14:42 +0000 (12:14 -0700)]
Extend BasicBlock sections to allow specifying clusters of basic blocks in the same section.
Differential Revision: https://reviews.llvm.org/D76954
Rahman Lavaee [Mon, 13 Apr 2020 19:12:34 +0000 (12:12 -0700)]
Revert "Extend BasicBlock sections to allow specifying clusters of basic blocks"
This reverts commit
0d4ec16d3db3a92514e14101f635e8536c208c4f Because
tests were not added to the commit.
Lama [Mon, 13 Apr 2020 18:51:03 +0000 (18:51 +0000)]
[MachinePipeliner] Refine the RecMII calculation
In the case of more than one SDep between two successor SUnits in the Nodeset, the current implementation sums the latencies of the dependencies, which could create a larger RecMII than necessary.
for example, in case there is both a data dependency and an output dependency (with latency > 0) between successor nodes:
SU(1) inst1:
successors:
SU(2): out latency = 1
SU(2): data latency = 1
SU(2) inst2:
successors:
SU(3): out latency = 1
SU(3): data latency = 1
SU(3) inst3:
successors:
SU(1): out latency = 1
SU(1): data latency = 1
the NodeSet latency returned would be 6, whereas it could be 3 if we take the max for each successor SUnit.
In general this can be extended to finding the shortest path in the recurrence..
thoughts?
Unfortunately I had a hard time creating a test for this in Hexagon/PowerPC, so help would be appreciated.
Reviewed By: bcahoon
Differential Revision: https://reviews.llvm.org/D75918
Austin Kerbow [Mon, 13 Apr 2020 18:58:15 +0000 (11:58 -0700)]
[AMDGPU] Fix comment for llvm.amdgcn.div.scale. NFC.
Update comment to reflect actual lowering.
Chris Lattner [Mon, 13 Apr 2020 18:17:35 +0000 (11:17 -0700)]
Eliminate all uses of Identifier::is() in the source tree, this doesn't remove the definition of it (yet). NFC.
Reviewers: mravishankar, antiagainst, herhut, rriddle!
Subscribers: jholewinski, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, grosul1, frgossen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78042
Matt Arsenault [Mon, 13 Apr 2020 14:14:07 +0000 (10:14 -0400)]
HIP: Fix handling of denormal mode
I didn't realize HIP was a distinct offloading kind, so the subtarget
was looking for -march, which isn't correct for HIP. We also have the
possibility of different denormal defaults in the case of multiple
offload targets, so we need to thread the JobAction through the target
hook.
Rahman Lavaee [Mon, 13 Apr 2020 18:39:23 +0000 (11:39 -0700)]
Extend BasicBlock sections to allow specifying clusters of basic blocks
in the same section.
This allows specifying BasicBlock clusters like the following example:
!foo
!!0 1 2
!!4
This places basic blocks 0, 1, and 2 in one section in this order, and
places basic block #4 in a single section of its own.
Benjamin Kramer [Mon, 13 Apr 2020 18:36:31 +0000 (20:36 +0200)]
[InstCombine] Use SmallBitVector for convienently checking if all bits are set
Uday Bondhugula [Mon, 13 Apr 2020 04:48:10 +0000 (10:18 +0530)]
[MLIR] NFC cleanup/modernize memref-dataflow-opt / getNestingDepth
Bring code to date with recent changes to the core infrastructure /
coding style.
Differential Revision: https://reviews.llvm.org/D77998
Uday Bondhugula [Mon, 13 Apr 2020 14:00:35 +0000 (19:30 +0530)]
[MLIR] NFC clean up simplify-affine-structures test case
NFC clean up for simplify-affine-structures test cases. Rename sets
better; avoid suffix numbers; move outlined definitions close to use.
This is in preparation for other functionality updates.
Differential Revision: https://reviews.llvm.org/D78017
River Riddle [Mon, 13 Apr 2020 18:26:55 +0000 (11:26 -0700)]
[mlir][Transforms][docs] Add a description blurb for various passes
Summary: This revision adds blurbs of documentation to various different passes, namely: Canonicalizer, CSE, LocationSnapshot, StripDebugInfo, and SymbolDCE.
Differential Revision: https://reviews.llvm.org/D78007
Mehdi Amini [Mon, 13 Apr 2020 17:03:12 +0000 (17:03 +0000)]
Add missing dependencies on the flang test target
Without this, the LLVM utilities (FileCheck) aren't built when running
`ninja check-flang` and it fails with:
llvm-project/llvm/utils/lit/lit/llvm/subst.py:134: fatal: Did not find FileCheck in...
Also the modules aren't built without depending on `module_files`, which
makes multiple tests failing.
Differential Revision: https://reviews.llvm.org/D78036
Lei Zhang [Mon, 13 Apr 2020 16:47:58 +0000 (12:47 -0400)]
[mlir][spirv] Improve stride support in array types
This commit added stride support in runtime array types. It also
adjusted the assembly form for the stride from `[N]` to `stride=N`.
This makes the IR more readable, especially for the cases where
one mix array types and struct types.
Differential Revision: https://reviews.llvm.org/D78034
Matt Morehouse [Mon, 13 Apr 2020 17:58:26 +0000 (10:58 -0700)]
[SanCov] Disable whitelist/blacklist test on Darwin.
Nico Weber [Mon, 13 Apr 2020 17:57:00 +0000 (13:57 -0400)]
[gn build] (manually) merge
6dbf1a1229ba
Vedant Kumar [Fri, 10 Apr 2020 23:47:09 +0000 (16:47 -0700)]
[InstCombine] Fix debug variance issue in tryToMoveFreeBeforeNullTest
Fix an issue where the presence of debug info could disable an
optimization in tryToMoveFreeBeforeNullTest.
Vedant Kumar [Fri, 10 Apr 2020 21:58:13 +0000 (14:58 -0700)]
[Debugify] Strip added metadata in the -debugify-each pipeline
Summary:
Share logic to strip debugify metadata between the IR and MIR level
debugify passes. This makes it simpler to hunt for bugs by diffing IR
with vs. without -debugify-each turned on.
As a drive-by, fix an issue causing CallGraphNodes to become invalid
when a dead llvm.dbg.value prototype is deleted.
Reviewers: dsanders, aprantl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77915
Fangrui Song [Fri, 10 Apr 2020 16:41:41 +0000 (09:41 -0700)]
[llvm-xray][test] Combine two AArch64 tests
Rename extract-instrmap-aarch64.test to extract-instrmap.test because
the path component `AArch64` conveys the target name clearly.
Additionally, adopt a convention we start to use in LLVM binary
utilities: prepend `#` to CHECK/RUN lines and `##` to comment lines even
if the file contains no code. The notation makes CHECK/RUN/comments
stand out.
Reviewed By: dberris
Differential Revision: https://reviews.llvm.org/D77883
Chris Lattner [Mon, 13 Apr 2020 05:15:26 +0000 (22:15 -0700)]
Reimplement mlir::Identifier to be a wrapper around 'StringMapEntry*' instead of a wrapper around a 'const char*'. This makes it so strref() can be computed without calling strlen, which is more efficient and less error-prone. While here...
Summary:
..., reimplement DenseMapInfo<mlir::Identifier>::getHashValue in terms of mlir::hash_value(Identifier).
Both of these improvements were suggested by River, thanks!
Reviewers: rriddle!
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77999
Sam McCall [Sat, 11 Apr 2020 16:19:50 +0000 (18:19 +0200)]
[clangd] Send the correct error code when cancelling requests.
Summary:
I couldn't quite bring myself to make Cancellation depend on LSP ErrorCode.
Magic numbers instead...
Reviewers: kadircet
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77947
Simon Pilgrim [Mon, 13 Apr 2020 17:39:07 +0000 (18:39 +0100)]
[CostModel][X86] Remove comments that begin with a filecheck prefix.
Stop filecheck from confusing a general comment with a check.
Lei Zhang [Mon, 13 Apr 2020 17:14:07 +0000 (13:14 -0400)]
[mlir][spirv] Add missing interface storage classes in serializer
Differential Revision: https://reviews.llvm.org/D78037
Benjamin Kramer [Mon, 13 Apr 2020 17:28:20 +0000 (19:28 +0200)]
[ADT] Reduce the requirements for the simple loop in DenseMap::clear
We can use it when just the value doesn't require destruction. Empty
keys are safe to overwrite always. This gets the important case of
std::pair values.