Yichao Yu [Tue, 24 Nov 2020 00:59:35 +0000 (19:59 -0500)]
Enable support for floating-point division reductions
Similar to fsub, fdiv can also be vectorized using fmul.
Also http://llvm.org/viewvc/llvm-project?view=revision&revision=215200
Differential Revision: https://reviews.llvm.org/D34078
Co-authored-by: Jameson Nash <jameson@juliacomputing.com>
Ben Dunbobbin [Mon, 23 Nov 2020 09:27:38 +0000 (09:27 +0000)]
[Clang][-fvisibility-from-dllstorageclass] Set DSO Locality from final visibility
Ensure that the DSO Locality of the globals in the IR is derived from
their final visibility when using -fvisibility-from-dllstorageclass.
To accomplish this we reset the DSO locality of globals (before
setting their visibility from their dllstorageclass) at the end of
IRGen in Clang. This removes any effects that visibility options or
annotations may have had on the DSO locality.
The resulting DSO locality of the globals will be pessimistic
w.r.t. to the normal compiler IRGen.
Differential Revision: https://reviews.llvm.org/D91779
Amy Huang [Tue, 24 Nov 2020 00:29:04 +0000 (16:29 -0800)]
Revert "[llvm-symbolizer] Switch to using native symbolizer by default on Windows"
Breaks some asan tests on the buildbot.
This reverts commit
c74b427cb2a90309ee0c29df21ad1ca26390263c.
Evgenii Stepanov [Tue, 24 Nov 2020 00:01:13 +0000 (16:01 -0800)]
[hwasan] Fix tests when vm.overcommit_memory=1.
Remove an invalid check from sizes.cpp that only passes when overcommit is disabled.
Fixes PR48274.
Differential Revision: https://reviews.llvm.org/D91999
Amy Huang [Thu, 19 Nov 2020 19:49:22 +0000 (11:49 -0800)]
[llvm-symbolizer] Switch to using native symbolizer by default on Windows
llvm-symbolizer used to use the DIA SDK for symbolization on
Windows; this patch switches to using native symbolization, which was
implemented recently.
Users can still make the symbolizer use DIA by adding the `-dia` flag
in the LLVM_SYMBOLIZER_OPTS environment variable.
Differential Revision: https://reviews.llvm.org/D91814
Philip Reames [Mon, 23 Nov 2020 23:36:08 +0000 (15:36 -0800)]
[test] pre-comit test for D91451
Philip Reames [Mon, 23 Nov 2020 23:23:46 +0000 (15:23 -0800)]
[LoopVectorizer] Lower uniform loads as a single load (instead of relying on CSE)
A uniform load is one which loads from a uniform address across all lanes. As currently implemented, we cost model such loads as if we did a single scalar load + a broadcast, but the actual lowering replicates the load once per lane.
This change tweaks the lowering to use the REPLICATE strategy by marking such loads (and the computation leading to their memory operand) as uniform after vectorization. This is a useful change in itself, but it's real purpose is to pave the way for a following change which will generalize our uniformity logic.
In review discussion, there was an issue raised with coupling cost modeling with the lowering strategy for uniform inputs. The discussion on that item remains unsettled and is pending larger architectural discussion. We decided to move forward with this patch as is, and revise as warranted once the bigger picture design questions are settled.
Differential Revision: https://reviews.llvm.org/D91398
Alex Zinenko [Mon, 23 Nov 2020 19:45:30 +0000 (20:45 +0100)]
[mlir] Support WsLoopOp in OpenMP to LLVM dialect conversion
It is a simple conversion that only requires to change the region argument
types, generalize it from ParallelOp.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D91989
zoecarver [Mon, 23 Nov 2020 22:21:50 +0000 (14:21 -0800)]
[libcxx] Resolve LWG 2724 protected -> private.
Fixes LWG issue 2724: "The protected virtual member functions of memory_resource should be private."
Differential Revision: https://reviews.llvm.org/D66615
Craig Topper [Mon, 23 Nov 2020 22:17:06 +0000 (14:17 -0800)]
[RISCV] Remove unused VM register class
Nothing references this class today so it looks like some leftover.
Differential Revision: https://reviews.llvm.org/D91977
George [Mon, 23 Nov 2020 21:08:00 +0000 (13:08 -0800)]
Use MlirStringRef throughout the C API
While this makes the unit tests a bit more verbose, this simplifies the creation of bindings because only the bidirectional mapping between the host language's string type and MlirStringRef need to be implemented.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D91905
Sanjay Patel [Mon, 23 Nov 2020 21:46:41 +0000 (16:46 -0500)]
[InstCombine] propagate 'nsw' on pointer difference of 'inbounds' geps
This is a retry of
324a53205. I cautiously reverted that at 6aa3fc4
because the rules about gep math were not clear. Since then, we
have added this line to LangRef for gep inbounds:
"The successive addition of offsets (without adding the base address)
does not wrap the pointer index type in a signed sense (nsw)."
See D90708 and post-commit comments on the revert patch for more details.
LLVM GN Syncbot [Mon, 23 Nov 2020 21:33:46 +0000 (21:33 +0000)]
[gn build] Port
f6b02ecd027
Saleem Abdulrasool [Thu, 5 Nov 2020 23:59:39 +0000 (23:59 +0000)]
APINotes: add property models for YAML attributes
This adds internal representation of the attributes in a more usable
form. This is meant to allow programmatic access to the attributes that
are specified in the YAML data.
This is based upon the work contributed by Apple at
https://github.com/llvm/llvm-project-staging/tree/staging/swift/apinotes.
Differential Revision: https://reviews.llvm.org/D91104
Reviewed By: Gabor Marton
Arthur Eubanks [Mon, 23 Nov 2020 21:20:21 +0000 (13:20 -0800)]
Revert "[CGSCC] Detect devirtualization in more cases"
This reverts commit
14a68b4aa9732293ad7e16f105b0feb53dc8dbe2.
Causes building self hosted clang to crash when using NPM.
Martin Storsjö [Fri, 13 Nov 2020 20:35:22 +0000 (22:35 +0200)]
Reapply "[CodeGen] [WinException] Only produce handler data at the end of the function if needed"
This reapplies
36c64af9d7f97414d48681b74352c9684077259b in updated
form.
Emit the xdata for each function at .seh_endproc. This keeps the
exact same output header order for most code generated by the LLVM
CodeGen layer. (Sections still change order for code built from
assembly where functions lack an explicit .seh_handlerdata
directive, and functions with chained unwind info.)
The practical effect should be that assembly output lacks
superfluous ".seh_handlerdata; .text" pairs at the end of functions
that don't handle exceptions, which allows such functions to use
the AArch64 packed unwind format again.
Differential Revision: https://reviews.llvm.org/D87448
Arthur Eubanks [Wed, 18 Nov 2020 20:54:54 +0000 (12:54 -0800)]
[NPM] Share pass building options with legacy PM
We should share options when possible.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D91741
Jordan Rupprecht [Mon, 23 Nov 2020 20:45:46 +0000 (12:45 -0800)]
[lldb/test] Remove flaky `process connect` test.
This test is flaky because it assumes port 4321 is not already open on a machine.
smhc [Mon, 23 Nov 2020 20:45:50 +0000 (20:45 +0000)]
[clang-tidy] Use compiled regex for AllowedRegexp in macro usage check
Current check compiles the regex on every attempt at matching. The check also populates and enables a regex value by default so the default behaviour results in regex re-compilation for every macro - if the check is enabled. If people used this check there's a reasonable chance they would have relatively complex regexes in use.
This is a quick and simple fix to store and use the compiled regex.
Reviewed By: njames93
Differential Revision: https://reviews.llvm.org/D91908
Nicolas Vasilache [Mon, 23 Nov 2020 20:36:50 +0000 (20:36 +0000)]
[mlir] Add mising dependency
Reid Kleckner [Mon, 23 Nov 2020 20:19:20 +0000 (12:19 -0800)]
Make check-clang depend on the LLVM split-file utility
Fixes a recently added test that has this dependency. IMO this utility
is generally useful, so we should go ahead and take the new dependency.
Haowei Wu [Tue, 29 Sep 2020 05:10:54 +0000 (22:10 -0700)]
[llvm-elfabi] Emit ELF header and string table sections
This change serves to create the initial framework for outputting ELF
files from llvm-elfabi.
Differential Revision: https://reviews.llvm.org/D61767
Nathan James [Mon, 23 Nov 2020 20:04:50 +0000 (20:04 +0000)]
[clang-tidy] Fix RenamerClangTidy checks trying to emit a fix that isnt a valid identifier
Addresses https://bugs.llvm.org/show_bug.cgi?id=48230.
Handle the case when the Fixup suggested isn't a valid c/c++ identifer.
Reviewed By: aaron.ballman, gribozavr2
Differential Revision: https://reviews.llvm.org/D91915
Eric Astor [Mon, 23 Nov 2020 19:20:17 +0000 (14:20 -0500)]
[ms] [llvm-ml] Support purging macro definitions
Support MASM's PURGE directive.
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D89735
Haowei Wu [Mon, 23 Nov 2020 19:58:51 +0000 (11:58 -0800)]
Revert "[llvm-elfabi] Emit ELF header and string table sections"
This reverts commit
53c5fdd59a5cf7fbb4dcb7a7e84c9c4a40d32a84.
Reason of revert: Some builders failed to build with ld.
Arthur Eubanks [Wed, 18 Nov 2020 07:42:18 +0000 (23:42 -0800)]
Port -print-memderefs to NPM
There is lots of code duplication, but hopefully it won't matter soon.
Reviewed By: ychen
Differential Revision: https://reviews.llvm.org/D91683
Arthur Eubanks [Wed, 18 Nov 2020 07:18:26 +0000 (23:18 -0800)]
[test] Pin memory-dereferenceable.ll to legacy PM
-print-memderefs is only used for one test and hasn't been touched in a while.
Arthur Eubanks [Thu, 15 Oct 2020 00:56:38 +0000 (17:56 -0700)]
[CGSCC] Detect devirtualization in more cases
The devirtualization wrapper misses cases where if it wraps a pass
manager, an individual pass may devirtualize an indirect call created by
a previous pass. For example, inlining may create a new indirect call
which is devirtualized by instcombine. Currently the devirtualization
wrapper will not see that because it only checks cgscc edges at the very
beginning and end of the pass (manager) it wraps.
This fixes some tests testing this exact behavior in the legacy PM.
Instead of checking WeakTrackingVHs for CallBases at the very beginning
and end of the pass it wraps, check every time
updateCGAndAnalysisManagerForPass() is called.
check-llvm and check-clang with -abort-on-max-devirt-iterations-reached
on by default doesn't show any failures outside of tests specifically
testing it so it doesn't needlessly rerun passes more than necessary.
(The NPM -O2/3 pipeline run the inliner/function simplification pipeline
under a devirtualization repeater pass up to 4 times by default).
http://llvm-compile-time-tracker.com/?config=O3&stat=instructions&remote=aeubanks
shows that 7zip has ~1% compile time regression. I looked at it and saw
that there indeed was devirtualization happening that was not previously
caught, so now it reruns the CGSCC pipeline on some SCCs, which is WAI.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D89587
Xiangling Liao [Mon, 23 Nov 2020 18:55:47 +0000 (13:55 -0500)]
[AIX] Support init priority
Support reserved [0-100] and non-reserved[101-65535] Clang/GNU init
priority values on AIX.
This patch maps Clang/GNU values into priority values used in sinit/sterm
functions. User can play with values and be able to get init to occur
before or after XL init and vice versa.
Differential Revision: https://reviews.llvm.org/D91272
Arthur Eubanks [Wed, 18 Nov 2020 08:04:27 +0000 (00:04 -0800)]
[test] Pin tests using -dot-callgraph to legacy PM
-dot-callgraph is not ported to the NPM yet. It can be ported at a later
time if necessary.
Differential Revision: https://reviews.llvm.org/D91685
Haowei Wu [Tue, 29 Sep 2020 05:10:54 +0000 (22:10 -0700)]
[llvm-elfabi] Emit ELF header and string table sections
This change serves to create the initial framework for outputting ELF
files from llvm-elfabi.
Differential Revision: https://reviews.llvm.org/D61767
Eric Astor [Fri, 13 Nov 2020 22:39:33 +0000 (17:39 -0500)]
[ms] [llvm-ml] Support macro function invocations in expressions
Accept macro function definitions, and apply them when invoked in operand position.
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D89734
Craig Topper [Mon, 23 Nov 2020 19:08:10 +0000 (11:08 -0800)]
[AArch64] Update clang CodeGen tests I missed in
4252f7773a5b98b825d17e5f77c7d349cb2fb7c7.
These tests invoke opt and llc even though they are in the frontend.
We now do a better job of generating commuted patterns for fma so
these tests now form fmls instead of fmla+fneg.
Amy Huang [Mon, 23 Nov 2020 18:51:09 +0000 (10:51 -0800)]
[NFC] remove print statement I accidentally added.
Florian Hahn [Mon, 23 Nov 2020 18:32:56 +0000 (18:32 +0000)]
[AArch64] Add scatter cost model tests.
MaheshRavishankar [Mon, 23 Nov 2020 18:34:48 +0000 (10:34 -0800)]
[mlir][Linalg] NFC: Expose some utility functions used for promotion.
Exposing some utility functions from Linalg to allow for promotion of
fused views outside of the core tile+fuse logic.
This is an alternative to patch D91322 which adds the promotion logic
to the tileAndFuse method. Downside with that approach is that it is
not easily customizable based on needs.
Differential Revision: https://reviews.llvm.org/D91503
Nico Weber [Mon, 23 Nov 2020 18:29:36 +0000 (13:29 -0500)]
[mac/arm] fix clang/test/Driver/darwin-ld-dedup.c
The test needs an object file, which it currenty gets with
`-target x86_64-apple-darwin10`. Rather than adding `REQUIRES: X86`, create
the object file via yaml2obj. This way, the test runs and passes even if the
host arch isn't x86 and only the host arch is built.
Part of PR46644.
MaheshRavishankar [Mon, 23 Nov 2020 18:07:34 +0000 (10:07 -0800)]
[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)
Enhance the tile+fuse logic to allow fusing a sequence of operations.
Make sure the value used to obtain tile shape is a
SubViewOp/SubTensorOp. Current logic used to get the bounds of loop
depends on the use of `getOrCreateRange` method on `SubViewOp` and
`SubTensorOp`. Make sure that the value/dim used to compute the range
is from such ops. This fix is a reasonable WAR, but a btter fix would
be to make `getOrCreateRange` method be a method of `ViewInterface`.
Differential Revision: https://reviews.llvm.org/D90991
Craig Topper [Mon, 23 Nov 2020 18:01:52 +0000 (10:01 -0800)]
[SelectionDAG][ARM][AArch64][Hexagon][RISCV][X86] Add SDNPCommutative to fma and fmad nodes in tablegen. Remove explicit commuted patterns from targets.
X86 was already specially marking fma as commutable which allowed
tablegen to autogenerate commuted patterns. This moves it to the target
independent definition and fix up the targets to remove now
unneeded patterns.
Unfortunately, the tests change because the commuted version of
the patterns are generating operands in a different than the
explicit patterns.
Differential Revision: https://reviews.llvm.org/D91842
Nico Weber [Mon, 23 Nov 2020 17:55:51 +0000 (12:55 -0500)]
[mac/arm] make clang/test/Driver/clang_f_opts.c pass consistently
Part of PR46644, see comment 7/8.
George [Mon, 23 Nov 2020 17:52:17 +0000 (09:52 -0800)]
Add userData to the diagnostic handler C API
Previously, there was no way to add context to the diagnostic engine via the C API. Adding this ability makes it much easier to reason about memory ownership, particularly in reference-counted languages such as Swift. There are more details in the review comments.
Reviewed By: ftynse, mehdi_amini
Differential Revision: https://reviews.llvm.org/D91738
Florian Hahn [Mon, 23 Nov 2020 17:33:27 +0000 (17:33 +0000)]
[AArch64] Add tests for masked.gather costs.
Paul C. Anagnostopoulos [Sun, 22 Nov 2020 14:56:42 +0000 (09:56 -0500)]
[TableGen] Eliminte source location from CodeInit
Step 1 in eliminating the 'code' type.
Differential Revision: https://reviews.llvm.org/D91932
Simon Moll [Mon, 23 Nov 2020 14:33:10 +0000 (15:33 +0100)]
[VE] VE Vector Predicated SDNode, vector add isel and tests
VE Vector Predicated (VVP) SDNodes form an intermediate layer between VE
vector instructions and the initial SDNodes.
We introduce 'vvp_add' with isel and tests as the first of these VVP
nodes. VVP nodes have a mask and explicit vector length operand, which
we will make proper use of later.
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D91802
Alex Zinenko [Mon, 23 Nov 2020 15:50:55 +0000 (16:50 +0100)]
[mlir] Temporarily disable flaky mlir-cpu-runner async tests
These tests fail sporadically on irrelevant commits, e.g.
http://lab.llvm.org:8011/#/builders/61/builds/1777 as well as in local
builds.
Stephen Kelly [Mon, 23 Nov 2020 15:22:03 +0000 (15:22 +0000)]
Fix tests for clang-query completion
Alexander Belyaev [Mon, 23 Nov 2020 14:55:42 +0000 (15:55 +0100)]
[mlir] Add a print function for memref<*xi64>.
Differential Revision: https://reviews.llvm.org/D91070
Kazushi (Jam) Marukawa [Sun, 22 Nov 2020 12:57:22 +0000 (21:57 +0900)]
[VE] Remove magic numbers 176
Remove magic numbers 176 from VE source codes and update comments.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D91958
Jay Foad [Fri, 20 Nov 2020 15:42:52 +0000 (15:42 +0000)]
Fix speling in comments. NFC.
Stephen Kelly [Sat, 21 Nov 2020 18:54:26 +0000 (18:54 +0000)]
Remove the IgnoreImplicitCastsAndParentheses traversal kind
Differential Revision: https://reviews.llvm.org/D91918
Stephen Kelly [Sat, 21 Nov 2020 18:47:51 +0000 (18:47 +0000)]
Update mode used in traverse() examples
traverse() predates the IgnoreUnlessSpelledInSource mode. Update example
and test code to use the newer mode.
Differential Revision: https://reviews.llvm.org/D91917
Stephen Kelly [Sat, 23 May 2020 01:12:51 +0000 (02:12 +0100)]
Remove automatic traversal from forEach matcher
Differential Revision: https://reviews.llvm.org/D91916
Mikael Holmen [Mon, 23 Nov 2020 14:12:15 +0000 (15:12 +0100)]
[test] Update PR reference in testcase [NFC]
The testcase was added in
faf848ac32 to test the fix of PR 47969, but
it was named pr48980 (which happens to be the TR number in my downstream
issue system).
Alex Zinenko [Fri, 20 Nov 2020 18:22:30 +0000 (19:22 +0100)]
[mlir] canonicalize away zero-iteration SCF for loops
An SCF 'for' loop does not iterate if its lower bound is equal to its upper
bound. Remove loops where both bounds are the same SSA value as such bounds are
guaranteed to be equal. Similarly, remove 'parallel' loops where at least one
pair of respective lower/upper bounds is specified by the same SSA value.
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D91880
Mikael Holmen [Mon, 23 Nov 2020 12:15:10 +0000 (13:15 +0100)]
[Inline] Fix in handling of ptrtoint in InlineCost
ConstantOffsetPtrs contains mappings from a Value to a base pointer and
an offset. The offset is typed and has a size, and at least when dealing
with ptrtoint, it could happen that we had a mapping from a ptrtoint
with type i32 to an offset with type i16. This could later cause
problems, showing up in PR 47969 and PR 38500.
In PR 47969 we ended up in an assert complaining that trunc i16 to i16
is invalid and in Pr 38500 that a cmp on an i32 and i16 value isn't
valid.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D90610
Michał Górny [Mon, 23 Nov 2020 13:27:02 +0000 (14:27 +0100)]
[lldb] [test] Restore Windows-skip on 'process connect' tests
Georgii Rymar [Mon, 23 Nov 2020 11:11:09 +0000 (14:11 +0300)]
[llvm-readobj][test] - Simplify the gnu-notes.test
This test contains YAMLs that can be merged with use of macros.
This opens road for adding more test cases.
Differential revision: https://reviews.llvm.org/D91953
Dmitry Preobrazhensky [Mon, 23 Nov 2020 13:07:26 +0000 (16:07 +0300)]
[AMDGPU][MC] Improved diagnostic messages
See bug 47518 (https://bugs.llvm.org/show_bug.cgi?id=47518)
Reviewers: rampitec
Differential Revision: https://reviews.llvm.org/D91794
Jann Horn [Mon, 23 Nov 2020 13:10:35 +0000 (08:10 -0500)]
Ignore noderef attribute in unevaluated context
The noderef attribute is for catching code that accesses pointers in
a different address space. Unevaluated code is always safe in that regard.
Alex Zinenko [Mon, 23 Nov 2020 12:22:51 +0000 (13:22 +0100)]
[mlir] Avoid cloning ops in SCF parallel conversion to CFG
The existing implementation of the conversion from SCF Parallel operation to
SCF "for" loops in order to further convert those loops to branch-based CFG has
been cloning the loop and reduction body operations into the new loop because
ConversionPatternRewriter was missing support for moving blocks while replacing
their arguments. This functionality now available, use it to implement the
conversion and avoid cloning operations, which may lead to doubling of the IR
size during the conversion.
In addition, this fixes an issue with converting nested SCF "if" conditionals
present in "parallel" operations that would cause the conversion infrastructure
to stop because of the repeated application of the pattern converting "newly"
created "if"s (which were in fact just moved). Arguably, this should be fixed
at the infrastructure level and this fix is a workaround.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D91955
Utkarsh Saxena [Wed, 18 Nov 2020 12:25:09 +0000 (13:25 +0100)]
[clangd] textDocument/implementation (LSP layer)
Differential Revision: https://reviews.llvm.org/D91721
Dmitry Preobrazhensky [Mon, 23 Nov 2020 12:44:47 +0000 (15:44 +0300)]
[AMDGPU][MC] Improved diagnostic messages for invalid literals
See bug 47518 (https://bugs.llvm.org/show_bug.cgi?id=47518)
Reviewers: rampitec
Differential Revision: https://reviews.llvm.org/D91793
Nicolas Vasilache [Mon, 23 Nov 2020 12:16:00 +0000 (12:16 +0000)]
[mlir][Linalg] Drop symbol_source abstraction which does not pay for itself.
Differential Revision: https://reviews.llvm.org/D91956
Kadir Cetinkaya [Mon, 23 Nov 2020 12:12:35 +0000 (13:12 +0100)]
Revert "[clangd] testPath's final result agrees with the passed in Style"
This reverts commit
8cec8de2a4e6692da6226bb02cf417eb0e50adde as it
breaks windows buildbots.
Kazushi (Jam) Marukawa [Sun, 22 Nov 2020 10:36:52 +0000 (19:36 +0900)]
[VE] Clean canRealignStack implementation
Old canRealignStack calls TRI::canRealignStack and hasReservedCallFrame.
But, this hasReservedCallFrame return true whenever for VE since VE
allocates call frame all the time. It means this canRealignStack is
identical to TRI::canRealignStack. This patch removes VE's
canRealignStack and let caller call TRI::canRealignStack directly.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D91929
Kazushi (Jam) Marukawa [Sun, 22 Nov 2020 10:49:45 +0000 (19:49 +0900)]
[VE][NFC] Clean stack frame description
Move stack frame description from VESubtarget.cpp to VEFrameLowering.cpp
and add detail.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D91946
Kadir Cetinkaya [Mon, 23 Nov 2020 09:31:04 +0000 (10:31 +0100)]
[clangd] testPath's final result agrees with the passed in Style
This was confusing, as testRoot on windows results in C:\\clangd-test
and testPath generated with posix explicitly still contained backslashes.
This patch ensures not only the relative part, but the whole final result
respects passed in Style.
Differential Revision: https://reviews.llvm.org/D91947
Kerry McLaughlin [Mon, 23 Nov 2020 11:05:50 +0000 (11:05 +0000)]
[APInt] Add the truncOrSelf resizing operator to APInt
Truncates the APInt if the bit width is greater than the width specified,
otherwise do nothing
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D91445
Kirill Bobyrev [Mon, 23 Nov 2020 10:59:17 +0000 (11:59 +0100)]
[clangd] Get rid of clangToolingRefactoring dependency
D71880 makes this dependency redundant and we can safely remove it. Tested for
both shared lib build and static lib build.
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D91951
Joe Ellis [Wed, 18 Nov 2020 12:13:05 +0000 (12:13 +0000)]
[AArch64][SVE] Allow lax conversion between VLATs and GNU vectors
Previously, lax conversions were only allowed between SVE vector-length
agnostic types and vector-length specific types. This meant that code
such as the following:
#include <arm_sve.h>
#define N __ARM_FEATURE_SVE_BITS
#define FIXED_ATTR __attribute__ ((vector_size (N/8)))
typedef float fixed_float32_t FIXED_ATTR;
void foo() {
fixed_float32_t fs32;
svfloat64_t s64;
fs32 = s64;
}
was not allowed.
This patch makes a minor change to areLaxCompatibleSveTypes to allow for
lax conversions to be performed between SVE vector-length agnostic types
and GNU vectors.
Differential Revision: https://reviews.llvm.org/D91696
Kirill Bobyrev [Mon, 23 Nov 2020 10:42:51 +0000 (11:42 +0100)]
[clangd] Implement Decl canonicalization rules for rename
This patch introduces new canonicalization rules which are used for AST-based
rename in Clangd. By comparing two canonical declarations of inspected nodes,
Clangd determines whether both of them belong to the same entity user would
like to rename. Such functionality is relatively concise compared to the
Clang-Rename API that is used right now. It also helps to overcome the
limitations that Clang-Rename originally had and helps to eliminate several
classes of bugs.
Clangd AST-based rename currently relies on Clang-Rename which has design
limitations and also lacks some features. This patch breaks this dependency and
significantly reduces the amount of code to maintain (Clang-Rename is ~2000 LOC,
this patch is just <30 LOC of replacement code).
We eliminate technical debt by simultaneously
* Maintaining feature parity and ensuring no regressions
* Opening a straightforward path to improving existing rename bugs
* Making it possible to add more capabilities to rename feature which would not
be possible with Clang-Rename
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D71880
Nicolas Vasilache [Mon, 23 Nov 2020 10:13:20 +0000 (10:13 +0000)]
[mlir][Linalg] NFC - Factor out Linalg functionality for shape and loop bounds computation
This revision refactors code used in various Linalg transformations and makes it a first class citizen to the LinalgStructureOpInterface. This is in preparation to allowing more advanced Linalg behavior but is otherwise NFC.
Differential revision: https://reviews.llvm.org/D91863
Haojian Wu [Mon, 23 Nov 2020 09:57:27 +0000 (10:57 +0100)]
[AST] Build recovery expression by default for all language.
The dependency mechanism for C has been implemented, and we have rolled out
this to all internal users, didn't see crashy issues, we consider it is stable
enough.
Differential Revision: https://reviews.llvm.org/D89046
Georgii Rymar [Mon, 23 Nov 2020 08:53:40 +0000 (11:53 +0300)]
[llvm-readelf/obj] - Fix the possible crash when dumping group sections.
It is possible to trigger a crash/misbehavior when the st_name field of
the signature symbol goes past the end of the string table.
This patch fixes it.
Differential revision: https://reviews.llvm.org/D91943
Max Kazantsev [Mon, 23 Nov 2020 09:45:20 +0000 (16:45 +0700)]
[SCEV] Fix incorrect treatment of max taken count. PR48225
SCEV makes a logical mistake when handling EitherMayExit in
case when both conditions must be met to exit the loop. The
mistake looks like follows: "if condition `A` fails within at most `X` first
iterations, and `B` fails within at most `Y` first iterations, then `A & B`
fails at most within `min (X, Y)` first iterations". This is wrong, because
both of them must fail at the same time.
Simple example illustrating this is following: we have an IV with step 1,
condition `A` = "IV is even", condition `B` = "IV is odd". Both `A` and `B`
will fail within first two iterations. But it doesn't mean that both of them
will fail within first two first iterations at the same time, which would mean
that IV is neither even nor odd at the same time within first 2 iterations.
We can only do so for known exact BE counts, but not for max.
Differential Revision: https://reviews.llvm.org/D91942
Reviewed By: nikic
Georgii Rymar [Fri, 20 Nov 2020 09:03:18 +0000 (12:03 +0300)]
[llvm-readobj] - Stop using `unwrapOrError` in `DumpStyle<ELFT>::getGroups()`
With this we are able to diagnose possible issues much better and
don't exit on an error.
Differential revision: https://reviews.llvm.org/D91867
Kadir Cetinkaya [Mon, 23 Nov 2020 09:06:33 +0000 (10:06 +0100)]
[clangd] Second attempt at fixing windows buildbots
Pavel Labath [Fri, 6 Nov 2020 09:44:14 +0000 (10:44 +0100)]
[DebugInfo] Refactor code for emitting DWARF expressions for FP constants
This patch moves the selection of the style used to emit the numbers
(DW_OP_implicit_value vs. DW_OP_const+DW_OP_stack_value) into
DwarfExpression::addUnsignedConstant. This logic is not FP-specific, and
it will be needed for large integers too.
The refactor also makes DW_OP_implicit_value (DW_OP_stack_value worked
already) be used for floating point constants other than float and
double, so I've added a _Float16 test for it.
Split off from D90916.
Differential Revision: https://reviews.llvm.org/D91058
Sjoerd Meijer [Sat, 21 Nov 2020 14:13:36 +0000 (14:13 +0000)]
[LoopFlatten] Widen IV, support ZExt.
I disabled the widening in fa5cb4b because it run in an assert, which was
related to replacing values with different types. I forgot that an extend could
also be a zero-extend, which I have added now. This means that the approach now
is to create and insert a trunc value of the outerloop for each user, and use
that to replace IV values.
Differential Revision: https://reviews.llvm.org/D91690
Michał Górny [Fri, 20 Nov 2020 16:12:22 +0000 (17:12 +0100)]
[lldb] Prevent 'process connect' from using local-only plugins
Add a 'can_connect' parameter to Process plugin initialization, and use
it to filter plugins to these capable of remote connections. This is
used to prevent 'process connect' from picking up a plugin that can only
be used locally, e.g. the legacy FreeBSD plugin.
Differential Revision: https://reviews.llvm.org/D91810
Haojian Wu [Mon, 23 Nov 2020 08:44:19 +0000 (09:44 +0100)]
[clang-tidy] Fix a nullptr-access crash in unused-raii-check.
I saw this crash in our internal production, but unfortunately didn't get
reproduced testcase, we likely hit this crash when the AST is ill-formed
(e.g. broken code).
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D91614
Michał Górny [Sat, 21 Nov 2020 21:15:34 +0000 (22:15 +0100)]
[lldb] [Process/FreeBSDRemote] Fix regset names and related tests
Restore Linux-alike regset names for AVX/MPX registers
as TestLldbGdbServer seems to depend on them. At the same time, fix
TestRegisters to be aware that they are not available on FreeBSD
and NetBSD, at least until we figure out a better way of reporting
unsupported register sets.
Differential Revision: https://reviews.llvm.org/D91923
Michał Górny [Sat, 21 Nov 2020 20:46:05 +0000 (21:46 +0100)]
[lldb] [test] Fix qRegisterInfo lldb-server tests to handle missing registers
Fix qRegisterInfo tests to handle Exx error response when querying
registers that are not supported on the platform in question. This
is how FreeBSD and NetBSD platforms reporting missing registers right
now, and there certainly is value from verifying the remaining
registers.
This change fixes the test for FreeBSD but NetBSD has other regressions
that still need to be researched.
Differential Revision: https://reviews.llvm.org/D91922
Michał Górny [Wed, 18 Nov 2020 19:16:01 +0000 (20:16 +0100)]
[lldb] [Process/Utility] Declare register overlaps between ST and MM
Explicitly declare register overlaps/invalidation between ST(i) and MMi
registers.
Differential Revision: https://reviews.llvm.org/D91728
Michał Górny [Sun, 22 Nov 2020 16:42:19 +0000 (17:42 +0100)]
[lldb] [Process/FreeBSD] Add missing 'override' kws to POSIXStopInfo
Differential Revision: https://reviews.llvm.org/D91934
Kadir Cetinkaya [Mon, 23 Nov 2020 08:16:00 +0000 (09:16 +0100)]
[clangd] Attempt at fixing ExternalIndex tests on windows
Marek Kurdej [Mon, 23 Nov 2020 08:10:20 +0000 (09:10 +0100)]
[libc++] [www] Mark P0482 as "In Progress", as some parts of it are already implemented.
Georgii Rymar [Thu, 19 Nov 2020 09:18:18 +0000 (12:18 +0300)]
[llvm-readobj] - Don't crash when relocation table goes past the EOF.
It is possible to trigger reading past the EOF by breaking fields like
DT_PLTRELSZ, DT_RELSZ or DT_RELASZ
This patch adds a validation in `DynRegionInfo` helper class.
Differential revision: https://reviews.llvm.org/D91787
Max Kazantsev [Mon, 23 Nov 2020 06:18:12 +0000 (13:18 +0700)]
[NFC] Reduce code duplication in binop processing in computeExitLimitFromCondCached
Handling of `and` and `or` vastly uses copy-paste. Factored out into
a helper function as preparation step for further fix (see PR48225).
Differential Revision: https://reviews.llvm.org/D91864
Reviewed By: nikic
Kazu Hirata [Mon, 23 Nov 2020 06:16:12 +0000 (22:16 -0800)]
[CodeGen] Use pred_empty (NFC)
Kazu Hirata [Mon, 23 Nov 2020 05:52:03 +0000 (21:52 -0800)]
[ValueMapper] Remove unused declaration remapFunction (NFC)
The function declaration with two parameters was introduced on Apr 16
2016 in commit
f0d73f95c15f909c6034f1735632695248bb75a8 without a
corresponding definition.
Kazu Hirata [Mon, 23 Nov 2020 04:08:50 +0000 (20:08 -0800)]
[hwasan] Remove unused declaration shadowBase (NFC)
The function was introduced on Jan 23, 2019 in commit
73078ecd381b5ce95638c7a8e41fcabb6c27703a.
Its definition was removed on Oct 27, 2020 in commit
0930763b4baf926a39dd2d0571fd9e2102ec3831, leaving the declaration
unused.
John Demme [Mon, 23 Nov 2020 00:04:43 +0000 (16:04 -0800)]
[MLIR] ODS typedef gen fixes & improvements
- Fixes bug 48242 point 3 crash.
- Makes the improvments from points 1 & 2.
https://bugs.llvm.org/show_bug.cgi?id=48262
```
def RTLValueType : Type<CPred<"isRTLValueType($_self)">, "Type"> {
string cppType = "::mlir::Type";
}
```
Works now, but merely by happenstance. Parameters expects a `TypeParameter` class def or a string representing a c++ type but doesn't enforce it.
Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D91939
Zequan Wu [Wed, 18 Nov 2020 23:26:21 +0000 (15:26 -0800)]
[Clang] Add __STDCPP_THREADS__ to standard predefine macros
According to https://eel.is/c++draft/cpp.predefined#2.6, `__STDCPP_THREADS__` is a predefined macro.
Differential Revision: https://reviews.llvm.org/D91747
David Green [Sun, 22 Nov 2020 21:38:00 +0000 (21:38 +0000)]
[ARM] Ensure MVE_TwoOpPattern is used inside Predicate's
Nico Weber [Sun, 22 Nov 2020 21:12:08 +0000 (16:12 -0500)]
[gn build] (manually) port
ed424b428
David Green [Sun, 22 Nov 2020 21:16:49 +0000 (21:16 +0000)]
[ARM] MVE VABD tests. NFC
LLVM GN Syncbot [Sun, 22 Nov 2020 21:09:32 +0000 (21:09 +0000)]
[gn build] Port
067ffbfe601
Nico Weber [Sun, 22 Nov 2020 21:07:33 +0000 (16:07 -0500)]
[gn build] sort of merge
37ac559fccd4
It'd be nicer if there was a group target that forwarded either to
//clang-tools-extra/clangd/index/remote or
//clangd/index/remote/unimplemented based on if remote index is enabled,
but for now it's never enabled in the gn build.
Stella Laurenzo [Sat, 21 Nov 2020 01:57:46 +0000 (17:57 -0800)]
[mlir][Python] Support finding pybind11 from the python environment.
* Makes `pip install pybind11` do the right thing with no further config.
* Since we now require a version of pybind11 greater than many LTS OS installs (>=2.6), a more convenient way to get a recent version is preferable.
* Also adds the version spec to find_package so it will skip older versions that may be lying around.
* Tested the full matrix of old system install, no system install, pip install and no pip install.
Differential Revision: https://reviews.llvm.org/D91903