Michael Spencer [Fri, 28 Feb 2020 22:39:49 +0000 (14:39 -0800)]
[llvm][Support][modulemap] Exclude WindowsSupport.h from the LLVM_Util module
rG01f9abbb50b1 moved WindowsSupport.h to include/llvm/Support/Windows/
This is a problem because the modulemap include all of the Support and
ADT directories, thus any use of any header in Support or ADT would
cause the compiler to try to build WindowsSupport.h, which only works
on Windows.
Fix this by explicitly excluding WindowsSupport.h from the LLVM_Util
module.
Vedant Kumar [Fri, 28 Feb 2020 22:09:14 +0000 (14:09 -0800)]
[ubsan] Add support for -fsanitize=nullability-* suppressions
rdar://
59402904
Vedant Kumar [Thu, 27 Feb 2020 17:58:24 +0000 (09:58 -0800)]
[entry values] ARM: Add a describeLoadedValue override (PR45025)
As a narrow stopgap for the assertion failure described in PR45025, add
a describeLoadedValue override to ARMBaseInstrInfo and use it to detect
copies in which the forwarding reg is a super/sub reg of the copy
destination. For the moment this is unsupported.
Several follow ups are possible:
1) Handle VORRq. At the moment, we do not, because isCopyInstrImpl
returns early when !MI.isMoveReg().
2) In the case where forwarding reg is a super-reg of the copy
destination, we should be able to describe the forwarding reg as a
subreg within the copy destination. I'm not 100% sure about this, but
it looks like that's what's done in AArch64InstrInfo.
3) In the case where the forwarding reg is a sub-reg of the copy
destination, maybe we could describe the forwarding reg using the
copy destinaion and a DW_OP_LLVM_fragment (I guess this should be
possible after D75036).
https://bugs.llvm.org/show_bug.cgi?id=45025
rdar://
59772698
Differential Revision: https://reviews.llvm.org/D75273
Matt Morehouse [Fri, 28 Feb 2020 22:25:45 +0000 (14:25 -0800)]
[DFSan] Add __dfsan_load_callback.
Summary:
When -dfsan-event-callbacks is specified, insert a call to
__dfsan_load_callback() on every load.
Reviewers: vitalybuka, pcc, kcc
Reviewed By: vitalybuka, kcc
Subscribers: hiraditya, #sanitizers, llvm-commits, eugenis, kcc
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D75363
Reid Kleckner [Thu, 27 Feb 2020 21:11:17 +0000 (13:11 -0800)]
[ADT] Allow K to be incomplete during DenseMap<K*, V> instantiation
DenseMap requires two sentinel values for keys: empty and tombstone
values. To avoid undefined behavior, LLVM aligns the two sentinel
pointers to alignof(T). This requires T to be complete, which is
needlessly restrictive.
Instead, assume that DenseMap pointer keys have a maximum alignment of
4096, and use the same sentinel values for all pointer keys. The new
sentinels are:
empty: static_cast<uintptr_t>(-1) << 12
tombstone: static_cast<uintptr_t>(-2) << 12
These correspond to the addresses of -4096 and -8192. Hopefully, such a
key is never inserted into a DenseMap.
I encountered this while looking at making clang's SourceManager not
require FileManager.h, but it has several maps keyed on classes defined
in FileManager.h. FileManager depends on various LLVM FS headers, which
cumulatively take ~200ms to parse, and are generally not needed.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D75301
Jordan Rupprecht [Fri, 28 Feb 2020 22:11:21 +0000 (14:11 -0800)]
[NFC] Fix minor python issues.
* llvm-gisel-cov.py: extra `)` after print
* chunk-print-before-all.py: py2-only print method
Stephen Neuendorffer [Fri, 28 Feb 2020 22:13:30 +0000 (14:13 -0800)]
Revert "[MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries."
This reverts commit
2f265e35285127de376afc2243e3b5d0c5842cc2.
Stephen Neuendorffer [Fri, 28 Feb 2020 22:04:58 +0000 (14:04 -0800)]
Revert "[MLIR] Remove redundant library dependencies"
This reverts commit
e1cb15c8f92215585105fc00d6eab80860dbc68d.
Jay Foad [Mon, 7 Oct 2019 14:33:59 +0000 (15:33 +0100)]
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
Alexey Lapshin [Thu, 27 Feb 2020 10:21:58 +0000 (13:21 +0300)]
[LLD] Report errors occurred while parsing debug info as warnings.
Summary:
Extracted from D74773. Currently, errors happened while parsing
debug info are reported as errors. DebugInfoDWARF library treats such
errors as "Recoverable errors". This patch makes debug info errors
to be reported as warnings, to support DebugInfoDWARF approach.
Reviewers: ruiu, grimar, MaskRay, jhenderson, espindola
Reviewed By: MaskRay, jhenderson
Subscribers: emaste, aprantl, arichardson, arphaman, llvm-commits
Tags: #llvm, #debug-info, #lld
Differential Revision: https://reviews.llvm.org/D75234
Francis Visoiu Mistrih [Wed, 19 Feb 2020 01:13:47 +0000 (17:13 -0800)]
[LTO][Legacy] Add new API to query Mach-O CPU (sub)type
Tools working with object files on Darwin (e.g. lipo) may need to know
properties like the CPU type and subtype of a bitcode file. The logic of
converting a triple to a Mach-O CPU_(SUB_)TYPE should be provided by
LLVM instead of relying on tools to re-implement it.
Differential Revision: https://reviews.llvm.org/D75067
Tim Shen [Tue, 25 Feb 2020 23:48:23 +0000 (15:48 -0800)]
[MLIR] Add vector support for fpexp and fptrunc.
Differential Revision: https://reviews.llvm.org/D75150
Tim Shen [Sat, 22 Feb 2020 02:13:56 +0000 (18:13 -0800)]
[MLIR] Add llvm.mlir.cast op for semantic preserving cast between dialect types.
Summary: See discussion here: https://llvm.discourse.group/t/rfc-dialect-type-cast-op/538/11
Reviewers: ftynse
Subscribers: bixia, sanjoy.google, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits
Differential Revision: https://reviews.llvm.org/D75141
Tim Shen [Tue, 25 Feb 2020 21:31:56 +0000 (13:31 -0800)]
[MLIR] Add LLVMConversionTarget as a customization point. NFC.
This is in preparation for the next patch D75141. The purpose is to
provide a single place where LLVM dialect registers its ops as
legal/illegal.
Reviewers: ftynse, mravishankar, herhut
Subscribers: jholewinski, bixia, sanjoy.google, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits
Differential Revision: https://reviews.llvm.org/D75140
Krzysztof Parzyszek [Fri, 28 Feb 2020 19:50:16 +0000 (13:50 -0600)]
[Hexagon] Map dcfetch intrinsic to Y2_dcfetchbo, not Y2_dcfetch
Stephen Neuendorffer [Fri, 28 Feb 2020 20:16:51 +0000 (12:16 -0800)]
Revert "[MLIR] Move from add_dependencies() to DEPENDS"
This reverts commit
8a2b86b2c20a50f4a32931ae311b8e2457e591eb.
Stephen Neuendorffer [Fri, 28 Feb 2020 20:16:10 +0000 (12:16 -0800)]
Revert "[MLIR] Add support for libMLIR.so"
This reverts commit
1246e867164b06fc3f0de6bfaaa0922d99cb5ce9.
Stephen Neuendorffer [Fri, 28 Feb 2020 20:15:45 +0000 (12:15 -0800)]
Revert "[MLIR] Fixes for BUILD_SHARED_LIBS=on"
This reverts commit
c767dc9394b4cca26c3eb40f1270092594e539c2.
cchen [Fri, 28 Feb 2020 19:37:14 +0000 (14:37 -0500)]
[OpenMP5.0] Allow pointer arithmetic in motion/map clause, by Chi Chun
Chen
Summary:
Base declaration in pointer arithmetic expression is determined by
binary search with type information. Take "int *a, *b; *(a+*b)" as an
example, we determine the base by checking the type of LHS and RHS. In
this case the type of LHS is "int *", the type of RHS is "int",
therefore, we know that we need to visit LHS in order to find base
declaration.
Reviewers: ABataev, jdoerfert
Reviewed By: ABataev
Subscribers: guansong, cfe-commits, sandoval, dreachem
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75077
Stephen Neuendorffer [Thu, 27 Feb 2020 22:53:12 +0000 (14:53 -0800)]
[MLIR] Fixes for BUILD_SHARED_LIBS=on
Differential Revision: https://reviews.llvm.org/D75308
Valentin Churavy [Sun, 9 Feb 2020 03:27:54 +0000 (19:27 -0800)]
[MLIR] Add support for libMLIR.so
Putting this up mainly for discussion on
how this should be done. I am interested in MLIR from
the Julia side and we currently have a strong preference
to dynamically linking against the LLVM shared library,
and would like to have a MLIR shared library.
This patch adds a new cmake function add_mlir_library()
which accumulates a list of targets to be compiled into
libMLIR.so. Note that not all libraries make sense to
be compiled into libMLIR.so. In particular, we want
to avoid libraries which primarily exist to support
certain tools (such as mlir-opt and mlir-cpu-runner).
Note that the resulting libMLIR.so depends on LLVM, but
does not contain any LLVM components. As a result, it
is necessary to link with libLLVM.so to avoid linkage
errors. So, libMLIR.so requires LLVM_BUILD_LLVM_DYLIB=on
FYI, Currently it appears that LLVM_LINK_LLVM_DYLIB is broken
because mlir-tblgen is linked against libLLVM.so and
and independent LLVM components
(updated by Stephen Neuendorffer)
Differential Revision: https://reviews.llvm.org/D73130
Stephen Neuendorffer [Thu, 20 Feb 2020 18:48:51 +0000 (10:48 -0800)]
[MLIR] Move from add_dependencies() to DEPENDS
add_llvm_library and add_llvm_executable may need to create new targets with
appropriate dependencies. As a result, it is not sufficient in some
configurations (namely LLVM_BUILD_LLVM_DYLIB=on) to only call
add_dependencies(). Instead, the explicit TableGen dependencies must
be passed to add_llvm_library() or add_llvm_executable() using the DEPENDS
keyword.
Differential Revision: https://reviews.llvm.org/D74930
Stephen Neuendorffer [Thu, 20 Feb 2020 06:56:38 +0000 (22:56 -0800)]
[MLIR] Remove redundant library dependencies
In cmake, it is redundant to have a target list under target_link_libraries()
and add_dependency(). This patch removes the redundant dependency from
add_dependency().
Differential Revision: https://reviews.llvm.org/D74929
Stephen Neuendorffer [Tue, 18 Feb 2020 23:07:35 +0000 (15:07 -0800)]
[MLIR] Move from using target_link_libraries to LINK_LIBS for llvm libraries.
When compiling libLLVM.so, add_llvm_library() manipulates the link libraries
being used. This means that when using add_llvm_library(), we need to pass
the list of libraries to be linked (using the LINK_LIBS keyword) instead of
using the standard target_link_libraries call. This is preparation for
properly dealing with creating libMLIR.so as well.
Differential Revision: https://reviews.llvm.org/D74864
Stephen Neuendorffer [Thu, 27 Feb 2020 17:47:37 +0000 (09:47 -0800)]
[MLIR] Refactor library initialization of JitRunner.
Previously, lib/Support/JitRunner.cpp was essentially a complete application,
performing all library initialization, along with dealing with command line
arguments and actually running passes. This differs significantly from
mlir-opt and required a dependency on InitAllDialects.h. This dependency
is significant, since it requires a dependency on all of the resulting
libraries.
This patch refactors the code so that tools are responsible for library
initialization, including registering all dialects, prior to calling
JitRunnerMain. This places the concern about what dialect to support
with the end application, enabling more extensibility at the cost of
a small amount of code duplication between tools. It also fixes
BUILD_SHARED_LIBS=on.
Differential Revision: https://reviews.llvm.org/D75272
Stephen Neuendorffer [Thu, 27 Feb 2020 00:31:14 +0000 (16:31 -0800)]
[MLIR] Refactor library handling for conversions.
Collect a list of conversion libraries in cmake, so we don't have to
list these explicitly in most binaries.
Differential Revision: https://reviews.llvm.org/D75222
Stephen Neuendorffer [Wed, 26 Feb 2020 19:50:03 +0000 (11:50 -0800)]
[MLIR] Refactor handling of dialect libraries
Instead of creating extra libraries we don't really need, collect a
list of all dialects and use that instead.
Differential Revision: https://reviews.llvm.org/D75221
Jacques Pienaar [Fri, 28 Feb 2020 18:59:34 +0000 (10:59 -0800)]
[mlir] Fix typo
Benjamin Kramer [Thu, 27 Feb 2020 12:24:27 +0000 (13:24 +0100)]
Add a pass that specializes parallel loops for easier unrolling and vectorization
This matches loops with a affine.min upper bound, limiting the trip
count to a constant, and rewrites them into two loops, one with constant
upper bound and one with variable upper bound. The assumption is that
the constant upper bound loop will be unrolled and vectorized, which is
preferable if this is the hot path.
Differential Revision: https://reviews.llvm.org/D75240
Yitzhak Mandelbaum [Fri, 28 Feb 2020 17:45:19 +0000 (12:45 -0500)]
[AST Matchers] Fix bug in 'optionally' matcher wherein all previous bindings are cleared when all inner matchers fail.
Summary: The implementation of 'optionally' doesn't preserve bindings when none of the submatchers succeed. This patch adds a regression test for that behavior and fixes it.
Reviewers: aaron.ballman, sbenza
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75365
David Green [Fri, 28 Feb 2020 18:31:45 +0000 (18:31 +0000)]
[DAGCombine] Fix alias analysis for unaligned accesses
The alias analysis in DAG Combine looks at the BaseAlign, the Offset and
the Size of two accesses, and determines if they are known to access
different parts of memory by the fact that they are different offsets
from inside that "alignment window". It does not seem to account for
accesses that are not a multiple of the size, and may overflow from one
alignment window into another.
For example in the test case we have a 19byte memset that is splits into
a 16 byte neon store and an unaligned 4 byte store with a 15 byte
offset. This 15byte offset (with a base align of 8) wraps around to the
next alignment windows. When compared to an access that is a 16byte
offset (of the same 4byte size and 8byte basealign), the two accesses
are said not to alias.
I've fixed this here by just ensuring that the offsets are a multiple of
the size, ensuring that they don't overlap by wrapping. Fixes PR45035,
which was exposed by the UseAA changes in the arm backend.
Differential Revision: https://reviews.llvm.org/D75238
Austin Kerbow [Fri, 28 Feb 2020 18:08:59 +0000 (10:08 -0800)]
[VectorCombine] Fix assert on compare extract index
Extract index could be a differnet integral type.
Differential Revision: https://reviews.llvm.org/D75327
Eric Fiselier [Fri, 28 Feb 2020 18:35:47 +0000 (13:35 -0500)]
[libc++] update GCC cherry-pick to build 4.8.5
Valery N Dmitriev [Thu, 27 Feb 2020 20:50:08 +0000 (12:50 -0800)]
[SLP][NFC] Assert that tree entry operands completed when scheduler looks for dependencies.
This change adds an assertion to prevent tricky bug related to recursive
approach of building vectorization tree. For loop below takes number of
operands directly from tree entry rather than from scalars.
If the entry at this moment turns out incomplete (i.e. not all operands set)
then not all the dependencies will be seen by the scheduler.
This can lead to failed scheduling (and thus failed vectorization)
for perfectly vectorizable tree.
Here is code example which is likely to fire the assertion:
for (i : VL0->getNumOperands()) {
...
TE->setOperand(i, Operands);
buildTree_rec(Operands, Depth + 1,...);
}
Correct way is two steps process: first set all operands to a tree entry
and then recursively process each operand.
Differential Revision: https://reviews.llvm.org/D75296
Alexey Bataev [Fri, 28 Feb 2020 18:18:32 +0000 (13:18 -0500)]
[SLP]Update test checks, NFC.
Craig Topper [Fri, 28 Feb 2020 17:58:42 +0000 (09:58 -0800)]
[X86] Recognize CVTPH2PS from STRICT_FP_EXTEND
This should avoid scalarizing the cvtph2ps intrinsics with D75162
Differential Revision: https://reviews.llvm.org/D75304
Sam Clegg [Fri, 28 Feb 2020 01:32:22 +0000 (17:32 -0800)]
[lld][WebAssembly] Handle mixed strong and weak undefined symbols
When there are both strong and weak references to an undefined
symbol ensure that the strong reference prevails in the output symbol
generating the correct error.
Test case copied from lld/test/ELF/weak-and-strong-undef.s
Differential Revision: https://reviews.llvm.org/D75322
Hiroshi Yamauchi [Fri, 28 Feb 2020 17:43:32 +0000 (09:43 -0800)]
Devirtualize a call on alloca without waiting for post inline cleanup and next DevirtSCCRepeatedPass iteration.
This aims to fix a missed inlining case.
If there's a virtual call in the callee on an alloca (stack allocated object) in
the caller, and the callee is inlined into the caller, the post-inline cleanup
would devirtualize the virtual call, but if the next iteration of
DevirtSCCRepeatedPass doesn't happen (under the new pass manager), which is
based on a heuristic to determine whether to reiterate, we may miss inlining the
devirtualized call.
This enables inlining in clang/test/CodeGenCXX/member-function-pointer-calls.cpp.
This is a second commit after a revert
https://reviews.llvm.org/rG4569b3a86f8a4b1b8ad28fe2321f936f9d7ffd43 and a fix
https://reviews.llvm.org/rG41e06ae7ba91.
Differential Revision: https://reviews.llvm.org/D69591
Hiroshi Yamauchi [Thu, 27 Feb 2020 21:59:59 +0000 (13:59 -0800)]
[CallPromotionUtils] Add missing promotion legality check to tryPromoteCall.
Summary: This fixes the crash that led to the revert of D69591.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75307
Valery N Dmitriev [Thu, 27 Feb 2020 18:57:06 +0000 (10:57 -0800)]
[SLP][NFC] Delete some unreachable code.
This patch deletes some dead code out of SLP vectorizer.
Couple of changes taken out of D57059 to slightly lighten it
plus one more similar case fixed.
Differential Revision: https://reviews.llvm.org/D75276
Christopher Tetreault [Fri, 28 Feb 2020 16:36:27 +0000 (08:36 -0800)]
Revert "[NFC][ARM] Update test"
Summary:
There exists no corresponding code change for this commit, and this
commit causes downstream breakages.
This reverts commit
2db5547c016dbbd6acac3f3175937324f0095226.
Reviewers: samparker
Subscribers: kristof.beyls, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75358
aartbik [Fri, 28 Feb 2020 00:43:49 +0000 (16:43 -0800)]
[mlir] [VectorOps] Add vector.broadcast to EDSC
Reviewers: nicolasvasilache, andydavis1
Reviewed By: nicolasvasilache
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75320
Simon Pilgrim [Fri, 28 Feb 2020 16:54:45 +0000 (16:54 +0000)]
[AVX512] Add strict-fp cvtph2ps constrained tests
As suggested on D75162
Simon Pilgrim [Fri, 28 Feb 2020 16:18:32 +0000 (16:18 +0000)]
[F16C] Add strict-fp constrained tests
As suggested on D75162
Jacques Pienaar [Fri, 28 Feb 2020 16:37:09 +0000 (08:37 -0800)]
[mlir] Add reifyReturnShape to shaped type OpInterface
This call results in inserting operations that compute the return shape
dynamically for the operation.
Teresa Johnson [Thu, 6 Feb 2020 21:28:41 +0000 (13:28 -0800)]
[Inliner] Inlining should honor nobuiltin attributes
Summary:
Final patch in series to fix inlining between functions with different
nobuiltin attributes/options, which was specifically an issue in LTO.
See discussion on D61634 for background.
The prior patch in this series (D67923) enabled per-Function TLI
construction that identified the nobuiltin attributes.
Here I have allowed inlining to proceed if the callee's nobuiltins are a
subset of the caller's nobuiltins, but not in the reverse case, which
should be conservatively correct. This is controlled by a new option,
-inline-caller-superset-nobuiltin, which is enabled by default.
Reviewers: hfinkel, gchatelet, chandlerc, davidxl
Subscribers: arsenm, jvesely, nhaehnle, mehdi_amini, eraman, hiraditya, haicheng, dexonsmith, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74162
Simon Pilgrim [Fri, 28 Feb 2020 15:19:57 +0000 (15:19 +0000)]
Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI.
Simon Pilgrim [Fri, 28 Feb 2020 15:18:08 +0000 (15:18 +0000)]
[TargetLowering] SimplifyDemandedBits - fix SCALAR_TO_VECTOR knownbits bug
We can only report the knownbits for a SCALAR_TO_VECTOR node if we only demand the 0'th element - the upper elements are undefined and shouldn't be trusted.
This is causing a number of regressions that need addressing but we need to get the bugfix in first.
Pierre-vh [Wed, 26 Feb 2020 13:41:33 +0000 (13:41 +0000)]
[Transform][MemCpyOpt] Add missing DebugLoc to %tmpbitcast
Fix for https://bugs.llvm.org/show_bug.cgi?id=37967
Differential Revision: https://reviews.llvm.org/D75173
Krzysztof Parzyszek [Wed, 26 Feb 2020 15:56:12 +0000 (09:56 -0600)]
Reland
7691790dfd1011d08f5468f63952d7690755aad4 with a MSAN fix
In some cases when HexagonTargetLowering::allowsMemoryAccess returned
true, it did not set the "Fast" argument, leaving it uninitialized.
[Hexagon] Improve casting of boolean HVX vectors to scalars
- Mark memory access for bool vectors as disallowed in target lowering.
This will prevent combining bitcasts of bool vectors with stores.
- Replace the actual bitcasting code with a faster version.
- Handle casting of v16i1 to i16.
David Green [Fri, 28 Feb 2020 11:02:20 +0000 (11:02 +0000)]
[ARM] MVE VMLAS
This addes extra patterns for the VMLAS MVE instruction, which performs
Qda = Qda * Qn + Rm, a similar pattern to the existing VMLA. The sinking
of splat(Rm) into the loop is already performed, meaning we just need
extra Pat's in tablegen.
Differential Revision: https://reviews.llvm.org/D75115
David Green [Thu, 27 Feb 2020 18:46:39 +0000 (18:46 +0000)]
[ARM] Additional MVE VMLA tests. NFC
Karasev Nikita [Fri, 28 Feb 2020 14:17:16 +0000 (09:17 -0500)]
Skip TemplateSpecializedType in modernize-pass-by-value.
Existing 'modernize-pass-by-value' check works only with non template values in
initializers. Fixes PR37210.
Simon Pilgrim [Fri, 28 Feb 2020 13:56:48 +0000 (13:56 +0000)]
[cmake][msvc] Don't disable C4345 any more.
This shouldn't be relevant now that we just support VS2017+.
Jay Foad [Fri, 28 Feb 2020 13:39:54 +0000 (13:39 +0000)]
[Utils] Make some scripts directly executable
Jay Foad [Fri, 28 Feb 2020 13:22:44 +0000 (13:22 +0000)]
[AMDGPU] Mark the scheduling model as complete
Jay Foad [Fri, 28 Feb 2020 13:20:55 +0000 (13:20 +0000)]
[AMDGPU] Update a comment missed in
74e2974ac6a
Alexey Lapshin [Fri, 28 Feb 2020 12:06:53 +0000 (15:06 +0300)]
Fix buildbots after
c074f5234d29439116f0e0be6033ea9331e85394.
Removed unused function getSectionByName() from dsymutil/DwarfStreamer.cpp.
Nathan James [Fri, 28 Feb 2020 13:03:30 +0000 (13:03 +0000)]
[clang-tidy] Added virtual isLanguageVersionSupported to ClangTidyCheck
Summary:
Motivated by [[ https://bugs.llvm.org/show_bug.cgi?id=45045 | Tune inspections to a specific C++ standard. ]]
Moves the isLanguageVersionSupported virtual function from `MakeSmartPtrCheck` to the base `ClangTidyCheck` class.
This will disable registering matchers or pp callbacks on unsupported language versions for a check.
Having it as a standalone function is cleaner than manually disabling the check in the register function and should hopefully
encourage check developers to actually restrict the check based on language version.
As an added bonus this could enable automatic detection of what language version a check runs on for the purpose of documentation generation
Reviewers: aaron.ballman, gribozavr2, Eugene.Zelenko, JonasToth, alexfh, hokein
Reviewed By: gribozavr2
Subscribers: xazax.hun, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75289
Jonathan Coe [Fri, 28 Feb 2020 12:44:15 +0000 (12:44 +0000)]
[clang-format] Improve C# handling of spaces in square brackets
Reviewers: MyDeveloperDay, krasimir
Reviewed By: krasimir
Subscribers: cfe-commits
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D75336
Simon Cook [Fri, 28 Feb 2020 11:52:55 +0000 (11:52 +0000)]
[RISCV] Compress instructions based on function features
When running under LTO, it is common to not specify the architecture
spec, which is used for setting up the target machine, and instead rely
on features specified in each function to generate the correct
instructions.
This works for the code generator, but the RISC-V backend uses the
AsmPrinter to do instruction compression, which does not see these
features but instead uses a MCSubtargetInfo object to see whether
compression is enabled. Since this is configured based on the
TargetMachine at startup, it will result in compressed instructions not
being emitted when it has not been given the 'c' TargetFeature, but the
function has it.
This changes the RISCVAsmPrinter to re-initialize the STI feature set
based on the current MachineFunction, such that compressed instructions
are now correctly emitted regardless of the method used to enable them.
Differential revision: https://reviews.llvm.org/D73339
LLVM GN Syncbot [Fri, 28 Feb 2020 11:49:23 +0000 (11:49 +0000)]
[gn build] Port
6af859dcca2
Peter Smith [Fri, 28 Feb 2020 11:44:32 +0000 (11:44 +0000)]
[ELF][LLD][ARM] Add missing REQUIRES: arm to tests
Fix buildbots that don't build ARM backend.
Jeremy Morse [Fri, 28 Feb 2020 10:41:23 +0000 (10:41 +0000)]
[DebugInfo] Re-implement LexicalScopes dominance method, add unit tests
Way back in D24994, the combination of LexicalScopes::dominates and
LiveDebugValues was identified as having worst-case quadratic complexity,
but it wasn't triggered by any code path at the time. I've since run into a
scenario where this occurs, in a very large basic block where large numbers
of inlined DBG_VALUEs are present.
The quadratic-ness comes from LiveDebugValues::join calling "dominates" on
every variable location, and LexicalScopes::dominates potentially touching
every instruction in a block to test for the presence of a scope. We have,
however, already computed the presence of scopes in blocks, in the
"InstrRanges" of each scope. This patch switches the dominates method to
examine whether a block is present in a scope's InsnRanges, avoiding
walking through the whole block.
At the same time, fix getMachineBasicBlocks to account for the fact that
InsnRanges can cover multiple blocks, and add some unit tests, as Lexical
Scopes didn't have any.
Differential revision: https://reviews.llvm.org/D73725
Juneyoung Lee [Fri, 28 Feb 2020 09:47:57 +0000 (18:47 +0900)]
Let EarlyCSE fold equivalent freeze instructions
Summary:
This patch makes EarlyCSE fold equivalent freeze instructions.
Another optimization that I think will be useful is to remove freeze if its operand is used as a branch condition or at llvm.assume:
```
%c = ...
br i1 %c, label %A, ..
A:
%d = freeze %c ; %d can be optimized to %c because %c cannot be poison or undef (or 'br %c' would be UB otherwise)
```
If it make sense for EarlyCSE to support this as well, I will make a patch for this.
Reviewers: spatel, reames, lebedev.ri
Reviewed By: lebedev.ri
Subscribers: lebedev.ri, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75334
Peter Smith [Sun, 23 Feb 2020 19:46:46 +0000 (19:46 +0000)]
[LLD][ELF][ARM] Implement Thumb pc-relative relocations for adr and ldr
MC will now output the R_ARM_THM_PC8, R_ARM_THM_PC12 and
R_ARM_THM_PREL_11_0 relocations. These are short-ranged relocations that
are used to implement the adr rd, literal and ldr rd, literal pseudo
instructions.
The instructions use a new RelExpr called R_ARM_PCA in order to calculate
the required S + A - Pa expression, where Pa is AlignDown(P, 4) as the
instructions add their immediate to AlignDown(PC, 4). We also do not want
these relocations to generate or resolve against a PLT entry as the range
of these relocations is so short they would never reach.
The R_ARM_THM_PC8 has a special encoding convention for the relocation
addend, the immediate field is unsigned, yet the addend must be -4 to
account for the Thumb PC bias. The ABI (not the architecture) uses the
convention that the 8-byte immediate of 0xff represents -4.
Differential Revision: https://reviews.llvm.org/D75042
Peter Smith [Sun, 23 Feb 2020 10:49:51 +0000 (10:49 +0000)]
[MC][ELF][ARM] Add relocations for some pc-relative fixups
Add ELF relocations for the following fixups:
fixup_thumb_adr_pcrel_10 -> R_ARM_THM_PC8
fixup_thumb_cp -> R_ARM_THM_PC8
fixup_t2_adr_pcrel_12 -> R_ARM_THM_PREL_11_0
fixup_t2_ldst_pcrel_12 -> R_ARM_THM_PC12
While these relocations are short-ranged there is support in the open
source ELF linker's in binutils and soon to be in LLD. MC will no longer
resolve pc-relative fixups to global symbols due to interpositioning
concerns. We can handle these at link time by implementing the relocations.
The R_ARM_THM_PC8 has some extra encoding rules for addends that llvm-mc
sidesteps by not supporting addends for these instructions, using the wide
Thumb 2 instruction if it is available. I think that this is a reasonable
compromise given that these are rare.
This partiall reverts D72892, the Thumb fixups no longer need to be
evaluated at assembly time.
Differential Revision: https://reviews.llvm.org/D75039
Sam Parker [Fri, 28 Feb 2020 11:22:09 +0000 (11:22 +0000)]
[NFC][ARM] Add tests
Jay Foad [Thu, 27 Feb 2020 21:16:46 +0000 (21:16 +0000)]
[AMDGPU] Precommit some scheduler related test updates
Summary:
The point of this is to make some tests with manual checks robust
against scheduler tweaks, so that only autogenerated test updates will
be required when pushing D68338 "[AMDGPU] Remove dubious logic in
bidirectional list scheduler".
Reviewers: arsenm, rampitec, vpykhtin
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75302
Sam Parker [Fri, 28 Feb 2020 11:14:42 +0000 (11:14 +0000)]
[RDA] Track implicit-defs
Ensure that we're recording implicit defs, as well as visiting implicit
uses and implicit defs when we're walking through operands.
Differential Revision: https://reviews.llvm.org/D75185
Jonathan Coe [Fri, 28 Feb 2020 10:26:40 +0000 (10:26 +0000)]
[clang-format] Recognize C# nullable types
Summary:
Do not confuse C# nullable types with conditional expressions.
Do not put a space before the `?` in `[access-modifier] Type? variableName;`
Reviewers: krasimir, MyDeveloperDay
Reviewed By: krasimir, MyDeveloperDay
Subscribers: cfe-commits, MyDeveloperDay
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D75261
Stefan Agner [Fri, 28 Feb 2020 11:03:14 +0000 (11:03 +0000)]
[ARM][Thumb2] support .w assembler qualifier for dmb/dsb/isb
Support the explicit wide assembler qualifier for the dmb/dsb/isb synchronization barrier instructions.
Differential revision: https://reviews.llvm.org/D75143
Stefan Agner [Fri, 28 Feb 2020 10:55:53 +0000 (10:55 +0000)]
[ARM][Thumb2] Support .w assembler qualifier for pld/pldw/pli
Accept explicit wide assembler qualifier for the pld/pldw/pli.
Differential revision: https://reviews.llvm.org/D75144
Djordje Todorovic [Fri, 28 Feb 2020 11:00:34 +0000 (12:00 +0100)]
[NFC] [Test commit] Testing commit access with new email
Kirill Bobyrev [Fri, 28 Feb 2020 10:30:19 +0000 (11:30 +0100)]
[mlir] Fix the build by using correct symbol name
s/ArrayRef/llvm::ArrayRef/g since it's outside llvm namespace.
Related revision:
9227a74b7e8ff9b9cb5924e03547b940dc06e331
Alexey Lapshin [Sat, 22 Feb 2020 11:33:58 +0000 (14:33 +0300)]
[DWARFLinker][NFC] Remove usages of "const object::ObjectFile" from DWARFLinker.
Summary:
DWARFContext has all the required information to access source debug info.
It is not necessary to use "const object::ObjectFile" to create DWARFContext.
Thus this patch removes all usages of "const object::ObjectFile"
from DWARFLinker. Instead, already created DWARFContext is passed
to DWARFLinker. The purpose is to not depend on "const object::ObjectFile".
The patch looks big, but most of changes are renamings and movements.
Testing: it passes "check-all" lit testing. MD5 checksum for clang .dSYM bundle
matches for the dsymutil with/without that patch.
Reviewers: JDevlieghere, friss, dblaikie, aprantl
Reviewed By: JDevlieghere
Subscribers: hiraditya, llvm-commits
Tags: #llvm, #debug-info
Differential Revision: https://reviews.llvm.org/D75029
Pierre-vh [Wed, 26 Feb 2020 14:46:51 +0000 (14:46 +0000)]
[debuginfo-tests][dexter] Add a test tool --calculate-average option
Differential Revision: https://reviews.llvm.org/D75235
Pavel Labath [Fri, 28 Feb 2020 09:46:48 +0000 (10:46 +0100)]
[lldb] Use llvm MC as the source of dwarf/eh register numbers for X86 ABIs
x86_64 ABIs were converted with
07355c1c0. This does the same with i386.
Hans Wennborg [Thu, 27 Feb 2020 16:01:09 +0000 (17:01 +0100)]
SROA: Don't drop atomic load/store alignments (PR45010)
SROA will drop the explicit alignment on allocas when the ABI guarantees
enough alignment. Because the alignment on new load/store instructions
are set based on the alloca's alignment, that means SROA would end up
dropping the alignment from atomic loads and stores, which is not
allowed (see bug). For those, make sure to always carry over the
alignment from the previous instruction.
Differential revision: https://reviews.llvm.org/D75266
serge-sans-paille [Fri, 21 Feb 2020 14:51:19 +0000 (15:51 +0100)]
No longer generate calls to *_finite
According to Joseph Myers, a libm maintainer
> They were only ever an ABI (selected by use of -ffinite-math-only or
> options implying it, which resulted in the headers using "asm" to redirect
> calls to some libm functions), not an API. The change means that ABI has
> turned into compat symbols (only available for existing binaries, not for
> anything newly linked, not included in static libm at all, not included in
> shared libm for future glibc ports such as RV32), so, yes, in any case
> where tools generate direct calls to those functions (rather than just
> following the "asm" annotations on function declarations in the headers),
> they need to stop doing so.
As a consequence, we should no longer assume these symbols are available on the
target system.
Still keep the TargetLibraryInfo for constant folding.
Differential Revision: https://reviews.llvm.org/D74712
Hans Wennborg [Fri, 28 Feb 2020 08:59:24 +0000 (09:59 +0100)]
llvm-ar: Fix MinGW compilation
llvm-ar is using CompareStringOrdinal which is available
only starting with Windows Vista (WINVER 0x600).
Fix this by hoising WindowsSupport.h, which sets _WIN32_WINNT
to 0x0601, up to llvm/include/llvm/Support and use it in llvm-ar.
Patch by Cristian Adam!
Differential revision: https://reviews.llvm.org/D74599
Balázs Kéri [Fri, 28 Feb 2020 07:32:32 +0000 (08:32 +0100)]
[ASTImporter] Improved import of AlignedAttr.
Summary:
It is not enough to clone the attributes at import.
They can contain reference to objects that should be imported.
This work is done now for AlignedAttr.
Reviewers: martong, a.sidorin, shafik
Reviewed By: shafik
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, teemperor, martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75048
Kadir Cetinkaya [Thu, 27 Feb 2020 09:35:14 +0000 (10:35 +0100)]
[clangd] Get rid of lexer usage in ObjCLocalizeStringLiteral tweak
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75230
Kadir Cetinkaya [Thu, 27 Feb 2020 14:10:54 +0000 (15:10 +0100)]
[clangd] Use tokenize instead of raw lexer in SourceCode/lex
Reviewers: hokein, sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75249
Igor Kudrin [Wed, 26 Feb 2020 15:02:33 +0000 (22:02 +0700)]
[DebugInfo] Fix parsing DWARF64 units in DWP.
The integrity check code allowed only DWARF32 units.
Differential Revision: https://reviews.llvm.org/D75178
Igor Kudrin [Wed, 26 Feb 2020 14:23:43 +0000 (21:23 +0700)]
[DebugInfo] Avoid crashing when parsing an invalid unit header in DWP.
The integrity checks for index entries in DWARFUnitHeader::extract()
might cause the function to return before checking the state of an
Error object, which leads to a crash in runtime. The patch fixes the
issue by moving the checks in a safe place.
Differential Revision: https://reviews.llvm.org/D75177
Pavel Labath [Thu, 27 Feb 2020 15:22:12 +0000 (16:22 +0100)]
[DataExtractor] Improve error message when we run off the end of the buffer
Summary: Include the offset at which this happened.
Reviewers: dblaikie, jhenderson
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75265
Saleem Abdulrasool [Fri, 28 Feb 2020 03:23:57 +0000 (19:23 -0800)]
build: process the libxml2 library path for embedding
Process the path for libxml2 before embedding that into the command line
that is generated in `llvm-config`. Each element in the path is being
given a `-l` unconditionally which should not be the case for absolute
paths. Since the library path may be absolute or not, just apply some
CMake pre-processing when generating the path.
Before:
```
/usr/lib/x86_64-linux-gnu/libz.so -lrt -ldl -ltinfo -lpthread -lm /usr/lib/x86_64-linux-gnu/libxml2.so
```
After:
```
/usr/lib/x86_64-linux-gnu/libz.so -lrt -ldl -ltinfo -lpthread -lm -lxml2
```
Resolves PR44179!
Craig Topper [Sun, 23 Feb 2020 08:21:34 +0000 (00:21 -0800)]
[X86] Add FMA commuting test case for D75016
This test case shows extra moves due to not fully considering all
commuting opportunities.
Jun Ma [Fri, 28 Feb 2020 02:12:11 +0000 (10:12 +0800)]
[Coroutines] CoroElide enhancement
Fix regression of CoreElide pass when current function is
coroutine.
Differential Revision: https://reviews.llvm.org/D71663
Juneyoung Lee [Fri, 28 Feb 2020 02:08:14 +0000 (11:08 +0900)]
Revert "[SimpleLoopUnswitch] Fix introduction of UB when hoisted condition may be undef or poison"
.. due to performance regression.
This patch is reverted until infrastructore for CSE/LICM support for freeze is
added.
This reverts commit 181628b
Matthias Kramm [Fri, 28 Feb 2020 01:54:22 +0000 (17:54 -0800)]
[mlir][Tutorial] Fix comment position in SimplifyRedundantTranspose.
Summary:
This is a cosmetic change to make the "bingo" comment be in the
right place.
Differential Revision: https://reviews.llvm.org/D75264
Matthias Kramm [Fri, 28 Feb 2020 01:53:03 +0000 (17:53 -0800)]
[mlir] Fix/Clarify parts of MLIR toy tutorial chapter 6+7
Summary:
* add missing comma.
* remove "having to register them here" phrasing, since register it
is what we're doing, which made the comment a bit confusing.
* remove duplicate code.
* clarify link to chapter 3, since "folder" doesn't appear in that
chapter.
Differential Revision: https://reviews.llvm.org/D75263
Matthias Kramm [Fri, 28 Feb 2020 01:52:24 +0000 (17:52 -0800)]
Fix/Clarify parts of MLIR toy tutorial chapter 5
Summary:
* Use bold font (not monospace) for legal/illegal.
* Say a few words about operation<->dialect precedence.
* Omit duplicate code samples.
* Indent items in bullet-point list.
Differential Revision: https://reviews.llvm.org/D75262
Matthias Kramm [Fri, 28 Feb 2020 01:51:34 +0000 (17:51 -0800)]
[mlir] Fix/clarify parts of MLIR toy tutorial chaper 4.
Summary:
* Let's use "override" when we're just doing standard baseclassing.
("Specialization" makes it sound like template specialization, which
this is not.)
* CallInterfaces.td has an include guard, so #ifdef not needed anymore.
* Omit duplicate code in code samples.
* Clarify which algorithm we're talking about.
* Mention that the ShapeInference code is code a snippet that belongs to
algorithm discussed in the paragraph above it.
* Add missing definition for createShapeInferencePass.
Differential Revision: https://reviews.llvm.org/D75260
Matthias Kramm [Fri, 28 Feb 2020 01:50:41 +0000 (17:50 -0800)]
[mlir] Fix comma+typo in MLIR toy tutorial chapter 3.
Differential Revision: https://reviews.llvm.org/D75258
Matthias Kramm [Fri, 28 Feb 2020 01:49:31 +0000 (17:49 -0800)]
[mlir] Clarify/Fix parts of MLIR toy tutorial chapter 2
Summary:
* clarify what "registering" means.
* clarify Op dereferencing
* clarify override/virtual phrasing
* omit duplication in code samples
* fix OpAsmPrinter comment
Differential Revision: https://reviews.llvm.org/D75256
Eli Friedman [Sat, 22 Feb 2020 00:00:04 +0000 (16:00 -0800)]
[IndVars] Fix sort comparator.
std::sort will compare an element to itself in some cases. We should
not crash if this happens.
Differential Revision: https://reviews.llvm.org/D75000
Reid Kleckner [Fri, 28 Feb 2020 01:24:50 +0000 (17:24 -0800)]
Add missing cstdint include not found on Windows
Reid Kleckner [Fri, 28 Feb 2020 01:06:48 +0000 (17:06 -0800)]
[Support] Remove byte swapping from MathExtras.h
MathExtras.h was just wrapping SwapByteOrder.h functionality, so have
the callers use it directly. Use the MathExtras.h name (ByteSwap_NN) as
the standard naming, since it appears to be the most popular.