Anna Thomas [Thu, 14 May 2020 14:17:12 +0000 (10:17 -0400)]
[RS4GC] Fix algorithm to avoid setting vector BDV for scalar derived pointer""
This is relanding of rGbb308b020522420413c7d3f2989a88f2fc423c56 after
speculatively fixing buildbot lit test failure which was seen on two
bots (I cannot reproduce the lit test failure locally either).
[RS4GC] Fix algorithm to avoid setting vector BDV for scalar derived
pointer
Summary:
This is a more general fix to
59029b9eef23 (D75704).
This patch does the following:
updates isKnownBaseValue to account for base pointer and
derived pointer having differing types.
This inturn allows us to populate the
lattice (States) for such derived pointers.
It also updates all states where the base and derived pointers have
differing types (vector versus scalar) and conservatively marks these
states as conflictcs.
Note that in
59029b9eef23, we were just fixing existing lattice values
and that too, only for uses of extractelement.
Reviewers: reames, skatkov, dantrushin
Reviewed By: skatkov
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D76305
Benjamin Kramer [Thu, 14 May 2020 15:11:44 +0000 (17:11 +0200)]
[Support] Make UniqueStringSaver wrap a StringSet
This is slightly more efficient while providing exactly the same
semantics.
Ehud Katz [Thu, 14 May 2020 14:56:39 +0000 (17:56 +0300)]
Revert "[StructurizeCFG] Fix region nodes ordering"
This reverts commit
897d8ee5cd693e17f95a7e84194bca4c089a520b,
due to causing an infinite loop when encountering a loop with
a sub-region with an inner loop.
Levon Ter-Grigoryan [Thu, 14 May 2020 14:05:40 +0000 (16:05 +0200)]
Moving executable module symbols parsing to target creation method.
Summary:
In our project we are using remote client-server LLDB configuration.
We want to parse as much debugging symbols as we can before debugger starts attachment to the remote process.
To do that we are passing the path of the local executable module to CreateTarget method at the client.
But, it seems that this method are not parsing the executable module symbols.
To fix this I added PreloadSymbols call for executable module to target creation method.
This patch also fixes a problem where the DynamicLoader would reset a
module when launching the target. We fix it by making sure
Platform::ResolveExecutable returns the module object obtained from the
remote platform.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D78654
Michael Schellenberger Costa [Thu, 14 May 2020 14:50:03 +0000 (10:50 -0400)]
[libcxx][span] Implement solution to LWG-3255
This implements the relaxed requirements on the std::array constructors of span,
where the type only needs to be convertible to the element type of the span.
Note that the previous tests were not sufficient, as the const array<T, n> constructor
was only tested for compile time and the array<T, N> only during runtime.
Restructure the tests so that we can test conversions as well as both constructors.
Differential Revision: https://reviews.llvm.org/D75706
Sean Fertile [Thu, 14 May 2020 14:31:01 +0000 (10:31 -0400)]
[PowerPC] Remove support for SplitCSR.
SplitCSR was only suppored for functions with CXX_FAST_TLS calling
convention. Clang only emits that calling convention for Darwin which is
no longer supported by the PowerPC backend. Another IR producer could
use the calling convention, but considering the calling convention is
meant to be an optimization and the codegen for SplitCSR can be
attrocious on Power (see the modifed lit test) it is best to remove it
and codegen CXX_FAST_TLS same as the C calling convention.
Differential Revision: https://reviews.llvm.org/D79018
Erich Keane [Wed, 13 May 2020 20:24:03 +0000 (13:24 -0700)]
Prohibit capture of _ExtInt in inline assembly.
The backends don't seem to properly handle the _ExtInt type in inline
assembly with crashes occurring in many. While the ones I tested seem to
work for powers of 2 < 64 (and some any multiple of 64 greater than
that), it seemed like a better idea to just use of this type in inline
assembly prohibited.
Anna Thomas [Thu, 14 May 2020 14:16:25 +0000 (10:16 -0400)]
Revert "[RS4GC] Fix algorithm to avoid setting vector BDV for scalar derived pointer"
This reverts commit
bb308b020522420413c7d3f2989a88f2fc423c56.
Failing a testcase.
Anna Thomas [Thu, 14 May 2020 13:15:57 +0000 (09:15 -0400)]
[RS4GC] Fix algorithm to avoid setting vector BDV for scalar derived pointer
Summary:
This is a more general fix to
59029b9eef23 (D75704).
This patch does the following:
1. updates isKnownBaseValue to account for base pointer and
derived pointer having differing types.
2. This inturn allows us to populate the
lattice (States) for such derived pointers.
3. It also updates all states where the base and derived pointers have
differing types (vector versus scalar) and conservatively marks these
states as conflictcs.
Note that in
59029b9eef23, we were just fixing existing lattice values
and that too, only for uses of extractelement.
Reviewers: reames, skatkov, dantrushin
Reviewed By: skatkov
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76305
Pavel Labath [Thu, 14 May 2020 13:55:21 +0000 (15:55 +0200)]
[lldb/PDB] Make "native" pdb tests host-independent
These test don't execute the binaries they build, and so they don't need
to build for the host. By hardcoding the target, we don't have do xfail
or skip them for targets which don't have the appropriate support in
clang(-cl).
Matt Arsenault [Sat, 2 May 2020 22:32:40 +0000 (18:32 -0400)]
lld: Let find_package(LLD) work
Install a cmake config file. Copied exactly from how clang exports.
I also wasn't sure whether the canonical capitalization is "lld" or
"LLD". The project() is still calling this lld, but most places seemed
to capitalize it.
Gabor Marton [Thu, 14 May 2020 13:49:07 +0000 (15:49 +0200)]
[analyzer] Improve PlacementNewChecker
Summary:
1. Added insufficient storage check for arrays
2. Added align support check
Based on https://reviews.llvm.org/D76229
Reviewers: aaron.ballman, lebedev.ri, NoQ, martong
Reviewed By: martong
Subscribers: xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76996
Patch by Karasev Nikita!
Xinglong Liao [Thu, 14 May 2020 13:38:25 +0000 (08:38 -0500)]
[Hexagon] Check isInstr() before getInstr() with SUnit
SUnit represent a MachineInstr in post-regalloc scheduling but SDNode
in pre-regalloc scheduling. when pass -enable-hexagon-sdnode-sched to
Hexagon backend with -O1 and above, this may cause an assertion failed.
Fixes PR45194.
Differential Revision: https://reviews.llvm.org/D76134
Gabor Marton [Thu, 14 May 2020 13:44:20 +0000 (15:44 +0200)]
Fix Z3 function calls regarding arithmetic operations
Summary:
The order of Z3_mk_fpa_mul, Z3_mk_fpa_div, Z3_mk_fpa_add and Z3_mk_fpa_sub functions' arguments is: context, rounding_mode, ast1, ast2.
See for example: https://github.com/Z3Prover/z3/blob/
a14c2a30516003cd1a60f8b7deca029033d11c78/src/api/api_fpa.cpp#L433
At function calls from LLVM the argument order was different: rounding_mode was passed as last argument.
Unfortunately these Z3_ast and other function parameter types are technically like void* which are reinterpret_cast-ed to a specific class type. So there was no type error, but the assertions fail in runtime if something goes wrong. Such a crash happened during Z3 refutation while using StaticAnalyzer.
Reviewers: Szelethus, xazax.hun, baloghadamsoftware, steakhal, martong, mikhail.ramalho
Reviewed By: martong
Subscribers: hiraditya, rnkovacs, mikhail.ramalho, martong, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79883
Patch by Tibor Brunner!
Gabor Marton [Tue, 14 Apr 2020 15:40:42 +0000 (17:40 +0200)]
[analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries
Reviewers: NoQ, Szelethus, baloghadamsoftware, balazske
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, steakhal, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78118
Michael Schellenberger Costa [Thu, 14 May 2020 13:28:27 +0000 (09:28 -0400)]
[libc++][span] SFINAE span default constructor on Extent == 0
The default constructor of a static span requires _Extent == 0 so
SFINAE it out rather than using a static_assert
Differential Revision: https://reviews.llvm.org/D71994
Gabor Marton [Tue, 5 May 2020 14:37:10 +0000 (16:37 +0200)]
[analyzer] Make NonNullParamChecker as dependency for StdCLibraryFunctionsChecker
Summary:
If a given parameter in a FunctionDecl has a nonull attribute then the NonNull
constraint in StdCLibraryFunctionsChecker has the same effect as
NonNullParamChecker. I think it is better to emit diagnostics from the simpler
checker. By making NonNullParamChecker as a dependency, in these cases it will
be the first to emit a diagnostic and to stop the analysis on that path.
Reviewers: Szelethus, NoQ, baloghadamsoftware, balazske, steakhal
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, Charusso, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79420
Melanie Blower [Thu, 14 May 2020 12:56:35 +0000 (05:56 -0700)]
[clang] Fix bug in #pragma float_control(push/pop)
Summary: #pragma float_control(pop) was failing to restore the expected
floating point settings because the settings were not correctly preserved
at #pragma float_control(push).
Valeriy Savchenko [Thu, 14 May 2020 10:31:01 +0000 (13:31 +0300)]
[analyzer] Modernize analyzer's Python scripts
Summary:
Fix read/write in binary format, which crashes Python 3.
Additionally, clean up redundant (as for Python 3) code and
fix a handful of flake8 warnings.
Differential Revision: https://reviews.llvm.org/D79932
Sanjay Patel [Thu, 14 May 2020 12:33:59 +0000 (08:33 -0400)]
[x86][CGP] improve sinking of splatted vector shift amount operand
Expands on the enablement of the shouldSinkOperands() TLI hook in:
D79718
The last codegen/IR test diff shows what I suspected could happen - we were
sinking all splat shift operands into a loop. But that's not what we want in
general; we only want to sink the *shift amount* operand if it is a splat.
Differential Revision: https://reviews.llvm.org/D79827
Michael Schellenberger Costa [Thu, 14 May 2020 12:27:13 +0000 (08:27 -0400)]
[libcxx][span] Remove const_iterator from std::span
This implements the resolution to LWG-3320.
Differential Revision: https://reviews.llvm.org/D75642
Balázs Kéri [Thu, 14 May 2020 07:48:15 +0000 (09:48 +0200)]
[Analyzer][VLASizeChecker] Check VLA size in typedef and sizeof.
Summary:
The check of VLA size was done previously for variable declarations
(of VLA type) only. Now it is done for typedef (and type-alias)
and sizeof expressions with VLA too.
Reviewers: Szelethus, martong
Reviewed By: Szelethus, martong
Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79072
Michael Schellenberger Costa [Thu, 14 May 2020 12:24:59 +0000 (08:24 -0400)]
[libcxx][span] Remove tuple interface
This implements P2116 by removing the tuple interface from std::span.
Differential Revision: https://reviews.llvm.org/D75640
Simon Pilgrim [Thu, 14 May 2020 11:30:07 +0000 (12:30 +0100)]
SelectionDAG.cpp - remove non-constant EXTRACT_SUBVECTOR/INSERT_SUBVECTOR handling. NFC.
Now that D79814 has landed, we can assume that subvector ops use constant, in-range indices.
Haojian Wu [Thu, 14 May 2020 12:14:48 +0000 (14:14 +0200)]
[clangd] Correct the elog message, NFC.
Florian Hahn [Thu, 14 May 2020 11:37:38 +0000 (12:37 +0100)]
[VPlan] Move emission of \\l\"+\n to dumpBasicBlock (NFC).
The patch standardizes printing of VPRecipes a bit, by hoisting out the
common emission of \\l\"+\n. It simplifies the code and is also a first
step towards untangling printing from DOT format output, with the goal
of making the DOT output optional and to provide a more concise debug
output if DOT output is disabled.
Reviewers: gilr, Ayal, rengolin
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D78883
Sam McCall [Thu, 14 May 2020 12:06:05 +0000 (14:06 +0200)]
[clangd] Remove extra qualification
Sam McCall [Thu, 14 May 2020 00:43:27 +0000 (02:43 +0200)]
[clangd] Don't create as much garbage while building Dex index.
Summary:
The Token objects are relatively expensive and we were spending a lot of
CPU creating them for each trigram emitted. Instead, use a tiny trigram
structure until we're ready to finalize the index.
This improves the new BuildDex benchmark by 20%. This code is hot and on
the critical path in clangd: it runs after a new preamble is built.
Reviewers: kbobyrev
Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79918
Pavel Labath [Thu, 14 May 2020 11:28:47 +0000 (13:28 +0200)]
[lldb] Fix a "missing return" warning in XcodeSDK
Pavel Labath [Thu, 14 May 2020 11:25:57 +0000 (13:25 +0200)]
[lldb] Use llvm::MC for register numbers in AArch64 ABIs
Summary:
This is equivalent to previous patches (e.g.
07355c1c0) for the x86 ABIs.
One name fixup is needed -- lldb refers to the floating/vector registers by
their vector name (vN). Llvm does not use this name, so we map it to qN,
representing the register as a single 128 bit value (this choice is fairly
arbitrary -- any other name would also work fine as they all have the same
DWARF number).
Reviewers: JDevlieghere, jasonmolenda, omjavaid
Reviewed By: omjavaid
Subscribers: clayborg, danielkiss, aprantl, kristof.beyls, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D75607
Haojian Wu [Thu, 14 May 2020 11:08:59 +0000 (13:08 +0200)]
[clangd] Setting recovery-ast flag in buildCompilerInvocation, NFC.
This saves some duplicated code (in buildPreamble and buildAST).
John Brawn [Thu, 14 May 2020 10:51:13 +0000 (11:51 +0100)]
[libc++] Adjust how we guard the inclusion of unistd.h
unistd.h isn't guaranteed to exist when the target isn't Windows, in
particular if the target is bare-metal (i.e. no operating system).
Handle this by using __has_include instead, though in
filesystem/operations.cpp we already unconditionally include it so
just remove the extra include.
Differential Revision: https://reviews.llvm.org/D79784
Martin Storsjö [Thu, 14 May 2020 10:46:33 +0000 (13:46 +0300)]
[LLD] [COFF] Try to fix test errors from
7f0e6c31c255303 on windows
Just skip trying to match for the path separator explicitly (instead
of making it match either a forward or backwards slash), simplifying
the test a little.
David Zarzycki [Thu, 14 May 2020 10:12:54 +0000 (06:12 -0400)]
[libcxx testing] Remove ALLOW_RETRIES from two futures tests
These two tests do not use the "thread sleeps X milliseconds" pattern
that other libcxx tests use, so all we can do in order to remove
ALLOW_RETRIES workaround is remove the assumption that measuring the
"quick" return of `wait()` is possible (it is not). Let the test harness
verify overall that `wait()` does not hang.
As a bonus, have the spin-waiting threads `yield()`, which is what well
behaved code should do.
Pavel Labath [Thu, 14 May 2020 10:10:56 +0000 (12:10 +0200)]
[lldb/gdb-remote] Change default value of use-libraries-svr4 to true
This setting was added last year, defaulting to false. There have been
no bug reports about the svr4 code path since then, and the using this
packet is definitely faster than walking the module list from lldb.
Set the default value of the setting to true, as that is a better
default. Users can still change it back if encountering problems, or we
can revert the change as well, in case of bigger issues.
I also add a note to the setting description that it is only effective
if lldb is built with xml support.
Martin Storsjö [Sat, 25 Apr 2020 21:49:44 +0000 (00:49 +0300)]
[LLD] [COFF] Add options for disabling auto import and runtime pseudo relocs
Allow disabling either the full auto import feature, or just
forbidding the cases that require runtime fixups.
As long as all auto imported variables are referenced from separate
.refptr$<name> sections, we can alias them on top of the IAT entries
and don't actually need any runtime fixups via pseudo relocations.
LLVM generates references to variables in .refptr stubs, if it
isn't known that the variable for sure is defined in the same object
module. Runtime pseudo relocs are needed if the addresses of auto
imported variables are used in constant initializers though.
Fixing up runtime pseudo relocations requires the use of
VirtualProtect (which is disallowed in WinStore/UWP apps) or
VirtualProtectFromApp. To allow any risk of ambiguity, allow
rejecting cases that would require this at the linker stage.
This adds support for the --disable-runtime-pseudo-reloc and
--disable-auto-import options in the MinGW driver (matching GNU ld.bfd)
with corresponding lld private options in the COFF driver.
Differential Revision: https://reviews.llvm.org/D78923
Pavel Labath [Wed, 13 May 2020 09:13:19 +0000 (11:13 +0200)]
[lldb] Switch Section-dumping code to raw_ostream
Also, add a basic test for dumping sections.
Pavel Labath [Tue, 12 May 2020 15:14:20 +0000 (17:14 +0200)]
[lldb] Don't dissasemble large functions by default
Summary:
If we have a binary without symbol information (and without
LC_FUNCTION_STARTS, if on a mac), then we have to resort to using
heuristics to determine the function boundaries. However, these don't
always work, and so we can easily end up thinking we have functions
which are several megabytes in size. Attempting to (accidentally)
disassemble these can take a very long time spam the terminal with
thousands of lines of disassembly.
This patch works around that problem by adding a sanity check to the
disassemble command. If we are about to disassemble a function which is
larger than a certain threshold, we will refuse to disassemble such a
function unless the user explicitly specifies the number of instructions
to disassemble, uses start/stop addresses for disassembly, or passes the
(new) --force argument.
The threshold is currently fairly aggressive (4000 bytes ~~ 1000
instructions). If needed, we can increase it, or even make it
configurable.
Differential Revision: https://reviews.llvm.org/D79789
Xing GUO [Thu, 14 May 2020 09:33:49 +0000 (17:33 +0800)]
[llvm-dwarfdump] Make commandline arguments consistent.
Currently, llvm-dwarfdump's help message has two issues.
1. Most long options are printed in `--long-option`, except for some section dumping options, e.g., `-apple-names`, `-debug-addr`.
2. Most options are printed with consistent indention, except for some section dumping options.
This patch helps resolve these two issues.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D79618
Haojian Wu [Thu, 14 May 2020 07:23:42 +0000 (09:23 +0200)]
[clangd] Only emit default error/fatal diagnostices from included files.
Summary:
This would avoid adding too much noise when there is a "-Wall" in the
compile command.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79923
Stephan Herhut [Wed, 13 May 2020 13:28:24 +0000 (15:28 +0200)]
[mlir] Fix the example for std.rank
Summary:
The assembly format for std.rank expects the operand type and not the
result type after the colon.
Differential Revision: https://reviews.llvm.org/D79857
Konstantin Schwarz [Sun, 12 Apr 2020 14:16:30 +0000 (16:16 +0200)]
[GlobalISel][InlineAsm] Add support for basic input operand constraints
Reviewers: arsenm, dsanders, aemerson, volkan, t.p.northover, paquette
Reviewed By: arsenm
Subscribers: gargaroff, wdng, rovka, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78319
Christian Sigg [Wed, 13 May 2020 19:53:00 +0000 (21:53 +0200)]
Only run pretty-printer tests for builds with debug-info.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: tbosch, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79897
Stephen Neuendorffer [Wed, 13 May 2020 20:40:06 +0000 (13:40 -0700)]
[MLIR][cmake] don't glob for sources.
Generally speaking, this is bad practice. It also causes the build to
break if there are editor temporary files.
Differential Revision: https://reviews.llvm.org/D79906
Gabor Greif [Wed, 13 May 2020 17:03:22 +0000 (19:03 +0200)]
Fix typo in error message
Greg Clayton [Thu, 14 May 2020 05:01:57 +0000 (22:01 -0700)]
Fix buildbots errors after comitting D78782.
Rename "Ranges" variables to "DebugRanges" to avoid warnings/errors on machines that have extra settings enabled.
https://reviews.llvm.org/D78782
Akira Hatanaka [Tue, 14 Apr 2020 02:07:16 +0000 (19:07 -0700)]
Don't apply lvalue-to-rvalue conversion in DefaultLValueConversion to
the expression that is passed to it if it has a function type or array
type
lvalue-to-rvalue conversion should only be applied to non-function,
non-array types, but clang was applying the conversion to discarded
value expressions of array types.
rdar://problem/
61203170
Differential Revision: https://reviews.llvm.org/D78134
Erik Pilkington [Thu, 14 May 2020 02:19:45 +0000 (22:19 -0400)]
[demangler] Support for 'this' expressions
llvm.org/PR45896
Douglas Yung [Thu, 14 May 2020 02:11:16 +0000 (02:11 +0000)]
Fix PS4 build of compiler-rt runtime.
In a previous change I added a shim for fork(), but when compiled from InstrProfiling.c, the
required header file was not included, so pid_t was undefined. This change adds that include.
Michael Berg [Thu, 14 May 2020 01:19:38 +0000 (18:19 -0700)]
Propagate MIFlags in table gen
Summary: Add flag propagation to tablegen via OutMIs from originating MI in InstructionSelector::executeMatchTable.
Reviewers: dsanders, volkan
Reviewed By: dsanders
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74988
Huihui Zhang [Thu, 14 May 2020 00:55:08 +0000 (17:55 -0700)]
[CodeGen][NFC] Fix test/CodeGen/pr45476.cpp to specify target triple.
Summary:
Use explicit target triple to match more accurately the output for libcall
or native atomic.
Similar to D74847, without explicit target triple, this test will fail for ARM.
This patch update test pr45476.cpp to check for both native atomic and libcall.
Reviewers: efriedma, ekatz, rjmccall, rsmith, luismarques
Reviewed By: efriedma
Subscribers: kristof.beyls, jfb, cfe-commits, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D79914
Craig Topper [Thu, 14 May 2020 00:51:45 +0000 (17:51 -0700)]
[X86] Return true from trySADReplacement in the partial reduction pass when a change is made.
Otherwise we don't signal to the pass manager that we changed IR.
Stephen Neuendorffer [Thu, 14 May 2020 00:42:46 +0000 (17:42 -0700)]
[cmake] fix typo.
Stephen Neuendorffer [Thu, 14 May 2020 00:17:54 +0000 (17:17 -0700)]
[cmake] Need PUBLIC dependencies for object targets even if LLVM_PTHREAD_LIB is unset
Fix logic in previous patch.
Christopher Tetreault [Wed, 13 May 2020 23:00:20 +0000 (16:00 -0700)]
[SVE] Remove usages of VectorType::getNumElements() from Hexagon
Reviewers: efriedma, kmclaughlin, sdesmalen, kparzysz
Reviewed By: kparzysz
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79819
Wei Zhao [Wed, 13 May 2020 23:38:42 +0000 (16:38 -0700)]
[AARch64] Add Marvell ThunderX3T110 support
This is the first checkin to support Marvell ThunderX3T110.
Initial definition of the micro-ops of the instructions in ThunderX3T110
is included.
Differential Revision: https://reviews.llvm.org/D78129
Stephen Neuendorffer [Wed, 13 May 2020 23:40:51 +0000 (16:40 -0700)]
[cmake] Check for empty LLVM_PTHREAD_LIB
Windows builds broke because LLVM_THREAD_LIB is not set.
Omar Ahmed [Wed, 13 May 2020 21:48:49 +0000 (16:48 -0500)]
[Attributor] Improve the alignment of the loads
This patch introduces an improvement in the Alignment of the loads
generated in createReplacementValues() by querying AAAlign attribute for
the best Alignment for the base.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D76550
Johannes Doerfert [Wed, 13 May 2020 22:43:01 +0000 (17:43 -0500)]
[Attributor] Check lines accidentally not committed with D76208
Greg Clayton [Fri, 24 Apr 2020 02:25:12 +0000 (19:25 -0700)]
Add .debug_ranges support to the DWARF YAML.
Summary: This allows DIEs with DW_AT_ranges to be encoded and decoded _and_ actually have their address ranges be included instead of having DW_AT_ranges with a section offset value for a section that doesn't exist.
Reviewers: labath, aprantl, JDevlieghere, dblaikie, probinson
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78782
Christopher Tetreault [Wed, 13 May 2020 22:19:07 +0000 (15:19 -0700)]
[SVE] Remove usages of VectorType::getNumElements() from AMDGPU
Reviewers: efriedma, arsenm, david-arm, fpetrogalli
Reviewed By: efriedma
Subscribers: dmgreen, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, tschuett, hiraditya, rkruppe, psnobl, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79807
Florian Hahn [Wed, 13 May 2020 22:31:47 +0000 (23:31 +0100)]
[AArch64] Don't promote constants with float ConstantExpr.
Currently the AsmPrinter cannot emit some floating point constant
expressions in global initializers. Avoid generating them.
Reviewers: dmgreen, t.p.northover, arsenm, efriedma, Gerolf
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D79865
Eric Christopher [Wed, 13 May 2020 22:12:34 +0000 (15:12 -0700)]
Remove an unused variable.
Eli Friedman [Tue, 12 May 2020 20:08:28 +0000 (13:08 -0700)]
[AArch64][SVE] Add patterns for VSELECT of immediate merged with a variable.
This covers forms involving "CPY (immediate, merging)".
Differential Revision: https://reviews.llvm.org/D79803
Yaxun (Sam) Liu [Wed, 13 May 2020 13:02:30 +0000 (09:02 -0400)]
[HIP] Do not emit debug info for stub function
The stub function is generated by compiler and its instructions have nothing
to do with the kernel source code.
Currently clang generates debug info for the stub function, which causes
confusion for the HIP debugger. For example, when users set break point
on a line of a kernel, the debugger should break on that line when the kernel is
executed and reaches that line, but instead the debugger breaks in the stub function.
This patch disables debug info for stub function for HIP.
Differential Revision: https://reviews.llvm.org/D79866
Stanislav Mekhanoshin [Wed, 13 May 2020 18:46:28 +0000 (11:46 -0700)]
[AMDGPU] Optimized indirect multi-VGPR addressing
SelectMOVRELOffset prevents peeling of a constant from an index
if final base could be negative. isBaseWithConstantOffset() succeeds
if a value is an "add" or "or" operator. In case of "or" it shall
be an add-like "or" which never changes a sign of the sum given a
non-negative offset. I.e. we can safely allow peeling if operator is
an "or".
Differential Revision: https://reviews.llvm.org/D79898
Sean Silva [Wed, 13 May 2020 03:15:09 +0000 (20:15 -0700)]
[mlir] Change generate-test-checks.py to `%[[V:.*]]` style
Summary:
This style seems to be the preferred style lately as it plays better
with op syntaxes that include `[` and `]`.
Input:
```
module {
func @f(%arg0 : i32) -> i32 {
%0 = addi %arg0, %arg0 : i32
%1 = muli %arg0, %0 : i32
return %1 : i32
}
}
```
New output:
```
// NOTE: Assertions have been autogenerated by utils/generate-test-checks.py
// CHECK: module {
// CHECK-LABEL: func @f(
// CHECK-SAME: %[[VAL_0:.*]] : i32) -> i32 {
// CHECK: %[[VAL_1:.*]] = addi %[[VAL_0]], %[[VAL_0]] : i32
// CHECK: %[[VAL_2:.*]] = muli %[[VAL_0]], %[[VAL_1]] : i32
// CHECK: return %[[VAL_2]] : i32
// CHECK: }
// CHECK: }
```
Old output:
```
// NOTE: Assertions have been autogenerated by utils/generate-test-checks.py
// CHECK: module {
// CHECK-LABEL: func @f(
// CHECK-SAME: [[VAL_0:%.*]] : i32) -> i32 {
// CHECK: [[VAL_1:%.*]] = addi [[VAL_0]], [[VAL_0]] : i32
// CHECK: [[VAL_2:%.*]] = muli [[VAL_0]], [[VAL_1]] : i32
// CHECK: return [[VAL_2]] : i32
// CHECK: }
// CHECK: }
```
Differential Revision: https://reviews.llvm.org/D79836
Kuter Dinel [Wed, 13 May 2020 17:49:15 +0000 (12:49 -0500)]
[Attributor] Use AAValueConstantRange to infer dereferencability.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D76208
Eric Christopher [Wed, 13 May 2020 21:36:53 +0000 (14:36 -0700)]
Remove unused Debugging variable.
Reid Kleckner [Wed, 13 May 2020 21:24:11 +0000 (14:24 -0700)]
[PDB] Switch from LLVM_PACKED to LLVM_PACKED_START/END
Reportedly using the pragma instead of the __attribute__ silences
warnings with some GCC versions.
Adrian McCarthy [Fri, 1 May 2020 22:51:02 +0000 (15:51 -0700)]
Fix template class debug info for Visual Studio visualizers
An earlier change eliminated spaces between the close brackets of nested
template lists. Unfortunately that prevents the Windows debuggers from
matching some types to their corresponding visualizers (e.g., std::map).
This selects the SeparateTemplateClosers flag when generating CodeView.
Note that we were already making formatting adjustments under similar
circumstances for similar reasons.
This wasn't caught by existing tests because they were using only
-std=c++98.
Differential Revision: https://reviews.llvm.org/D79274
Craig Topper [Wed, 13 May 2020 21:13:25 +0000 (14:13 -0700)]
[X86] Add test case for a regression from D76649. NFC
When combineLoopMAdd was moved to IR we got stricter about
ensuring the truncate was free. This prevents us from matching
this sum of squares of byte differences pattern show here.
We used to get this case when it was in SelectionDAG.
Stephen Neuendorffer [Wed, 13 May 2020 21:06:55 +0000 (14:06 -0700)]
[cmake] Update creation of object library dependencies for LINK_LIBS PUBLIC (v2)
REGEX matching doesn't work here because the problematic library can
sometimes be "-lpthread" and sometimes "pthread". Let's do the
simplest thing possible and just string compare.
Differential Revision: https://reviews.llvm.org/D79908
Mircea Trofin [Wed, 13 May 2020 21:08:55 +0000 (14:08 -0700)]
[llvm][NFC] Remove unused fields in InlineAdvisor
Craig Topper [Wed, 13 May 2020 20:30:34 +0000 (13:30 -0700)]
[X86] Fix one of the PMADDWD tests to not have dead code.
There are two reductions in this test. It looks like I intended
to combine them by packing one of them into the upper 32 bits of
the result. But the OR instruction was missing.
Christopher Tetreault [Wed, 13 May 2020 20:31:43 +0000 (13:31 -0700)]
Ensure that CMake tries to find Python3 before processing
Summary:
It is possible that CMake tries to process debuginfo-tests before any
attempt to find Python3. Ensure that CMake attempts to find it before
complaining that it doesn't exist.
Reviewers: zturner, rnk, jmorse, chandlerc
Reviewed By: rnk
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79795
Mircea Trofin [Wed, 13 May 2020 17:41:00 +0000 (10:41 -0700)]
[docs] Add link to zorg github project
Reviewers: gkistanova
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79891
Mircea Trofin [Tue, 28 Apr 2020 20:25:15 +0000 (13:25 -0700)]
[llvm] Add interface to drive inlining decision using ML model
Summary:
This change introduces InliningAdvisor (and related APIs), the interface
that abstracts decision making away from the inlining pass. We will use
this interface to delegate decision making to a trained ML model,
subsequently (see referenced RFC).
RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140763.html
Reviewers: davidxl, eraman, dblaikie
Subscribers: mgorny, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79042
Craig Topper [Wed, 13 May 2020 19:51:18 +0000 (12:51 -0700)]
[X86] Only allow f32, f64, or f80 to be used with 'f' inline assembly constraint.
Avoids crash when using i128. Gives better error than
'scalar-to-vector conversion failed' for other types.
Louis Dionne [Wed, 13 May 2020 20:15:34 +0000 (16:15 -0400)]
[libc++] Explicitly list Lit features from the config_site header
When grepping for unused features in the test suite, we will now find
those features and where they are defined, as opposed to thinking they
are dead features.
Eli Friedman [Tue, 12 May 2020 22:09:10 +0000 (15:09 -0700)]
[SelectionDAG] Require constant index for INSERT/EXTRACT_SUBVECTOR.
It sounds like an interesting idea in theory, but nothing is actually
taking advantage of it, and specifying/implementing the edge cases is
painful. So just forbid it.
Differential Revision: https://reviews.llvm.org/D79814
Alina Sbirlea [Tue, 14 Jan 2020 18:27:20 +0000 (10:27 -0800)]
[NewPassManager] Add assertions when getting statefull cached analysis.
Summary:
Analyses that are statefull should not be retrieved through a proxy from
an outer IR unit, as these analyses are only invalidated at the end of
the inner IR unit manager.
This patch disallows getting the outer manager and provides an API to
get a cached analysis through the proxy. If the analysis is not
stateless, the call to getCachedResult will assert.
Reviewers: chandlerc
Subscribers: mehdi_amini, eraman, hiraditya, zzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72893
Alina Sbirlea [Thu, 16 Apr 2020 07:08:53 +0000 (00:08 -0700)]
[SimpleLoopUnswitch] Add non-empty unreachable block check to exit cases removed.
Summary:
Update check to include the check for unreachable.
Basic blocks ending in unreachable are special cased, as these blocks may be already unswitched. Before this patch this check is only done for the default destination.
The condition for the exit cases and the default case must be the same, because we should never leave edges from the switch instruction to a basic block that we are unswitching. In PR45355 we still have a remaining edge (that we're attempting to remove from the DT) because its the default edge to an unreachable-terminated block where we unswitch a case edge to that block.
Resolves PR45355.
Reviewers: chandlerc
Subscribers: hiraditya, uabelho, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78279
Matt Arsenault [Wed, 13 May 2020 17:00:58 +0000 (13:00 -0400)]
AMDGPU: Use Register
Craig Topper [Wed, 13 May 2020 03:59:43 +0000 (20:59 -0700)]
[X86] Don't allow f80 to be used with the 'q', 'r', 'l', 'Q' or 'q' inline assembly constraints.
It was previously trying to use the 64-bit class, but 80 isn't
evenly divisible by 64 so it will trigger a crash.
Craig Topper [Wed, 13 May 2020 03:54:13 +0000 (20:54 -0700)]
[X86] Make the if statement structure for inline assembly constraints 'l', 'r', 'q', 'Q', and 'R' the same.
These did similar things but had slight differences. For example
'Q' didn't allow f64, but the others did.
Douglas Yung [Wed, 13 May 2020 18:47:01 +0000 (18:47 +0000)]
Add shim for fork() on PS4 as it is not supported there.
Reviewers: probinson
Subscribers: #sanitizers llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D79839
Pete Steinfeld [Tue, 12 May 2020 20:10:32 +0000 (13:10 -0700)]
Fixed a problem removing temp files
Summary:
Before making this change, whenever I ran "check-flang", I'd get an
error message like:
llvm-lit: /mnt/c/GitHub/f18/c751/flang/build/bin/../../../llvm/utils/lit/lit/main.py:252: warning: Failed to delete temp directory '/tmp/lit_tmp_gOKUIh'
With this change, there's no such message in the output, and the temp
directory is successfully removed.
Note that my working environment is on Windows 10 running Windows
Subsystem for Linux using the Ubuntu app. I'm running Python version
2.7.1.
Earlier versions of Python do not contain `shutil`. It may be that this
module was available on Windows systems later than other platforms.
Upgrading my version of Python made the problem go away
I don't believe that timing was a problem since inserting a long delay
didn't fix things.
So I added some text to the error message recommending that the user
upgrade their version of Python if they run into this problem.
Reviewers: yln, DavidTruby
Subscribers: delcypher, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79861
Erik Pilkington [Wed, 13 May 2020 18:13:37 +0000 (14:13 -0400)]
[demangler] Fix demangling of enumerators with negative values
rdar://
27527445
Eli Friedman [Thu, 30 Apr 2020 20:43:58 +0000 (13:43 -0700)]
[SROA] Clean up some uses of MaybeAlign in SROA.
Use Align instead of using MaybeAlign; all the operations in question
have known alignment.
For getSliceAlign() in particular, in the cases where we used to return
None, it would be converted back to an Align by IRBuilder, so there's no
functional change there.
Split off from D77454.
Differential Revision: https://reviews.llvm.org/D79205
Kirstóf Umann [Tue, 14 Apr 2020 14:53:09 +0000 (16:53 +0200)]
[analyzer][StreamChecker] Don't make StreamTestChecker depend on StreamChecker for the time being
The comment in Checkers.td explains whats going on. As StreamChecker grows,
expect a need to have smaller checkers out of it, but let that be a worry for
later.
Differential Revision: https://reviews.llvm.org/D78120
Craig Topper [Wed, 13 May 2020 17:29:04 +0000 (10:29 -0700)]
[Statepoint] Mark FixupStatepointCallerSaved as preserving the CFG
I'm hoping this will restore some compile time lost by D75936 and D75937.
Differential Revision: https://reviews.llvm.org/D79813
Sylvain Audi [Wed, 29 Apr 2020 16:50:37 +0000 (12:50 -0400)]
[Clang] Restore replace_path_prefix instead of startswith
In D49466, sys::path::replace_path_prefix was used instead startswith for -f[macro/debug/file]-prefix-map options.
However those were reverted later (commit rG3bb24bf25767ef5bbcef958b484e7a06d8689204) due to broken Windows tests.
This patch restores those replace_path_prefix calls.
It also modifies the prefix matching to be case-insensitive under Windows.
Differential Revision : https://reviews.llvm.org/D76869
Simon Pilgrim [Wed, 13 May 2020 13:31:18 +0000 (14:31 +0100)]
[InstCombine] Add vector tests for the or(shl(zext(x),32)|zext(y)) concat combines
Lei Zhang [Fri, 8 May 2020 21:06:03 +0000 (17:06 -0400)]
[mlir][vulkan-runner] Avoid dependency on LLVM libraries
The Vulkan runtime wrapper will be compiled to a shared library
that are loaded by the JIT runner. Depending on LLVM libraries
means that LLVM symbols will be compiled into the shared library.
That can cause problems if we are using it with other shared
libraries depending on LLVM, notably Mesa, the open-source graphics
driver framework. The Vulkan API wrappers invoked by the JIT runner
links to the system libvulkan.so. If it's Mesa providing the
implementation, Mesa will normally try to load the system libLLVM.so
for its shader compilation. That causes issues because the JIT runner
already loaded the Vulkan runtime wrapper which has LLVM sybmols
compiled in. So system linker will instruct Mesa to use those symbols
instead.
Differential Revision: https://reviews.llvm.org/D79860
Stephen Neuendorffer [Wed, 13 May 2020 15:57:25 +0000 (08:57 -0700)]
[MLIR] Discourage people from copying the toy examples
The CMake structure of the toy example is non-standard. encourage people to
copy the standalone example instead.
Differential Revision: https://reviews.llvm.org/D79889
Stephen Neuendorffer [Wed, 13 May 2020 06:37:23 +0000 (23:37 -0700)]
[MLIR] refactor cmake specification of tablegen'd interfaces.
Introduce add_mlir_interface to avoid lots of boilerplate
Differential Revision: https://reviews.llvm.org/D79841
mydeveloperday [Wed, 13 May 2020 17:33:57 +0000 (18:33 +0100)]
[clang-format] : Fix additional pointer alignment for overloaded operators
Summary:
Follow on from {D78879} to handle the more obscure to prevent spaces between operators
```
operator void *&();
operator void *&&();
operator void &*();
operator void &&*();
```
Reviewers: sylvestre.ledru, sammccall, krasimir, Abpostelnicu
Reviewed By: sammccall, Abpostelnicu
Subscribers: cfe-commits
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D79201
mydeveloperday [Wed, 13 May 2020 17:27:16 +0000 (18:27 +0100)]
[clang-format] Fix AlignConsecutive on PP blocks
Summary:
Currently the 'AlignConsecutive*' options incorrectly align across
elif and else statements, even if they are very far away and across
unrelated preprocessor macros.
This failed since on preprocessor run 2+, there is not enough context
about the #ifdefs to actually differentiate one block from another,
causing them to align across different blocks or even large sections of
the file.
Eg, with AlignConsecutiveAssignments:
```
\#if FOO // Run 1
\#else // Run 1
int a = 1; // Run 2, wrong
\#endif // Run 1
\#if FOO // Run 1
\#else // Run 1
int bar = 1; // Run 2
\#endif // Run 1
```
is read as
```
int a = 1; // Run 2, wrong
int bar = 1; // Run 2
```
The approach taken to fix this was to add a new flag to Token that
forces breaking alignment across groups of lines (MustBreakAlignBefore)
in a similar manner to the existing flag that forces a line break
(MustBreakBefore). This flag is set for the first Token after a
preprocessor statement or diff conflict marker.
Fixes #25167,#31281
Patch By: JakeMerdichAMD
Reviewed By: MyDeveloperDay
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D79388
Anna Thomas [Wed, 13 May 2020 15:45:39 +0000 (11:45 -0400)]
NFC: Avoid redundant checks for vector-function-abi-variant attribute
Updated the comments on the code as well to reflect what the
preconditions on VFABI::getVectorVariantNames are.