Matt Arsenault [Sun, 9 Feb 2020 20:48:31 +0000 (15:48 -0500)]
GlobalISel: Extend narrowing to G_ASHR
Brian Gesiak [Thu, 26 Dec 2019 13:00:00 +0000 (08:00 -0500)]
[Coroutines][1/6] New pass manager: coro-early
Summary:
The first in a series of patches that ports the LLVM coroutines passes
to the new pass manager infrastructure. This patch implements
'coro-early'.
NB: All coroutines passes begin by checking that coroutine intrinsics are
declared within the LLVM IR module they're operating on. To do so, they call
`coro::declaresIntrinsics`. The next 3 patches in this series, which add new
pass manager implementations of the 'coro-split', 'coro-elide', and
'coro-cleanup' passes, use a similar pattern as the one used here: a static
function is shared across both old and new passes to detect if relevant
coroutine intrinsics are delcared. To make this pattern easier to read, this
patch adds `const` keywords to the parameters of `coro::declaresIntrinsics`.
Reviewers: GorNishanov, lewissbaker, junparser, chandlerc, deadalnix, wenlei
Reviewed By: wenlei
Subscribers: ychen, wenlei, EricWF, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71898
Jonas Devlieghere [Mon, 17 Feb 2020 18:23:43 +0000 (10:23 -0800)]
[lldb/Plugin] Fix plugin definition for ProcessWindows
This should fix the unresolved external symbol error.
John Brawn [Mon, 17 Feb 2020 16:55:32 +0000 (16:55 +0000)]
[FPEnv][ARM] Don't call mutateStrictFPToFP when lowering
mutateStrictFPToFP can delete the node and replace it with another with the same
value which can later cause problems, and returning the result of
mutateStrictFPToFP doesn't work because SelectionDAGLegalize expects that the
returned value has the same number of results as the original. Instead handle
things by doing the mutation manually.
Differential Revision: https://reviews.llvm.org/D74726
Nikita Popov [Sun, 16 Feb 2020 16:10:09 +0000 (17:10 +0100)]
Reapply "[IRBuilder] Virtualize IRBuilder"
Relative to the original commit, this fixes some warnings,
and is based on the deletion of the IRBuilder copy constructor
in D74693. The automatic copy constructor would no longer be
safe.
-----
Related llvm-dev thread:
http://lists.llvm.org/pipermail/llvm-dev/2020-February/138951.html
This patch moves the IRBuilder from templating over the constant
folder and inserter towards making both of these virtual.
There are a couple of motivations for this:
1. It's not possible to share code between use-sites that use
different IRBuilder folders/inserters (short of templating the code
and moving it into headers).
2. Methods currently defined on IRBuilderBase (which is not templated)
do not use the custom inserter, resulting in subtle bugs (e.g.
incorrect InstCombine worklist management). It would be possible to
move those into the templated IRBuilder, but...
3. The vast majority of the IRBuilder implementation has to live
in the header, because it depends on the template arguments.
4. We have many unnecessary dependencies on IRBuilder.h,
because it is not easy to forward-declare. (Significant parts of
the backend depend on it via TargetLowering.h, for example.)
This patch addresses the issue by making the following changes:
* IRBuilderDefaultInserter::InsertHelper becomes virtual.
IRBuilderBase accepts a reference to it.
* IRBuilderFolder is introduced as a virtual base class. It is
implemented by ConstantFolder (default), NoFolder and TargetFolder.
IRBuilderBase has a reference to this as well.
* All the logic is moved from IRBuilder to IRBuilderBase. This means
that methods can in the future replace their IRBuilder<> & uses
(or other specific IRBuilder types) with IRBuilderBase & and thus
be usable with different IRBuilders.
* The IRBuilder class is now a thin wrapper around IRBuilderBase.
Essentially it only stores the folder and inserter and takes care
of constructing the base builder.
What this patch doesn't do, but should be simple followups after this change:
* Fixing use of the inserter for creation methods originally defined
on IRBuilderBase.
* Replacing IRBuilder<> uses in arguments with IRBuilderBase, where useful.
* Moving code from the IRBuilder header to the source file.
From the user perspective, these changes should be mostly transparent:
The only thing that consumers using a custom inserted may need to do is
inherit from IRBuilderDefaultInserter publicly and mark their InsertHelper
as public.
Differential Revision: https://reviews.llvm.org/D73835
Nikita Popov [Mon, 17 Feb 2020 18:01:18 +0000 (19:01 +0100)]
[Polly] Fix build after IRBuilder changes
Simply dropping the createPollyIRBuilder() function here, because
it doesn't do much. Also directly initialize Expander in
ScopExpander instead of going through the copy-constructor.
Brian Gesiak [Tue, 4 Feb 2020 03:50:39 +0000 (22:50 -0500)]
Add LazyCallGraph API to add function to RefSCC
Summary:
Depends on https://reviews.llvm.org/D70927.
`LazyCallGraph::addNewFunctionIntoSCC` allows users to insert a new
function node into a call graph, into a specific, existing SCC.
Extend this interface such that functions can be added even when they do
not belong in any existing SCC, but instead in a new SCC within an
existing RefSCC.
The ability to insert new functions as part of a RefSCC is necessary for
outlined functions that do not form a strongly connected cycle with the
function they are outlined from. An example of such a function would be the
coroutine funclets 'f.resume', etc., which are outlined from a coroutine 'f'.
Coroutine 'f' only references the funclets' addresses, it does not call
them directly.
Reviewers: jdoerfert, chandlerc, wenlei, hfinkel
Reviewed By: jdoerfert
Subscribers: hfinkel, JonChesterfield, mehdi_amini, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72226
Mikhail Maltsev [Mon, 17 Feb 2020 17:47:05 +0000 (17:47 +0000)]
[ARM,MVE] Add vector-scalar intrinsics
Summary:
This patch adds vector-scalar variants to the following families of
MVE intrinsics:
* vaddq
* vsubq
* vmulq
* vqaddq
* vqsubq
* vhaddq
* vhsubq
* vqdmulhq
* vqrdmulhq
The vector-scalar variants perform a splat operation on the scalar
operand and then perform the same operations as their vector-vector
counterparts. Code generation is done accordingly (using LLVM IR 'insert'
and 'shuffle' operations which are later converted into an ARMvdup
SDNode).
Reviewers: simon_tatham, dmgreen, MarkMurrayARM, ostannard
Reviewed By: dmgreen
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74620
Matt Arsenault [Mon, 17 Feb 2020 17:08:39 +0000 (12:08 -0500)]
GlobalISel: Fix missing const
Nikita Popov [Sun, 16 Feb 2020 16:46:26 +0000 (17:46 +0100)]
[IRBuilder] Delete copy constructor
D73835 will make IRBuilder no longer trivially copyable. This patch
deletes the copy constructor in advance, to separate out the breakage.
Currently, the IRBuilder copy constructor is usually used by accident,
not by intention. In rG7c362b25d7a9 I've fixed a number of cases where
functions accepted IRBuilder rather than IRBuilder &, thus performing
an unnecessary copy. In rG5f7b92b1b4d6 I've fixed cases where an
IRBuilder was copied, while an InsertPointGuard should have been used
instead.
The only non-trivial use of the copy constructor is the
getIRBForDbgInsertion() helper, for which I separated construction and
setting of the insertion point in this patch.
Differential Revision: https://reviews.llvm.org/D74693
Nikita Popov [Mon, 17 Feb 2020 16:15:06 +0000 (17:15 +0100)]
[IRBuilder] Avoid passing IRBuilder by value; NFC
I've fixed most of these before, but missed some occurrences
in targets I don't usually build.
Matt Arsenault [Sun, 9 Feb 2020 16:24:39 +0000 (11:24 -0500)]
GlobalISel: Extend shift narrowing to G_SHL
Jonas Devlieghere [Mon, 17 Feb 2020 17:02:29 +0000 (09:02 -0800)]
[lldb/CMake] Auto-generate the Initialize and Terminate calls for plugin
This patch changes the way we initialize and terminate the plugins in
the system initializer. It uses an approach similar to LLVM's
TARGETS_TO_BUILD with a def file that enumerates the plugins.
Differential revision: https://reviews.llvm.org/D73067
Jonas Devlieghere [Mon, 17 Feb 2020 17:06:18 +0000 (09:06 -0800)]
[lldb] Fix Windows bot.
Should fix error C2039: 'toupper': is not a member of 'std'.
Raphael Isemann [Mon, 17 Feb 2020 16:59:08 +0000 (17:59 +0100)]
Revert "[libc++] Move abs and div into stdlib.h to fix header cycle."
This reverts commit
82b47b2978405f802a33b00d046e6f18ef6a47be.
This broke Clang and LLDB module builds without -fmodules-local-submodule-visbility.
I'll revert this for now until we have a fix and reland once Clang
can properly handle this code.
See also the discussion in https://reviews.llvm.org/rG82b47b2978405f802a33b00d046e6f18ef6a47be
Benjamin Kramer [Mon, 17 Feb 2020 16:55:03 +0000 (17:55 +0100)]
Hide implementation details. NFC>
Gokturk Yuksek [Mon, 17 Feb 2020 16:38:59 +0000 (16:38 +0000)]
Reland "[clang-tools-extra] fix the check for if '-latomic' is necessary""
The buildbot failures on MSVC should have been fixed by
f128f442a3d.
Matt Arsenault [Mon, 23 Dec 2019 22:34:59 +0000 (17:34 -0500)]
AMDGPU/GlobalISel: Skip DAG hack passes on selected functions
The way fallback to SelectionDAG works is somewhat surprising to
me. When the fallback path is enabled, the entire set of SelectionDAG
selector passes is added to the pass pipeline, and each one needs to
check if the function was selected. This results in the surprising
behavior of running SIFixSGPRCopies for example, but only if
-global-isel-abort=2 is used.
SIAddIMGInitPass is also added in addInstSelector, but I'm not sure
why we have this pass or if it should be added somewhere else for
GlobalISel.
Simon Pilgrim [Mon, 17 Feb 2020 13:38:20 +0000 (13:38 +0000)]
[SelectionDAG] Expose the "getValidShiftAmount" helpers available. NFCI.
These are going to be useful in TargetLowering::SimplifyDemandedBits, so expose these helpers outside of SelectionDAG.cpp
Also add an getValidShiftAmountConstant early-out to getValidMinimumShiftAmountConstant/getValidMaximumShiftAmountConstant so we can use them for scalar cases as well.
Matt Arsenault [Sun, 9 Feb 2020 05:18:04 +0000 (00:18 -0500)]
GlobalISel: Add combine to narrow G_LSHR
Produce an unmerge to a narrower type and introduce a narrower shift
if needed. I wasn't sure if there was a better way to parameterize the
target's preferred shift type for the GICombineRule, so manually call
the combine helper.
Matt Arsenault [Thu, 30 Jan 2020 01:34:32 +0000 (20:34 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.s.buffer.load
Doesn't try to fail on the dlc bit pre-gfx10 like the DAG lowering
does.
Haojian Wu [Wed, 12 Feb 2020 13:42:18 +0000 (14:42 +0100)]
[clang][Index] Visit the default parameter arguements in libindex.
Summary:
We are missing the default parmeter arguments when IndexFunctionLocals
is true.
Fixes https://github.com/clangd/clangd/issues/285.
Reviewers: kadircet
Subscribers: kristof.beyls, ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74610
Mikhail Maltsev [Mon, 17 Feb 2020 15:37:49 +0000 (15:37 +0000)]
[ARM] Add initial support for Custom Datapath Extension (CDE)
Summary:
This patch adds assembly-level support for a new Arm M-profile
architecture extension, Custom Datapath Extension (CDE).
A brief description of the extension is available at
https://developer.arm.com/architectures/instruction-sets/custom-instructions
The latest specification for CDE is currently a beta release and is
available at
https://static.docs.arm.com/ddi0607/aa/DDI0607A_a_armv8m_arm_supplement_cde.pdf
CDE allows chip vendors to add custom CPU instructions. The CDE
instructions re-use the same encoding space as existing coprocessor
instructions (such as MRC, MCR, CDP etc.). Each coprocessor in range
cp0-cp7 can be configured as either general purpose (GCP) or custom
datapath (CDEv1). This configuration is defined by the CPU vendor and
is provided to LLVM using 8 subtarget features: cdecp0 ... cdecp7.
The semantics of CDE instructions are implementation-defined, but the
instructions are guaranteed to be pure (that is, they are stateless,
they do not access memory or any registers except their explicit
inputs/outputs).
CDE requires the CPU to support at least Armv8.0-M mainline
architecture. CDE includes 3 sets of instructions:
* Instructions that operate on general purpose registers and NZCV
flags
* Instructions that operate on the S or D register file (require
either FP or MVE extension)
* Instructions that operate on the Q register file, require MVE
The user-facing names that can be specified on the command line are
the same as the 8 subtarget feature names. For example:
$ clang -target arm-none-none-eabi -march=armv8m.main+cdecp0+cdecp3
tells the compiler that the coprocessors 0 and 3 are configured as
CDEv1 and the remaining coprocessors are configured as GCP (which is
the default).
Reviewers: simon_tatham, ostannard, dmgreen, eli.friedman
Reviewed By: simon_tatham
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D74044
Matt Arsenault [Mon, 10 Feb 2020 00:42:57 +0000 (19:42 -0500)]
AMDGPU/GlobalISel: Run the localizer pass
While looking at the output on real sized programs, there is a lot of
extra SGPR spilling compared to the DAG path. This seems to largely be
from all constants being SGPRs in the entry block.
Jan Kratochvil [Mon, 17 Feb 2020 15:31:25 +0000 (16:31 +0100)]
Separate DIERef vs. user_id_t: m_function_scope_qualified_name_map
As discussed in https://reviews.llvm.org/D73206#1871895 there is both
`DIERef` and `user_id_t` and sometimes (for DWZ) we need to encode Main
CU into them and sometimes we cannot as it is unavailable at that point
and at the same time not even needed.
I have also noticed `DIERef` and `user_id_t` in fact contain the same
information which can be seen in SymbolFileDWARF::GetUID.
SB* API/ABI is already using `user_id_t` and it needs to encode Main CU
for DWZ. Therefore what about making `DIERef` the identifier not
containing Main CU and `user_id_t` the identifier containing Main CU?
It is sort of a revert of D63322.
I find this patch as a NFC cleanup to the codebase - to satisfy a new
premise `user_id_t` is used as little as possible and thus only for
external interfaces which must not deal with MainCU in any way.
Its larger goal is to satisfy a plan to implement DWZ support.
Differential Revision: https://reviews.llvm.org/D74637
Luís Marques [Mon, 17 Feb 2020 15:21:41 +0000 (15:21 +0000)]
[CMake] Fix setting result of libatomic check for MSVC
We were skipping the libatomic requirement check for MSVC, but not setting
the corresponding variable, HAVE_CXX_ATOMICS_WITHOUT_LIB. D69869 seems to
have to failed to build on ARM MSVC because of that, and was reverted. This
should probably fix the issue. The plan is to check the result of the build
bots and then submit a more thoroughly refactored version for review.
Sander de Smalen [Mon, 17 Feb 2020 14:27:27 +0000 (14:27 +0000)]
[AArch64] Implement passing SVE vectors by ref for AAPCS.
Summary:
This patch implements the part of the calling convention
where SVE Vectors are passed by reference. This means the
caller must allocate stack space for these objects and
pass the address to the callee.
Reviewers: efriedma, rovka, cameron.mcinally, c-rhodes, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71216
Pierre Oechsel [Mon, 17 Feb 2020 14:56:08 +0000 (15:56 +0100)]
[mlir] Linalg: Extend promotion to non f32 buffers.
Summary:
Linalg's promotion pass was only supporting f32 buffers due to how the
zero value was build for the `fill` operation.
Moreover, `promoteSubViewOperands` was returning a vector with one entry
per float subview while omitting integer subviews. For a program
with only integer subviews the return vector would be of size 0.
However, `promoteSubViewsOperands` would try to access a non zero
number of entries of this vector, resulting in a sefgault.
Reviewers: nicolasvasilache, ftynse
Reviewed By: ftynse
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/D74532
Sjoerd Meijer [Mon, 17 Feb 2020 14:49:58 +0000 (14:49 +0000)]
[DAGCombine] Combine pattern for REV16
This adds another pattern to the combiner for a case that we were not handling
to generate the REV16 instruction for ARM/Thumb2 and a bswap+ror on X86.
Differential Revision: https://reviews.llvm.org/D74032
Benjamin Kramer [Mon, 17 Feb 2020 14:49:49 +0000 (15:49 +0100)]
Benjamin Kramer [Mon, 17 Feb 2020 14:37:12 +0000 (15:37 +0100)]
Strength reduce vectors into arrays. NFCI.
Louis Dionne [Fri, 14 Feb 2020 14:19:47 +0000 (15:19 +0100)]
[libc++] Add availability markup for std::to_chars on Apple platforms
Summary:
Otherwise, one gets link errors when trying to back-deploy to older platforms.
rdar://problem/
57854364
Reviewers: lichray, EricWF
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D74626
Matt Arsenault [Sun, 16 Feb 2020 00:18:47 +0000 (19:18 -0500)]
AMDGPU/GlobalISel: Select v2s32->v2s16 G_TRUNC
It would be nice if there was a way to avoid the tied operand, but as
far as I can tell there isn't a way to use or with op_sel to achieve
this
Matt Arsenault [Mon, 10 Feb 2020 23:06:17 +0000 (18:06 -0500)]
AMDGPU/GlobalISel: Handle sbfe/ubfe intrinsic
Try to handle arbitrary scalar BFEs by packing the operands. The DAG
gives up on non-constant arguments. We're still missing any constant
folding, so we end up with pretty ugly code most of the time. Also
handle the 64-bit scalar case, which the DAG doesn't try to do.
Matt Arsenault [Sat, 15 Feb 2020 21:46:04 +0000 (16:46 -0500)]
GlobalISel: Add matcher for G_LSHR
Tim Renouf [Thu, 13 Feb 2020 11:44:52 +0000 (11:44 +0000)]
[AMDGPU] Fix some tests that did not specify -mcpu
Summary:
This fixes some tests that did not specify -mcpu. Doing that disables
all subtarget features, which gives behavior that (a) does not
necessarily correspond to any actual target, and (b) can change as we
add new subtarget features.
Also added gfx1010 to memtime test.
Differential Revision: https://reviews.llvm.org/D74594
Change-Id: I8c0fe4fa03e9a93ef8bb722cd42d22e064526309
Benjamin Kramer [Mon, 17 Feb 2020 13:38:11 +0000 (14:38 +0100)]
[ADT] Use inherited ctors to forward to base. NFCI.
Balázs Kéri [Mon, 17 Feb 2020 13:25:16 +0000 (14:25 +0100)]
[ASTImporter] Added visibility check for scoped enums.
Summary:
ASTImporter makes now difference between C++11 scoped enums with same
name in different translation units if these are not visible outside.
Enum declarations are linked into decl chain correctly.
Reviewers: martong, a.sidorin, shafik, a_sidorin, teemperor
Reviewed By: shafik, a_sidorin
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, teemperor, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74554
Pavel Labath [Mon, 17 Feb 2020 13:12:29 +0000 (14:12 +0100)]
[lldb] Fix build error from
07355c1c08b
The error is: no matching function for call to 'transform(std::string&, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
The fix: replace llvm::transform with an equally simple hand-rolled
loop.
Pavel Labath [Wed, 29 Jan 2020 11:00:29 +0000 (12:00 +0100)]
[lldb/DWARF] Re-enable basic dwp support
Summary:
This patch removes the bitrotted SymbolFileDWARF(Dwo)Dwp classes, and
replaces them with dwp support implemented directly inside
SymbolFileDWARFDwo, in a manner mirroring the implementation in llvm.
This patch does:
- add support for the .debug_cu_index section to our DWARFContext
- adds a llvm::DWARFUnitIndex argument to the DWARFUnit constructors.
This argument is used to look up the offsets of the debug_info and
debug_abbrev contributions in the sections of the dwp file.
- makes sure the creation of the DebugInfo object as well as the initial
discovery of DWARFUnits is thread-safe, as we can now call this
concurrently when doing parallel indexing.
This patch does not:
- use the DWARFUnitIndex to search for other kinds of contributions
(debug_loc, debug_ranges, etc.). This means that units which reference
these sections will not work correctly. These will be handled by
follow-up patches, but even the present level of support is sufficient
to enable basic functionality.
- Make the llvm::DWARFContext thread-safe. Right now, it just avoids this
problem by ensuring everything is initialized ahead of time. However,
this is something we will run into more often as we try to use more of
llvm, and so I plan to start looking into our options here.
Reviewers: JDevlieghere, aprantl, clayborg
Subscribers: mgorny, mgrang, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73783
Sergej Jaskiewicz [Mon, 17 Feb 2020 13:06:30 +0000 (16:06 +0300)]
Revert "[CMake] Explicitly specify paths to libc++abi in CrossWinToARMLinux.cmake"
This reverts commit
801627ee490e1106380184256503dbd520c5f802.
Pavel Labath [Mon, 3 Feb 2020 16:58:37 +0000 (17:58 +0100)]
[lldb] Delete register info definitions in the x86_64 ABI classes
Summary:
These definitions are used to "augment" information received from the remote
target with eh/debug frame and "generic" register numbers.
Besides being verbose, this information was also incomplete (new registers like
xmm16-31 were missing) and sometimes even downright wrong (ymm register
numbers).
Most of this information is available via llvm's MCRegisterInfo. This patch
creates a new class, MCBasedABI, which retrieves the eh and debug frame register
numbers this way. The tricky part here is that the llvm class uses all-caps
register names, whereas lldb register are lowercase, and sometimes called
slightly differently. Therefore this class introduces some hooks to allow a
subclass to customize the MC lookup. The subclass also needs to suply the
"generic" register numbers, as this is an lldb invention.
This patch ports the x86_64 ABI classes to use the new register info mechanism.
It also creates a new "ABIx86_64" class which can be used to house code common
to x86_64 both ABIs. Right now, this just consists of a single function, but
there are plenty of other things that could be moved here too.
Reviewers: JDevlieghere, jasonmolenda
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74244
Sergej Jaskiewicz [Mon, 17 Feb 2020 12:22:18 +0000 (15:22 +0300)]
[CMake] Explicitly specify paths to libc++abi in CrossWinToARMLinux.cmake
Summary:
D69169, which was necessary for running libc++ tests on remote host, got reverted. I couldn't think of a less invasive way to achieve this behavior but specify libc++abi paths in our cache file.
Reviewers: vvereschaka, aorlov, andreil99, EricWF
Reviewed By: vvereschaka
Subscribers: mgorny, kristof.beyls, ldionne, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74347
Martin Storsjö [Mon, 17 Feb 2020 12:15:53 +0000 (14:15 +0200)]
[LLDB] Fix GCC warnings about extra semicolons. NFC.
Pavel Labath [Mon, 17 Feb 2020 12:09:47 +0000 (13:09 +0100)]
[lldb] Add @skipIfXmlSupportMissing to TestWasm.py
These tests rely on being able to parse qXfer:libraries:read packet
(which is in xml).
David Green [Mon, 17 Feb 2020 11:41:16 +0000 (11:41 +0000)]
[ARM] MVE vector reduce MLA tests. NFC.
Paolo Severini [Mon, 17 Feb 2020 11:42:23 +0000 (12:42 +0100)]
[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging
Add a dynamic loader plug-in class for WebAssembly modules.
Differential Revision: https://reviews.llvm.org/D72751
Levon Ter-Grigoryan [Mon, 17 Feb 2020 10:55:55 +0000 (11:55 +0100)]
[lldb/lldb-server] Add target.xml support for qXfer request.
Summary:
Synthesize target.xml in lldb-server to avoid a long chain of
qRegisterInfo packets, which can be slow over low-latency links.
Reviewers: jarin, labath
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74217
Kerry McLaughlin [Mon, 17 Feb 2020 10:11:42 +0000 (10:11 +0000)]
[AArch64][SVE] Add SVE index intrinsic
Summary:
Implements the @llvm.aarch64.sve.index intrinsic, which
takes a scalar base and step value.
This patch also adds the printSImm function to AArch64InstPrinter
to ensure that immediates of type i8 & i16 are printed correctly.
Reviewers: sdesmalen, andwar, efriedma, dancgr, cameron.mcinally, rengolin
Reviewed By: cameron.mcinally
Subscribers: tatyana-krasnukha, tschuett, kristof.beyls, hiraditya, rkruppe, arphaman, psnobl, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74550
Sjoerd Meijer [Mon, 17 Feb 2020 10:13:47 +0000 (10:13 +0000)]
[AArch64] Fix small typos in the target description. NFC.
Patch by Tamas Petz.
Differential Revision: https://reviews.llvm.org/D74603
Simon Tatham [Mon, 17 Feb 2020 09:11:35 +0000 (09:11 +0000)]
[TableGen] Don't elide bitconverts in PatFrag fragments.
Summary:
In the DAG pattern backend, `SimplifyTree` simplifies a pattern by
removing bitconverts between two identical types. But that function is
also run on the fragments list in instances of `PatFrags`, in which
the types haven't been specified yet. So the input and output of the
bitconvert always evaluate to the empty set of types, which makes them
compare equal. So the test always passes, and bitconverts are
unconditionally removed from the PatFrag RHS.
Fixed by spotting the empty type set and using it to inhibit the
optimization.
Reviewers: nhaehnle, hfinkel
Reviewed By: nhaehnle
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74627
Jan Kratochvil [Mon, 17 Feb 2020 09:24:19 +0000 (10:24 +0100)]
[lldb] [nfc] Simplify user_id_t -> size_t
As discussed in https://reviews.llvm.org/D73206#1871895> simplifying
usage of `user_id_t`.
There is even written:
// The compile unit ID is the index of the DWARF unit.
DWARFUnit *dwarf_cu = info->GetUnitAtIndex(comp_unit->GetID());
Differential Revision: https://reviews.llvm.org/D74670
Sourabh Singh Tomar [Mon, 17 Feb 2020 09:18:25 +0000 (14:48 +0530)]
[NFCI][DebugInfo]: Corrected a Typo.
Sjoerd Meijer [Mon, 17 Feb 2020 09:13:21 +0000 (09:13 +0000)]
[X86] New test to check rev16 patterns, prep step for D74032. NFC.
Sylvestre Ledru [Mon, 17 Feb 2020 09:02:11 +0000 (10:02 +0100)]
clang analyzer: Fix the webpage rendering
Raphael Isemann [Mon, 17 Feb 2020 08:39:06 +0000 (09:39 +0100)]
[lldb] Fix some tests failing with gmodules after change to stdlib.h
Commit
82b47b2978405f802a33b00d046e6f18ef6a47be changes the way the stdlib.h
header is structured which seems to cause strange lookup failures in the modules
build. This updates a few failing tests so that they pass with the new
behavior of stdlib.h.
See the discussion in https://reviews.llvm.org/rG82b47b2978405f802a33b00d046e6f18ef6a47be
Kang Zhang [Mon, 17 Feb 2020 08:34:56 +0000 (08:34 +0000)]
[NFC][PowerPC] Update the test case scalar-equal.ll
Modify the command option to add --enable-no-nans-fp-math
Fangrui Song [Mon, 17 Feb 2020 06:34:42 +0000 (22:34 -0800)]
[MC] Delete two unused MCCodePadder functions missed by D71106
QingShan Zhang [Mon, 17 Feb 2020 05:42:49 +0000 (05:42 +0000)]
[PowerPC] Add the missing InstrAliasing for 64-bit rotate instructions
We have the InstAlias rules for 32-bit rotate but missing the 64-bit one.
Rotate left immediate rotlwi ra,rs,n rlwinm ra,rs,n,0,31
Rotate left rotlw ra,rs,rb rlwnm ra,rs,rb,0,31
Differential Revision: https://reviews.llvm.org/D72676
Kang Zhang [Mon, 17 Feb 2020 05:27:36 +0000 (05:27 +0000)]
[NFC][PowerPC] Add a new test case scalar-equal.ll
Michael Liao [Mon, 17 Feb 2020 05:18:01 +0000 (00:18 -0500)]
Fix `-Wpedantic` warning. NFC.
River Riddle [Mon, 17 Feb 2020 05:06:56 +0000 (21:06 -0800)]
[mlir] Address post commit feedback of D73590 for SymbolsAndSymbolTables.md
Craig Topper [Mon, 17 Feb 2020 04:52:18 +0000 (20:52 -0800)]
[X86] Disable load folding for X86ISD::ADD with 128 as an immediate.
It can be turned into a sub with -128 instead as long as the
carry flag isn't used.
Fangrui Song [Mon, 17 Feb 2020 04:33:07 +0000 (20:33 -0800)]
[CUDA][HIP][OpenMP] Add lib/Sema/UsedDeclVisitor.h after D70172
Craig Topper [Mon, 17 Feb 2020 04:24:20 +0000 (20:24 -0800)]
[X86] Remove unnecessary check for null SDValue. NFC
Matt Arsenault [Sun, 16 Feb 2020 03:09:23 +0000 (22:09 -0500)]
AMDGPU/GlobalISel: Fix non-power-of-2 G_SITOFP/G_UITOFP
This wouldn't work for s33-s63 sources.
Matt Arsenault [Sun, 16 Feb 2020 03:13:29 +0000 (22:13 -0500)]
AMDGPU/GlobalISel: Add some missing tests for non-power-of-2 cases
Matt Arsenault [Sun, 16 Feb 2020 03:24:17 +0000 (22:24 -0500)]
AMDGPU/GlobalISel: Move lambdas to normal function
These aren't using any local state
Yaxun (Sam) Liu [Mon, 17 Feb 2020 02:38:03 +0000 (21:38 -0500)]
[CUDA][HIP][OpenMP] Emit deferred diagnostics by a post-parsing AST travese
This patch removes the explicit call graph for CUDA/HIP/OpenMP deferred
diagnostics generated during parsing since it is error prone due to
incomplete information about function declarations during parsing. In stead,
this patch does a post-parsing AST traverse and emits deferred diagnostics
based on the use graph implicitly generated during the traverse.
Differential Revision: https://reviews.llvm.org/D70172
Nico Weber [Mon, 17 Feb 2020 02:29:37 +0000 (21:29 -0500)]
[gn build] use -Xclang form for fdebug-comp-dir for now
The driver version of the flag seems to confuse goma.
Zheng Chen [Fri, 14 Feb 2020 06:42:43 +0000 (01:42 -0500)]
[Powerpc] set instruction count as lsr first priority of lsr.
On Powerpc, set instruction count as lsr first priority of lsr by default.
Add an option ppc-lsr-no-insns-cost to return back to default lsr cost model.
Reviewed By: steven.zhang, jsji
Differential Revision: https://reviews.llvm.org/D72683
Yaxun (Sam) Liu [Wed, 29 Jan 2020 19:11:37 +0000 (14:11 -0500)]
[OpenCL][CUDA][HIP][SYCL] Add norecurse
norecurse function attr indicates the function is not called recursively
directly or indirectly.
Add norecurse to OpenCL functions, SYCL functions in device compilation
and CUDA/HIP kernels.
Although there is LLVM pass adding norecurse to functions, it only works
for whole-program compilation. Also FE adding norecurse can make that
pass run faster since functions with norecurse do not need to be checked
again.
Differential Revision: https://reviews.llvm.org/D73651
Craig Topper [Sun, 16 Feb 2020 23:59:50 +0000 (15:59 -0800)]
[X86] Increase latency of port5 masked compares and kshift/kadd/kunpck instructions in SKX scheduler model
Uops.info shows these as 4 cycle latency.
Craig Topper [Sun, 16 Feb 2020 19:40:30 +0000 (11:40 -0800)]
[X86] Add more avx512 instrutions to llvm-mca resource tests
Pierre Habouzit [Fri, 31 Jan 2020 00:48:11 +0000 (16:48 -0800)]
[objc_direct] Small updates to help with adoption.
Add fixits for messaging self in MRR or using super, as the intent is
clear, and it turns out people do that a lot more than expected.
Allow for objc_direct_members on main interfaces, it's extremely useful
for internal only classes, and proves to be quite annoying for adoption.
Add some better warnings around properties direct/non-direct clashes (it
was done for methods but properties were a miss).
Add some errors when direct properties are marked @dynamic.
Radar-Id: rdar://problem/
58355212
Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
Differential Revision: https://reviews.llvm.org/D73755
Fangrui Song [Sun, 16 Feb 2020 20:59:10 +0000 (12:59 -0800)]
[IR] Change maybeSetDSOLocal to isImplicitDSOLocal
This allows some simplification.
Florian Hahn [Sun, 16 Feb 2020 19:33:21 +0000 (20:33 +0100)]
[SCCP] Re-generate check lines using --function-signature. (NFC)
Craig Topper [Sun, 16 Feb 2020 07:15:52 +0000 (23:15 -0800)]
[X86] Separate floating point handling out of EmitCmp and emitFlagsForSetcc.
Both of those functions only have a single caller starting
at LowerSETCC. Just handle floating point directly in LowerSETCC.
This removes the need to pass Chain and IsSignaling all the way
down.
Craig Topper [Sat, 15 Feb 2020 23:20:03 +0000 (15:20 -0800)]
[X86] Split X86ISD::CMP into an integer and FP opcode.
Mark de Wever [Sun, 16 Feb 2020 17:34:26 +0000 (18:34 +0100)]
[Sema] Fix pointer-to-int-cast for MSVC build bot
Revision
9658d895c81a breaks the clang-x64-windows-msvc build bot [1].
This should fix the unit test using the same method as used in
9658d895c81a.
Note I don't have access to a Windows system so the patch is based on the
errors generated by the bot.
[1] http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/14358
Differential Revision: https://reviews.llvm.org/D74694
marshall [Sun, 16 Feb 2020 17:55:50 +0000 (18:55 +0100)]
Update last-mod date for libcxx status page
marshall [Sun, 16 Feb 2020 17:54:06 +0000 (18:54 +0100)]
Updated with list of papers and issues adopted in Prague
LLVM GN Syncbot [Sun, 16 Feb 2020 17:32:06 +0000 (17:32 +0000)]
[gn build] Port
ee2c0f76d74
Eric Astor [Sun, 16 Feb 2020 17:29:51 +0000 (12:29 -0500)]
[ms] [llvm-ml] Add a draft MASM parser
Summary:
Many directives are unavailable, and support for others may be limited.
This first draft has preliminary support for:
- conditional directives (including errors),
- data allocation (unsigned types up to 8 bytes, and ALIGN),
- equates/variables (numeric and text),
- and procedure directives (without parameters),
as well as COMMENT, ECHO, INCLUDE, INCLUDELIB, PUBLIC, and EXTERN. Text variables (aka text macros) are expanded in-place wherever the identifier occurs.
We deliberately ignore all ml.exe processor directives.
Prominent features not yet supported:
- structs
- macros (both procedures and functions)
- procedures (with specified parameters)
- substitution & expansion operators
Conditional directives are complicated by the fact that "ifdef rax" is a valid way to check if a file is being assembled for a 64-bit x86 processor; we add support for "ifdef <register>" in general, which requires adding a tryParseRegister method to all MCTargetAsmParsers. (Some targets require backtracking in the non-register case.)
Reviewers: rnk, thakis
Reviewed By: thakis
Subscribers: kerbowa, merge_guards_bot, wuzish, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, mgorny, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72680
Nikita Popov [Sun, 16 Feb 2020 17:02:29 +0000 (18:02 +0100)]
[IRBuilder] Prefer InsertPointGuard over full copy; NFC
Don't copy the IRBuilder when an InsertPointGuard would also do.
Nikita Popov [Sun, 16 Feb 2020 16:57:18 +0000 (17:57 +0100)]
[IRBuilder] Fix unnecessary IRBuilder copies; NFC
Fix a few cases where an IRBuilder is passed to a helper function
by value, while a by reference pass was intended.
Simon Pilgrim [Sun, 16 Feb 2020 13:54:17 +0000 (13:54 +0000)]
[X86] combineX86ShuffleChain - add support for combining 512-bit shuffles to PALIGNR
Simon Pilgrim [Sun, 16 Feb 2020 13:09:16 +0000 (13:09 +0000)]
[X86] combineX86ShuffleChain - add support for combining 512-bit shuffles to bit shifts
Nikita Popov [Sun, 16 Feb 2020 15:59:15 +0000 (16:59 +0100)]
Revert "[IRBuilder] Virtualize IRBuilder"
This reverts commit
0765d3824d069f37596bc5a890399099b776c2a0.
This reverts commit
1b04866a3db9f816a559860f941da067fe1eccf1.
Relevant looking crashes observed on:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win
Sanjay Patel [Sun, 16 Feb 2020 15:40:28 +0000 (10:40 -0500)]
[VectorCombine] fix cost calc for extract-cmp
getOperationCost() is not the cost we wanted; that's not the
throughput value that the rest of the calculation uses.
We may want to switch everything in this code to use the
getInstructionThroughput() wrapper to avoid these kinds of
problems, but I'll look at that as a follow-up because that
can create other logical diffs via using optional parameters
(we'd need to speculatively create the vector instruction to
make a fair(er) comparison).
Sanjay Patel [Sun, 16 Feb 2020 15:32:56 +0000 (10:32 -0500)]
[x86] form broadcast of scalar memop even with >1 use
The unseen logic diff occurs because MayFoldLoad() is defined like this:
static bool MayFoldLoad(SDValue Op) {
return Op.hasOneUse() && ISD::isNormalLoad(Op.getNode());
}
The test diffs here all seem ok to me on screen/paper, but it's hard to know
if that will lead to universally better perf for all targets. For example,
if a target implements broadcast from mem as multiple uops, we would have to
weigh the potential reduction of instructions and register pressure vs.
possible increase in number of uops. I don't know if we can make a truly
informed decision on this at compile-time.
The motivating case that I'm looking at in PR42024:
https://bugs.llvm.org/show_bug.cgi?id=42024
...resembles the diff in extract-concat.ll, but we're not going to change the
larger example there without at least 1 other fix.
Differential Revision: https://reviews.llvm.org/D74088
Nikita Popov [Sun, 16 Feb 2020 09:15:53 +0000 (10:15 +0100)]
[InstCombine] Create new log2 intrinsic; NFCI
Rather than mixing creation of new instructions and in-place
modification here, create a new log2 intrinsic. This should be
NFC apart from worklist order changes.
Nikita Popov [Sun, 16 Feb 2020 09:51:11 +0000 (10:51 +0100)]
[InstCombine] Add multiuse tests for cttz transform; NFC
These show incorrect duplication of instructions.
Mark de Wever [Sun, 16 Feb 2020 14:01:25 +0000 (15:01 +0100)]
[Sema] Adds the pointer-to-int-cast diagnostic
Converting a pointer to an integer whose result cannot represented in the
integer type is undefined behavior is C and prohibited in C++. C++ already
has a diagnostic when casting. This adds a diagnostic for C.
Since this diagnostic uses the range of the conversion it also modifies
int-to-pointer-cast diagnostic to use a range.
Fixes PR8718: No warning on casting between pointer and non-pointer-sized int
Differential Revision: https://reviews.llvm.org/D72231
Nikita Popov [Sun, 16 Feb 2020 14:21:21 +0000 (15:21 +0100)]
[IRBuilder] Try to fix warnings
Try to fix -Wnon-virtual-dtor warnings that cause build failure
on clang-pcc64le-rhel.
Nikita Popov [Sat, 1 Feb 2020 17:23:36 +0000 (18:23 +0100)]
[IRBuilder] Virtualize IRBuilder
Related llvm-dev thread:
http://lists.llvm.org/pipermail/llvm-dev/2020-February/138951.html
This patch moves the IRBuilder from templating over the constant
folder and inserter towards making both of these virtual.
There are a couple of motivations for this:
1. It's not possible to share code between use-sites that use
different IRBuilder folders/inserters (short of templating the code
and moving it into headers).
2. Methods currently defined on IRBuilderBase (which is not templated)
do not use the custom inserter, resulting in subtle bugs (e.g.
incorrect InstCombine worklist management). It would be possible to
move those into the templated IRBuilder, but...
3. The vast majority of the IRBuilder implementation has to live
in the header, because it depends on the template arguments.
4. We have many unnecessary dependencies on IRBuilder.h,
because it is not easy to forward-declare. (Significant parts of
the backend depend on it via TargetLowering.h, for example.)
This patch addresses the issue by making the following changes:
* IRBuilderDefaultInserter::InsertHelper becomes virtual.
IRBuilderBase accepts a reference to it.
* IRBuilderFolder is introduced as a virtual base class. It is
implemented by ConstantFolder (default), NoFolder and TargetFolder.
IRBuilderBase has a reference to this as well.
* All the logic is moved from IRBuilder to IRBuilderBase. This means
that methods can in the future replace their IRBuilder<> & uses
(or other specific IRBuilder types) with IRBuilderBase & and thus
be usable with different IRBuilders.
* The IRBuilder class is now a thin wrapper around IRBuilderBase.
Essentially it only stores the folder and inserter and takes care
of constructing the base builder.
What this patch doesn't do, but should be simple followups after this change:
* Fixing use of the inserter for creation methods originally defined
on IRBuilderBase.
* Replacing IRBuilder<> uses in arguments with IRBuilderBase, where useful.
* Moving code from the IRBuilder header to the source file.
From the user perspective, these changes should be mostly transparent:
The only thing that consumers using a custom inserted may need to do is
inherit from IRBuilderDefaultInserter publicly and mark their InsertHelper
as public.
Differential Revision: https://reviews.llvm.org/D73835
Georgii Rymar [Thu, 13 Feb 2020 12:12:31 +0000 (15:12 +0300)]
[llvm-readobj] - Refactor the code that dumps relocations.
The current code has following issues:
1) It has a duplicated logic part.
2) This logic relies on unwrapOrError calls, but if we want to convert
them to warnings, we will need to change all of them what is hard to do
because of the duplication.
In this patch I've created a new method that returns Expected<> what allows
now to catch all errors in a single place and remove the code duplication.
Note: this change is itself a refactor NFC. It does not change the current logic
anyhow. It prepares the code for the follow-up(s).
Differential revision: https://reviews.llvm.org/D74545
riverriddle@google.com [Sun, 16 Feb 2020 07:54:28 +0000 (23:54 -0800)]
[mlir] Allow adding extra class declarations to interfaces.
Summary: This matches the similar feature on operation definitions.
Reviewers: jpienaar, antiagainst
Reviewed By: jpienaar, antiagainst
Subscribers: mehdi_amini, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74438
River Riddle [Sun, 16 Feb 2020 07:48:59 +0000 (23:48 -0800)]
[mlir][Parser][NFC] Remove several usages of getEncodedSourceLocation
Summary: getEncodedSourceLocation can be very costly to compute, especially if the input line becomes very long. This revision inlines some of the verification of a few `getChecked` methods to avoid the materialization of an encoded source location.
Differential Revision: https://reviews.llvm.org/D74587
Johannes Doerfert [Sun, 16 Feb 2020 06:51:11 +0000 (00:51 -0600)]
[FIX] Do not copy an llvm::function_ref if it has to be reused
Some buildbots signaled a problem in this method when the
llvm::function_ref was copied and reused after
1228d42ddab8. To
eliminate the problem we avoid copying the llvm::function_ref and
instead we pass it as a const reference.