Jonas Devlieghere [Sat, 31 Oct 2020 05:07:33 +0000 (22:07 -0700)]
[lldb] Fix XcodeSDKModuleTests
Update XcodeSDKModuleTests for YAMLModuleTester changes in D90393.
LLVM GN Syncbot [Sat, 31 Oct 2020 05:19:04 +0000 (05:19 +0000)]
[gn build] Port
756f5978410
Liu, Chen3 [Fri, 30 Oct 2020 04:58:05 +0000 (12:58 +0800)]
[X86] Support Intel avxvnni
This patch mainly made the following changes:
1. Support AVX-VNNI instructions;
2. Introduce ExplicitVEXPrefix flag so that vpdpbusd/vpdpbusds/vpdpbusds/vpdpbusds instructions only use vex-encoding when user explicity add {vex} prefix.
Differential Revision: https://reviews.llvm.org/D89105
Petr Hosek [Fri, 30 Oct 2020 23:16:09 +0000 (16:16 -0700)]
[NFC][CMake] Move some COMPILER_RT variables setup
Part of D88922
Petr Hosek [Fri, 30 Oct 2020 23:16:09 +0000 (16:16 -0700)]
[CMake] Add -fno-rtti into tsan unittests
And some other NFC parts of D88922
Petr Hosek [Fri, 30 Oct 2020 23:16:09 +0000 (16:16 -0700)]
[CMake] Remove cxx-headers from runtime deps
Part of D88922
Petr Hosek [Fri, 30 Oct 2020 23:16:09 +0000 (16:16 -0700)]
[CMake] Replace ctime with time.h in memprof
Part of D88922
Richard Smith [Sat, 31 Oct 2020 01:30:56 +0000 (18:30 -0700)]
PR42513: Fix handling of function definitions lazily instantiated from
friends.
When determining whether a function has a template instantiation
pattern, look for other declarations of that function that were
instantiated from a friend function definition, rather than assuming
that checking for member specialization information on whichever
declaration name lookup found will be sufficient.
Ali Tamur [Sat, 31 Oct 2020 01:27:28 +0000 (18:27 -0700)]
[lld][WebAssembly] Do not specify temporary file name in tests.
bad-reloc.yaml test introduced at
9d1409df87 uses a name (out.wasm) to specify a
temporary output file name, which causes breakage in our system.
Wouter van Oortmerssen [Sat, 31 Oct 2020 00:32:55 +0000 (17:32 -0700)]
[WebAssembly] fix paths in dwarfdump64.ll test
peter klausler [Fri, 30 Oct 2020 21:18:20 +0000 (14:18 -0700)]
[flang] Plug error recovery hole for erroneous subscripts
Avoid a crash in folding an empty vector of subscripts
that resulted from a semantic error.
Differential revision: https://reviews.llvm.org/D90499
Thomas Lively [Sat, 31 Oct 2020 00:23:30 +0000 (17:23 -0700)]
[WebAssembly] Prototype i64x2.bitmask
As proposed in https://github.com/WebAssembly/simd/pull/368.
Differential Revision: https://reviews.llvm.org/D90514
peter klausler [Fri, 30 Oct 2020 19:47:23 +0000 (12:47 -0700)]
[flang] Better error messages & more cases caught for bad forward refs
Subclause 10.1.12 in F'2018 prohibits forward references from
a specification expression to an object declared later in the
same specification part. Catch this error better and emit
specific error messages about the violation.
Differential revision: https://reviews.llvm.org/D90492
Wouter van Oortmerssen [Fri, 30 Oct 2020 21:35:43 +0000 (14:35 -0700)]
[WebAssembly] Fixed DWARF DW_AT_low_pc encoded as 64-bit in wasm64
Also added general wasm64 DWARF test
Also added asserts for unsupported reloc combinations that triggered this bug.
Differential Revision: https://reviews.llvm.org/D90503
peter klausler [Fri, 30 Oct 2020 20:30:42 +0000 (13:30 -0700)]
[flang] Add warning for FINAL pitfall
Fortran's FINAL feature is sensitive to object rank.
When an object's rank excludes it from finalization, but
the type has FINAL subroutines for other ranks, emit
a warning. This should be especially helpful in the
case of a scalar FINAL subroutine not being declared
(IMPURE) ELEMENTAL.
Differential revision: https://reviews.llvm.org/D90495
Thomas Lively [Fri, 30 Oct 2020 23:38:15 +0000 (16:38 -0700)]
[WebAssembly] Prototype i64x2.eq
As proposed in https://github.com/WebAssembly/simd/pull/381. Since it is still
in the prototyping phase, it is only accessible via a target builtin function
and a target intrinsic.
Depends on D90504.
Differential Revision: https://reviews.llvm.org/D90508
Nathan James [Fri, 30 Oct 2020 23:17:11 +0000 (23:17 +0000)]
[clang-tidy][test] Fix test failure when LLVM_ENABLE_WERROR is set.
After https://reviews.llvm.org/D80531 landed, a subtle bug was introduced where the test would fail if `LLVM_ENABLE_WERROR` was set. This just silences that error so the test case runs correctly, down the line it may be worth not enabling `-Werror` for clang-tidy tests even if the cmake flag is passed.
Tony [Fri, 30 Oct 2020 22:36:12 +0000 (22:36 +0000)]
[NFC][AMDGPU] Minor cleanup to AMDGPU memory model table
Differential Revision: https://reviews.llvm.org/D90509
peter klausler [Fri, 30 Oct 2020 19:53:42 +0000 (12:53 -0700)]
[flang] Detect and rewrite ambiguous READ(CVAR)[,item-list]
READ(CVAR)[,item-list] with a character variable CVAR
could be parsed as an unformatted READ from an internal
unit or as a formatted READ from the default external unit
with a needlessly parenthesized variable format. We parse
it as the former, but Fortran doesn't have unformatted
internal I/O.
Differential revision: https://reviews.llvm.org/D90493
Thomas Lively [Fri, 30 Oct 2020 22:44:04 +0000 (15:44 -0700)]
[WebAssembly] Prototype i64x2.widen_{low,high}_i32x4_{s,u}
As proposed in https://github.com/WebAssembly/simd/pull/290. As usual, these
instructions are available only via builtin functions and intrinsics while they
are in the prototyping stage.
Differential Revision: https://reviews.llvm.org/D90504
Mehdi Amini [Fri, 30 Oct 2020 21:25:49 +0000 (21:25 +0000)]
Use `--allow-unused-prefixes=false` by default for FileCheck in MLIR testsuite
This option catches unexpected mismatch when a prefix is given to
FileCheck on the command line but never matches a single line in the
test.
See http://lists.llvm.org/pipermail/llvm-dev/2020-October/146162.html
for more info.
Differential Revision: https://reviews.llvm.org/D90501
Florian Hahn [Fri, 30 Oct 2020 21:20:28 +0000 (21:20 +0000)]
Revert "[SLP] Consider alternatives for cost of select instructions."
This reverts commit
19225704890632cd2552f41ada41600a20db1371.
This appears to cause a crash in the following example
a, b, c;
l() {
int e = a, f = l, g, h, i, j;
float *d = c, *k = b;
for (;;)
for (; g < f; g++) {
k[h] = d[i];
k[h - 1] = d[j];
h += e << 1;
i += e;
}
}
clang -cc1 -triple i386-unknown-linux-gnu -emit-obj -target-cpu pentium-m -O1 -vectorize-loops -vectorize-slp reduced.c
llvm::Type *llvm::Type::getWithNewBitWidth(unsigned int) const: Assertion `isIntOrIntVectorTy() && "Original type expected to be a vector of integers or a scalar integer."' failed.
Florian Hahn [Fri, 30 Oct 2020 21:19:52 +0000 (21:19 +0000)]
Revert "[TTI] Add VecPred argument to getCmpSelInstrCost."
This reverts commit
73f01e3df58dca9d1596440b866b52929e3878de.
This appears to break
http://lab.llvm.org:8011/#/builders/85/builds/383.
Peter Collingbourne [Tue, 27 Oct 2020 23:26:29 +0000 (16:26 -0700)]
hwasan: Support for outlined checks in the Linux kernel.
Add support for match-all tags and GOT-free runtime calls, which
are both required for the kernel to be able to support outlined
checks. This requires extending the access info to let the backend
know when to enable these features. To make the code easier to maintain
introduce an enum with the bit field positions for the access info.
Allow outlined checks to be enabled with -mllvm
-hwasan-inline-all-checks=0. Kernels that contain runtime support for
outlined checks may pass this flag. Kernels lacking runtime support
will continue to link because they do not pass the flag. Old versions
of LLVM will ignore the flag and continue to use inline checks.
With a separate kernel patch [1] I measured the code size of defconfig
+ tag-based KASAN, as well as boot time (i.e. time to init launch)
on a DragonBoard 845c with an Android arm64 GKI kernel. The results
are below:
code size boot time
before
92824064 6.18s
after
38822400 6.65s
[1] https://linux-review.googlesource.com/id/I1a30036c70ab3c3ee78d75ed9b87ef7cdc3fdb76
Depends on D90425
Differential Revision: https://reviews.llvm.org/D90426
Mircea Trofin [Fri, 30 Oct 2020 20:52:03 +0000 (13:52 -0700)]
[FileCheck] Address unused prefixes in tests
Added -allow-unused-prefixes as necessary.
Differential Revision: https://reviews.llvm.org/D90496
Sean Silva [Fri, 23 Oct 2020 17:30:59 +0000 (10:30 -0700)]
[mlir] Add BufferResultsToOutParams pass.
This pass allows removing getResultConversionKind from
BufferizeTypeConverter. This pass replaces the AppendToArgumentsList
functionality. As far as I could tell, the only use of this functionlity
is to perform the transformation that is implemented in this pass.
Future patches will remove the getResultConversionKind machinery from
BufferizeTypeConverter, but sending this patch for individual review for
clarity.
Differential Revision: https://reviews.llvm.org/D90071
Cameron McInally [Fri, 30 Oct 2020 20:32:22 +0000 (15:32 -0500)]
[Legalize] Add legalizations for VECREDUCE_SEQ_FADD
Add Legalization support for VECREDUCE_SEQ_FADD, so that we don't need to depend on ExpandReductionsPass.
Differential Revision: https://reviews.llvm.org/D90247
ergawy [Fri, 30 Oct 2020 18:36:19 +0000 (14:36 -0400)]
[MLIR][SPIRV] Start module combiner.
This commit adds a new library that merges/combines a number of spv
modules into a combined one. The library has a single entry point:
combine(...).
To combine a number of MLIR spv modules, we move all the module-level ops
from all the input modules into one big combined module. To that end, the
combination process can proceed in 2 phases:
(1) resolving conflicts between pairs of ops from different modules
(2) deduplicate equivalent ops/sub-ops in the merged module. (TODO)
This patch implements only the first phase.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D90477
Sean Silva [Tue, 27 Oct 2020 16:59:33 +0000 (09:59 -0700)]
[mlir] Move some linalg patterns around.
The bufferization patterns are moved to the .cpp file, which is
preferred in the codebase when it makes sense.
The LinalgToStandard patterns are kept a header because they are
expected to be used individually. However, they are moved to
LinalgToStandard.h which is the file corresponding to where they are
defined.
This also removes TensorCastOpConverter, which is handled by
populateStdBufferizePatterns now. Eventually, the constant op lowering
will be handled as well, but it there are currently holdups on moving
it (see https://reviews.llvm.org/D89916).
Differential Revision: https://reviews.llvm.org/D90254
Geoffrey Martin-Noble [Fri, 30 Oct 2020 20:32:02 +0000 (13:32 -0700)]
Revert "[MLIR][SPIRV] Start module combiner."
This reverts commit
27324f28552d0c66e8b28efd9c15820e5f246619.
Shared libs build is broken linking lib/libMLIRSPIRVModuleCombiner.so:
```
ModuleCombiner.cpp:
undefined reference to `mlir::spirv::ModuleOp::addressing_model()
```
https://buildkite.com/mlir/mlir-core/builds/8988#
e3d966b9-ea43-492e-a192-
b28e71e9a15b
Keith Smiley [Thu, 29 Oct 2020 21:10:53 +0000 (14:10 -0700)]
[clang][NFC] Remove unused FileCheck prefix
This is to enable --allow-unused-duplicates=false. This prefix appears
to be outdated and intentionally unused.
Differential Revision: https://reviews.llvm.org/D90430
Duncan P. N. Exon Smith [Fri, 30 Oct 2020 20:29:16 +0000 (16:29 -0400)]
Remove `noexcept` from
ac49500cd0484e1b2dcf37fa4c0dade6f113c2c9 to fix bots
I'm having trouble with bots today. Remove more cargo-cult from the
generic version of `OptionalStorage` that is failing on some (fewer)
bots (but not locally).
I expect this will fix:
```
FAILED: tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/FileEntryTest.cpp.o
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -DGTEST_HAS_TR1_TUPLE=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/unittests/Basic -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/include -Itools/clang/include -Iinclude -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/utils/unittest/googletest/include -I/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/utils/unittest/googlemock/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -Wno-variadic-macros -fno-exceptions -fno-rtti -UNDEBUG -Wno-suggest-override -std=c++14 -MD -MT tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/FileEntryTest.cpp.o -MF tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/FileEntryTest.cpp.o.d -o tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/FileEntryTest.cpp.o -c /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp: In member function ‘virtual void {anonymous}::FileEntryTest_OptionalFileEntryRefDegradesToFileEntryPtr_Test::TestBody()’:
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp:48:46: error: use of deleted function ‘constexpr clang::OptionalFileEntryRefDegradesToFileEntryPtr::OptionalFileEntryRefDegradesToFileEntryPtr()’
OptionalFileEntryRefDegradesToFileEntryPtr M0;
^~
In file included from /home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp:9:
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/include/clang/Basic/FileEntry.h:250:3: note: ‘constexpr clang::OptionalFileEntryRefDegradesToFileEntryPtr::OptionalFileEntryRefDegradesToFileEntryPtr() noexcept’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
OptionalFileEntryRefDegradesToFileEntryPtr() noexcept = default;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp: In member function ‘virtual void {anonymous}::FileEntryTest_equals_Test::TestBody()’:
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/clang/unittests/Basic/FileEntryTest.cpp:82:46: error: use of deleted function ‘constexpr clang::OptionalFileEntryRefDegradesToFileEntryPtr::OptionalFileEntryRefDegradesToFileEntryPtr()’
OptionalFileEntryRefDegradesToFileEntryPtr M0;
^~
```
Peter Collingbourne [Tue, 27 Oct 2020 23:26:07 +0000 (16:26 -0700)]
hwasan: Move fixed shadow behind opaque no-op cast as well.
This is a workaround for poor heuristics in the backend where we can
end up materializing the constant multiple times. This is particularly
bad when using outlined checks because we materialize it for every call
(because the backend considers it trivial to materialize).
As a result the field containing the shadow base value will always
be set so simplify the code taking that into account.
Differential Revision: https://reviews.llvm.org/D90425
Paul C. Anagnostopoulos [Fri, 30 Oct 2020 17:31:29 +0000 (13:31 -0400)]
[TableGen] Remove spurious GISEL prefix from test.
Differential Revision: https://reviews.llvm.org/D90480
Peter Collingbourne [Tue, 27 Oct 2020 21:56:21 +0000 (14:56 -0700)]
AArch64: Use SBFX instead of UBFX to extract address granule in outlined HWASan checks.
In a kernel (or in general in environments where bit 55 of the address
is set) the shadow base needs to point to the end of the shadow region,
not the beginning. Bit 55 needs to be sign extended into bits 52-63
of the shadow base offset, otherwise we end up loading from an invalid
address. We can do this by using SBFX instead of UBFX.
Using SBFX should have no effect in the userspace case where bit 55
of the address is clear so we do so unconditionally. I don't think
we need a ABI version bump for this (but one will come anyway when
we switch to x20 for the shadow base register).
Differential Revision: https://reviews.llvm.org/D90424
Peter Collingbourne [Tue, 27 Oct 2020 19:10:08 +0000 (12:10 -0700)]
AArch64: Switch to x20 as the shadow base register for outlined HWASan checks.
From a code size perspective it turns out to be better to use a
callee-saved register to pass the shadow base. For non-leaf functions
it avoids the need to reload the shadow base into x9 after each
function call, at the cost of an additional stack slot to save the
caller's x20. But with x9 there is also a stack size cost, either
as a result of copying x9 to a callee-saved register across calls or
by spilling it to stack, so for the non-leaf functions the change to
stack usage is largely neutral.
It is also code size (and stack size) neutral for many leaf functions.
Although they now need to save/restore x20 this can typically be
combined via LDP/STP into the x30 save/restore. In the case where
the function needs callee-saved registers or stack spills we end up
needing, on average, 8 more bytes of stack and 1 more instruction
but given the improvements to other functions this seems like the
right tradeoff.
Unfortunately we cannot change the register for the v1 (non short
granules) check because the runtime assumes that the shadow base
register is stored in x9, so the v1 check still uses x9.
Aside from that there is no change to the ABI because the choice
of shadow base register is a contract between the caller and the
outlined check function, both of which are compiler generated. We do
need to rename the v2 check functions though because the functions
are deduplicated based on their names, not on their contents, and we
need to make sure that when object files from old and new compilers
are linked together we don't end up with a function that uses x9
calling an outlined check that uses x20 or vice versa.
With this change code size of /system/lib64/*.so in an Android build
with HWASan goes from
200066976 bytes to
194085912 bytes, or a 3%
decrease.
Differential Revision: https://reviews.llvm.org/D90422
Nikita Popov [Fri, 30 Oct 2020 19:26:42 +0000 (20:26 +0100)]
[PhaseOrdering] Add test for PR39282 (NFC)
While the actually incorrect transform happens in LoopUnroll, it
is based on noalias metadata inserted by the inliner, and
ultimately manifests in GVN. Add a phase ordering test that checks
this even if our representation of noalias metadata changes in
the future.
Mircea Trofin [Thu, 29 Oct 2020 00:44:13 +0000 (17:44 -0700)]
[FileCheck] Report missing prefixes when more than one is provided.
If more than a prefix is provided - e.g. --check-prefixes=CHECK,FOO - we
don't report if (say) FOO is never used. This may lead to a gap in our
test coverage.
This patch introduces a new option, --allow-unused-prefixes. It
currently is set to true, keeping today's behavior. After we explicitly
set it in tests where this behavior was actually intentional, we will
switch it to false by default.
Differential Revision: https://reviews.llvm.org/D90281
LLVM GN Syncbot [Fri, 30 Oct 2020 19:18:17 +0000 (19:18 +0000)]
[gn build] Port
ac49500cd04
Joseph Tremoulet [Fri, 30 Oct 2020 19:13:26 +0000 (15:13 -0400)]
[lldb] Report old modules from ModuleList::ReplaceEquivalent
This allows the Target to update its module list when loading a shared
module replaces an equivalent one.
A testcase is added which hits this codepath -- without the fix, the
target reports libbreakpad.so twice in its module list.
Reviewed By: jingham
Differential Revision: https://reviews.llvm.org/D89157
Joseph Tremoulet [Fri, 30 Oct 2020 19:12:10 +0000 (15:12 -0400)]
[lldb] GetSharedModule: Collect old modules in SmallVector
The various GetSharedModule methods have an optional out parameter for
the old module when a file has changed or been replaced, which the
Target uses to keep its module list current/correct. We've been using
a single ModuleSP to track "the" old module, and this change switches
to using a SmallVector of ModuleSP, which has a couple benefits:
- There are multiple codepaths which may discover an old module, and
this centralizes the code for how to handle multiples in one place,
in the Target code. With the single ModuleSP, each place that may
discover an old module is responsible for how it handles multiples,
and the current code is inconsistent (some code paths drop the first
old module, others drop the second).
- The API will be more natural for identifying old modules in routines
that work on sets, like ModuleList::ReplaceEquivalent (which I plan
on updating to report old module(s) in a subsequent change to fix a
bug).
I'm not convinced we can ever actually run into the case that multiple
old modules are found in the same GetOrCreateModule call, but I think
this change makes sense regardless, in light of the above.
When an old module is reported, Target::GetOrCreateModule calls
m_images.ReplaceModule, which doesn't allow multiple "old" modules; the
new code calls ReplaceModule for the first "old" module, and for any
subsequent old modules it logs the event and calls m_images.Remove.
Reviewed By: jingham
Differential Revision: https://reviews.llvm.org/D89156
Anna Thomas [Fri, 30 Oct 2020 16:48:18 +0000 (12:48 -0400)]
[CFG] Replace hardcoded max BBs explored as CL option. NFC.
This option was hardcoded to 32. Changing this as a CL option since we
have seen some cases downstream where increasing this limit allows us to
disprove reachability.
Reviewed-By: jdoerfert
Differential Revision: https://reviews.llvm.org/D90487
Duncan P. N. Exon Smith [Fri, 30 Oct 2020 18:08:19 +0000 (14:08 -0400)]
Reapply "FileManager: Improve the FileEntryRef API and customize its OptionalStorage"
This reverts commit
940d0a310dca31ae97080b068cef92eadfee6367,
effectively reapplying
84e8257937ec6a332aa0b688f4dce57016516ffd, after
working around the compile errors on the bots that I wasn't seeing
locally. I removed the `constexpr` from `OptionalStorage<FileEntryRef>`
that I had cargo-culted from the generic version, since `FileEntryRef`
isn't relevant in `constexpr` contexts anyway.
The original commit message follows:
Make a few changes to the `FileEntryRef` API in preparation for
propagating it enough to remove `FileEntry::getName()`.
- Allow `FileEntryRef` to degrade implicitly to `const FileEntry*`. This
allows functions currently returning `const FileEntry *` to be updated
to return `FileEntryRef` without requiring all callers to be updated
in the same patch. This helps avoid both (a) massive patches where
many fields and locals are updated simultaneously and (b) noisy
incremental patches where the first patch adds `getFileEntry()` at
call sites and the second patch removes it. (Once `FileEntryRef` is
everywhere, we should remove this API.)
- Change `operator==` to compare the underlying `FileEntry*`, ignoring
any difference in the spelling of the filename. There were 0 users of
the existing function because it's not useful. In case comparing the
exact named reference becomes important, add/test `isSameRef`.
- Add `==` comparisons between `FileEntryRef` and `const FileEntry *`
(compares the `FileEntry*`).
- Customize `OptionalStorage<FileEntryRef>` to be pointer-sized. Add
a private constructor that initializes with `nullptr` and specialize
`OptionalStorage` to use it. This unblocks updating fields in
size-sensitive data structures that currently use `const FileEntry *`.
- Add `OptionalFileEntryRefDegradesToFileEntryPtr`, a wrapper around
`Optional<FileEntryRef>` that degrades to `const FileEntry*`. This
facilitates future incremental patches, like the same operator on
`FileEntryRef`. (Once `FileEntryRef` is everywhere, we should remove
this class.)
- Remove the unncessary `const` from the by-value return of
`FileEntryRef::getName`.
- Delete the unused function `FileEntry::isOpenForTests`.
Note that there are still `FileEntry` APIs that aren't wrapped and I
plan to deal with these separately / incrementally, as they are needed.
Differential Revision: https://reviews.llvm.org/D89834
ergawy [Fri, 30 Oct 2020 18:36:19 +0000 (14:36 -0400)]
[MLIR][SPIRV] Start module combiner.
This commit adds a new library that merges/combines a number of spv
modules into a combined one. The library has a single entry point:
combine(...).
To combine a number of MLIR spv modules, we move all the module-level ops
from all the input modules into one big combined module. To that end, the
combination process can proceed in 2 phases:
(1) resolving conflicts between pairs of ops from different modules
(2) deduplicate equivalent ops/sub-ops in the merged module. (TODO)
This patch implements only the first phase.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D90477
Scott Linder [Fri, 30 Oct 2020 18:37:28 +0000 (18:37 +0000)]
[AMDGPU] Refactor and extend elf-header-flags-mach tests
* Factor out common elements of the input YAML document and use sed to
macro replace the run line specific elements.
* Add checks for the common elements which depend on the ELF class.
* Use non-numeric suffix for temporary files to avoid merge conflicts.
* Sort tests by GFX# ascending.
* Group ELF and YAML tests by GFX#.
Reviewed By: t-tye
Differential Revision: https://reviews.llvm.org/D90245
Louis Dionne [Fri, 30 Oct 2020 18:55:37 +0000 (14:55 -0400)]
[libc++] Fix tests failing with Clang after removing GCC warnings
Dmitry Vyukov [Fri, 30 Oct 2020 18:42:48 +0000 (19:42 +0100)]
tsan: add Go race detector support for macOS/ARM64
Add Go race detector support for macOS/ARM64. The Go counterpart is https://golang.org/cl/266373 .
Author: cherry (Cherry Zhang)
Reviewed-in: https://reviews.llvm.org/D90435
LLVM GN Syncbot [Fri, 30 Oct 2020 18:08:01 +0000 (18:08 +0000)]
[gn build] Port
940d0a310dc
Duncan P. N. Exon Smith [Fri, 30 Oct 2020 18:06:15 +0000 (14:06 -0400)]
Revert "FileManager: Improve the FileEntryRef API and customize its OptionalStorage" and follow-ups
This reverts commit
5530fb586f30da9dcb434f6be39198dbf016b866.
This reverts commit
010238a296e61cbf6f4d7f4383e26cf00c4e4992.
This reverts commit
84e8257937ec6a332aa0b688f4dce57016516ffd.
Having trouble getting the bots compiling. Will try again later.
Duncan P. N. Exon Smith [Fri, 30 Oct 2020 18:04:48 +0000 (14:04 -0400)]
Speculative fix for bots after
84e8257937ec6a332aa0b688f4dce57016516ffd, v2
Looks like some bots don't like the defaulted default constructor, try
being explicit.
Duncan P. N. Exon Smith [Fri, 30 Oct 2020 17:58:00 +0000 (13:58 -0400)]
Speculative fix for bots after
84e8257937ec6a332aa0b688f4dce57016516ffd
I'm not seeing an error locally, but many bots are having a problem with
the call to `hasOptionalValue`. Try to fix it.
LLVM GN Syncbot [Fri, 30 Oct 2020 17:54:57 +0000 (17:54 +0000)]
[gn build] Port
84e8257937e
Nico Weber [Fri, 30 Oct 2020 17:48:44 +0000 (13:48 -0400)]
[gn build] port
e58660750e76
Made necessary by
c479e0c99459e4, which requires std::timespec
to exist, which it only does in c++17 and later.
Craig Topper [Fri, 30 Oct 2020 17:25:44 +0000 (10:25 -0700)]
[RISCV] Don't use DCI.CombineTo to replace a single result. NFCI
Just return the new node, which is the standard practice.
I also noticed what appeared to be an unnecessary attempt at
creating an ANY_EXTEND where the type should already be correct.
I replace with an assert to verify the type.
Differential Revision: https://reviews.llvm.org/D90444
Zequan Wu [Wed, 28 Oct 2020 18:23:56 +0000 (11:23 -0700)]
[lldb][NFC] Refactor getUUID functionality
Differential Revision: https://reviews.llvm.org/D90325
Ronald Wampler [Mon, 28 Sep 2020 21:07:44 +0000 (17:07 -0400)]
[Support] PR42623: Avoid setting the delete-on-close bit if a TempFile doesn't reside on a local drive
On Windows, after commit
881ba104656c40098d4bc90c52613c08136f0fe1, tools
using TempFile would error with "bad file descriptor" when writing the
file on a network drive. It appears that setting the delete-on-close bit via
SetFileInformationByHandle/FileDispositionInfo prevented it from
accessing the file on network drives, and although using
FILE_DISPOSITION_INFO seems to work, it causes other troubles.
Differential Revision: https://reviews.llvm.org/D81803
Duncan P. N. Exon Smith [Tue, 20 Oct 2020 03:36:26 +0000 (23:36 -0400)]
FileManager: Improve the FileEntryRef API and customize its OptionalStorage
Make a few changes to the `FileEntryRef` API in preparation for
propagating it enough to remove `FileEntry::getName()`.
- Allow `FileEntryRef` to degrade implicitly to `const FileEntry*`. This
allows functions currently returning `const FileEntry *` to be updated
to return `FileEntryRef` without requiring all callers to be updated
in the same patch. This helps avoid both (a) massive patches where
many fields and locals are updated simultaneously and (b) noisy
incremental patches where the first patch adds `getFileEntry()` at
call sites and the second patch removes it. (Once `FileEntryRef` is
everywhere, we should remove this API.)
- Change `operator==` to compare the underlying `FileEntry*`, ignoring
any difference in the spelling of the filename. There were 0 users of
the existing function because it's not useful. In case comparing the
exact named reference becomes important, add/test `isSameRef`.
- Add `==` comparisons between `FileEntryRef` and `const FileEntry *`
(compares the `FileEntry*`).
- Customize `OptionalStorage<FileEntryRef>` to be pointer-sized. Add
a private constructor that initializes with `nullptr` and specialize
`OptionalStorage` to use it. This unblocks updating fields in
size-sensitive data structures that currently use `const FileEntry *`.
- Add `OptionalFileEntryRefDegradesToFileEntryPtr`, a wrapper around
`Optional<FileEntryRef>` that degrades to `const FileEntry*`. This
facilitates future incremental patches, like the same operator on
`FileEntryRef`. (Once `FileEntryRef` is everywhere, we should remove
this class.)
- Remove the unncessary `const` from the by-value return of
`FileEntryRef::getName`.
- Delete the unused function `FileEntry::isOpenForTests`.
Note that there are still `FileEntry` APIs that aren't wrapped and I
plan to deal with these separately / incrementally, as they are needed.
Differential Revision: https://reviews.llvm.org/D89834
Richard Smith [Fri, 30 Oct 2020 02:01:19 +0000 (19:01 -0700)]
PR47861: Expand dangling reference warning to look through copy
construction, and to assume that assignment operators return *this.
Sam Clegg [Fri, 30 Oct 2020 03:37:16 +0000 (20:37 -0700)]
[lld][WebAssembly] Give better warnings on bad relocation sites
Differential Revision: https://reviews.llvm.org/D90443
Arthur Eubanks [Thu, 29 Oct 2020 22:43:31 +0000 (15:43 -0700)]
[NFC] Clean up PassBuilder
Make DebugLogging a member variable so that users of PassBuilder don't
need to pass it around so much.
Move call to TargetMachine::registerPassBuilderCallbacks() within
PassBuilder so users don't need to remember to call it.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D90437
Arthur Eubanks [Wed, 30 Sep 2020 19:11:46 +0000 (12:11 -0700)]
Use uint64_t for branch weights instead of uint32_t
CallInst::updateProfWeight() creates branch_weights with i64 instead of i32.
To be more consistent everywhere and remove lots of casts from uint64_t
to uint32_t, use i64 for branch_weights.
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D88609
Andrzej Warzynski [Fri, 30 Oct 2020 15:57:42 +0000 (15:57 +0000)]
[clang][driver] Rename DriverOption as NoXarchOption (NFC)
As discussed in [1], ClangFlags::DriverOption is currently only used to
mark options that should not be forwarded to other tools via `-Xarch`
options. This patch renames this flag accordingly and updates the
corresponding driver diagnostic.
A comment in ToolChain::TranslateXarchArgs is also updated to reflect
the change. The original comment referred to isDriverOption(), which is
no longer available.
[1] http://lists.llvm.org/pipermail/cfe-dev/2020-October/066953.html
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D89799
Louis Dionne [Fri, 30 Oct 2020 16:50:58 +0000 (12:50 -0400)]
[libc++] Add -Wno-sized-deallocation to avoid spurious GCC warnings
GCC tries to be nice and tell us that we probably want to also implement
sized deallocation functions when we override the normal ones. However,
we know what we're doing in the test suite and don't want to override
them.
Pedro Tammela [Fri, 30 Oct 2020 16:50:07 +0000 (16:50 +0000)]
[NFC][Reg2Mem] modernize loops iterators
This patch updates the Reg2Mem loops to use more modern iterators.
Differential Revision: https://reviews.llvm.org/D90122
Pedro Tammela [Fri, 30 Oct 2020 16:34:01 +0000 (16:34 +0000)]
[NFC][LoopSimplify] modernize for loops over LoopInfo
This patch modifies two for loops to use the range based syntax.
Since they are equivalent, this patch is tagged NFC.
Differential Revision: https://reviews.llvm.org/D90069
Louis Dionne [Fri, 30 Oct 2020 15:19:07 +0000 (11:19 -0400)]
[libc++] NFC: Fix several GCC warnings in the test suite
- Several -Wshadow warnings
- Several places where we did not initialize our base class explicitly
- Unused variable warnings
- Some tautological comparisons
- Some places where we'd pass null arguments to functions expecting
non-null (in unevaluated contexts)
- Add a few pragmas to turn off spurious warnings
- Fix warnings about declarations that don't declare anything
- Properly disable deprecation warnings in ext/ tests (the pragmas we
were using didn't work on GCC)
- Disable include_as_c.sh.cpp because GCC complains about C++ flags
when compiling as C. I couldn't find a way to fix this one properly,
so I'm disabling the test. This isn't great, but at least we'll be
able to enable warnings in the whole test suite with GCC.
Daniel Kiss [Fri, 30 Oct 2020 16:42:23 +0000 (17:42 +0100)]
[libunwind] Support DW_CFA_remember/restore_state without heap allocation.
This patch just reorganises the code to make possible to use alloca
instead of malloc. This makes possible to use `.cfi_remember_state`/`.cfi_restore_state` on
platforms without heap allocation.
Also it will be safe to backtrace/unwind faults related to the allocator behind malloc.
`_LIBUNWIND_REMEMBER_HEAP_ALLOC ` option reenables the heap usage for `.cfi_remember_state`/`.cfi_restore_state`.
Define _LIBUNWIND_REMEMBER_STACK_ALLOC to force stack allocation.
Reviewed By: #libunwind, mstorsjo
Differential Revision: https://reviews.llvm.org/D85005
Sanjay Patel [Fri, 30 Oct 2020 16:05:01 +0000 (12:05 -0400)]
[x86] add cost overrides for mul with overflow
I'm assuming the standard size integer instructions for this end up as something like:
mulq %rsi
seto %al
And the 'mul' generally has reciprocal throughput of 1 on typical implementations
(higher latency, but that's not handled here).
The default costs may end up much higher than that, and that's what we see in the test diffs.
Vector types are left as a 'TODO'.
Differential Revision: https://reviews.llvm.org/D90431
Amy Huang [Tue, 27 Oct 2020 00:11:45 +0000 (17:11 -0700)]
[CodeView] Encode signed int values correctly when emitting S_CONSTANTs
Differential Revision: https://reviews.llvm.org/D90199
Simon Pilgrim [Fri, 30 Oct 2020 16:22:55 +0000 (16:22 +0000)]
[CodeGen][X86] Remove unused check-prefix in constrained fma tests
Simon Pilgrim [Fri, 30 Oct 2020 16:18:44 +0000 (16:18 +0000)]
[CodeGen][X86] Remove unused check-prefix in movdir tests
Jonas Devlieghere [Fri, 30 Oct 2020 16:17:10 +0000 (09:17 -0700)]
[lldb] Ignore binary data in crashlog
Skip the instruction stream section in the crashlog section.
Differential revision: https://reviews.llvm.org/D90414
Simon Pilgrim [Fri, 30 Oct 2020 16:13:14 +0000 (16:13 +0000)]
[CodeGen][X86] Cleanup + fix unused check-prefixes in bmi tests
Simon Pilgrim [Fri, 30 Oct 2020 16:12:15 +0000 (16:12 +0000)]
[CodeGen][X86] Tidyup CHECKs on bitscan tests
Simon Pilgrim [Fri, 30 Oct 2020 16:07:30 +0000 (16:07 +0000)]
[CodeGen][X86] Remove unused check-prefix in bitscan tests
Simon Pilgrim [Fri, 30 Oct 2020 16:04:20 +0000 (16:04 +0000)]
[CodeGen][X86] Remove unused check-prefix in bswap tests
Simon Pilgrim [Fri, 30 Oct 2020 16:01:33 +0000 (16:01 +0000)]
[CodeGen][X86] Cleanup + remove unused check-prefixes in avx union tests
Simon Pilgrim [Fri, 30 Oct 2020 15:56:16 +0000 (15:56 +0000)]
[CodeGen][X86] Remove unused check-prefix in amx inline asm tests
Pavel Labath [Fri, 30 Oct 2020 15:38:23 +0000 (16:38 +0100)]
Fix an embarrasing use-after-free from
a895a446bcde
Jan Kratochvil [Fri, 30 Oct 2020 15:43:45 +0000 (16:43 +0100)]
[nfc] [lldb] Align `user_id_t` format to the current `DIERef` format
Current user_id_t format is:
63{isDebugTypes} 62..32{dwo ||
7fffffff}
31..0 {die_offset}
while current DIERef format is (I have made up the bit positions but the
field widths do match):
63{m_section==isDebugTypes} 62{m_dwo_num_valid} 61..32{m_dwo_num}
31..0 {m_die_offset}
Proposing to change user_id_t to:
63{isDebugTypes} 62{dwo_is_valid} 61..32{dwo; 0 if !valid}
31..0 {die_offset}
There is no benefit of having 31-bits wide dwo_num in user_id_t when it
gets converted to 30-bits width in DIERef.
This patch is for future DWZ patchset which extends the dwo_is_valid bit
into a 2-bit field (normal, DWO, DWZ, DWZcommon) so that both user_id_t
and DIERef can be changed then the same way.
It would be best to somehow unify user_id_t and DIERef but I do not plan
to do that. user_id_t should probably remain a number for the Python API
compatibility while there still needs to be some class with all the
methods to access it.
SymbolFileDWARF::GetDwpSymbolFile() and SymbolFileDWARF::GetDIE use
0x3fffffff for DWP but that does not clash:
formerly:
31bits32..62:0x7fffffff = normal unit / not any DWO
31bits32..62:0x3fffffff = DWP
31bits32..62:others = DWO unit number
after this patch:
bit62=0 30bits32..61:any = normal unit / not any DWO
bit62=1 30bits32..61:0x3fffffff = DWP
bit62=1 30bits32..61:others = DWO unit number
Differential Revision: https://reviews.llvm.org/D90413
Simon Moll [Fri, 30 Oct 2020 15:44:13 +0000 (16:44 +0100)]
[VE][NFC] move scalar tests to Scalar/
Restructure lit tests to follow downstream
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D90468
Keith Smiley [Fri, 30 Oct 2020 15:27:50 +0000 (08:27 -0700)]
[llvm-cov][NFC] Remove unused prefixes from FileCheck usage
This is to enable `--allow-unused-duplicates=false`. These prefixes
appear to be outdated and intentionally unused.
Reviewed By: vsk
Differential Revision: https://reviews.llvm.org/D90423
Michael Liao [Fri, 30 Oct 2020 14:55:04 +0000 (10:55 -0400)]
[gvn] PRE needs to skip convergent intrinsics/calls.
- As convergent intrinsics/calls could only be moved to
control-equivalent blocks, or more precisely the same divergent
branch, PRE needs to skip them.
Differential Revision: https://reviews.llvm.org/D90391
Evgeniy Brevnov [Thu, 29 Oct 2020 07:27:54 +0000 (14:27 +0700)]
[DSE] Improve partial overlap detection
Currently isOverwrite returns OW_MaybePartial even for accesss known not to overlap. This is not a big problem for legacy implementation (since isPartialOverwrite follows isOverwrite and clarifies the result). Contrary SSA based version does a lot of work to later find out that accesses don't overlap. Besides negative impact on compile time we quickly reach MemorySSAPartialStoreLimit and miss optimization opportunities.
Note: In fact, I think it would be cleaner implementation if isOverwrite returned fully clarified result in the first place whithout need to call isPartialOverwrite. This can be done as a follow up. What do you think?
Reviewed By: fhahn, asbirlea
Differential Revision: https://reviews.llvm.org/D90371
Simon Pilgrim [Fri, 30 Oct 2020 15:18:01 +0000 (15:18 +0000)]
[SLP][X86] Extend target coverage for PR47629
As suggested on D90445, add tests for various SSE/AVX levels and more complex gep pointer offsets
Simon Pilgrim [Fri, 30 Oct 2020 15:05:23 +0000 (15:05 +0000)]
Use cast<> instead of dyn_cast<> as we dereference the pointers immediately. NFCI.
Fix clang static analyzer warnings - we're better off relying on cast<> asserting on failure rather than a null dereference crash.
Simon Moll [Fri, 30 Oct 2020 15:14:42 +0000 (16:14 +0100)]
[VE][NFC] Split up lowering init
Split up the monolithic VETargetLowering ctor into three initialization phases:
1. initRegisterClasses()
2. initSPUActions()
3. // TODO initVPUActions()
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D90463
Matt Arsenault [Sat, 17 Oct 2020 00:33:02 +0000 (20:33 -0400)]
AMDGPU: Fix missing writelane cases to skip with exec=0
Cullen Rhodes [Thu, 29 Oct 2020 11:04:35 +0000 (11:04 +0000)]
[clang][aarch64] Address various fixed-length SVE vector operations
This patch adds tests and support for operations on SVE vectors created
by the 'arm_sve_vector_bits' attribute, described by the Arm C Language
Extensions (ACLE, version 00bet6, section 3.7.3.3) for SVE [1].
This covers the following:
* VLSTs support the same forms of element-wise initialization as GNU
vectors.
* VLSTs support the same built-in C and C++ operators as GNU vectors.
* Conditional and binary expressions containing GNU and SVE vectors
(fixed or sizeless) are invalid since the ambiguity around the result
type affects the ABI.
No functional changes were required to support vector initialization and
operators. The functional changes are to address unsupported conditional and
binary expressions.
[1] https://developer.arm.com/documentation/100987/latest
Reviewed By: fpetrogalli
Differential Revision: https://reviews.llvm.org/D88233
Mehdi Amini [Fri, 30 Oct 2020 15:09:09 +0000 (15:09 +0000)]
Revert "[MLIR][SPIRV] Start module combiner"
This reverts commit
316593ce839f05af936e705182747743e4638f3c.
Build is broken with:
TestModuleCombiner.cpp:(.text._ZN12_GLOBAL__N_122TestModuleCombinerPass14runOnOperationEv+0x195): undefined reference to `mlir::spirv::combine(llvm::MutableArrayRef<mlir::spirv::ModuleOp>, mlir::OpBuilder&, llvm::function_ref<void (mlir::spirv::ModuleOp, llvm::StringRef, llvm::StringRef)>)'
David Green [Fri, 30 Oct 2020 15:06:49 +0000 (15:06 +0000)]
[ARM] Update target triple in tests. NFC
Florian Hahn [Fri, 30 Oct 2020 14:45:08 +0000 (14:45 +0000)]
[VPlan] Use isa<> instead getVPRecipeID in getFirstNonPhi (NFC).
As per the comment in VPRecipeBase, clients should not rely on
getVPRecipeID, as it may change in the future. It should only be used in
classof implementations. Use isa instead in getFirstNonPhi.
Simon Pilgrim [Fri, 30 Oct 2020 14:54:52 +0000 (14:54 +0000)]
[SCEV] SCEVExpander::InsertNoopCastOfTo - reduce scope of pointer type. NFCI.
By reducing the scope of the dyn_cast<PointerType> we can make this a cast<PointerType> and avoid clang static analyzer null deference warnings.
Frederik Gossen [Fri, 30 Oct 2020 14:41:37 +0000 (14:41 +0000)]
[MLIR] Use `llvm::is_one_of` in walk templates
Differential Revision: https://reviews.llvm.org/D90449
serge-sans-paille [Mon, 26 Oct 2020 08:09:25 +0000 (09:09 +0100)]
[lit] Ship and bundle license for lit package
lit is bundled independently from LLVM in at least one location
(https://pypi.org/project/lit/), it's easier to state its license locally.
Differential Revision: https://reviews.llvm.org/D90136
serge-sans-paille [Tue, 27 Oct 2020 09:59:42 +0000 (10:59 +0100)]
[stack-clash] Fix probing of dynamic alloca
- Perform the probing in the correct direction.
Related to https://github.com/rust-lang/rust/pull/77885#issuecomment-
711062924
- The first touch on a dynamic alloca cannot use a mov because it clobbers
existing space. Use a xor 0 instead
Differential Revision: https://reviews.llvm.org/D90216
Simon Pilgrim [Fri, 30 Oct 2020 14:27:50 +0000 (14:27 +0000)]
Use cast<> instead of dyn_cast<> as we dereference the pointer immediately. NFCI.
Fix clang static analyzer warning - we know that the arg should be ConstantInt and we're better off relying on cast<> asserting on failure rather than a null dereference crash.
Simon Pilgrim [Fri, 30 Oct 2020 12:05:39 +0000 (12:05 +0000)]
BitcodeReader::popValue - pass SmallVectorImpl<> as const reference. NFCI.
Fixes cppcheck warning.
Melanie Blower [Fri, 30 Oct 2020 14:29:37 +0000 (07:29 -0700)]
[clang] add fexperimental-strict-floating-point to test cases that fail on arm and aarch not sure this will work due to commit rG13bfd89c4962
Pavel Labath [Fri, 30 Oct 2020 14:18:11 +0000 (15:18 +0100)]
[lldb/DWARF] Fix dwo flavour of TestTypeGetModule
SymbolFileDWARF::GetTypes was not handling dwo correctly. The fix is
simple -- adding a GetNonSkeletonUnit call -- but I've snuck in a small
refactor as well.