Craig Topper [Wed, 13 Nov 2019 06:44:48 +0000 (22:44 -0800)]
[X86] Remove setOperationAction for FP_TO_SINT v8i16.
This is no longer needed after widening legalization as we
custom legalize v8i8 ourselves.
Added entries to the cost model, but bumped the cost slightly
to account for the truncate shuffle that wasn't costed before.
Michael Kruse [Wed, 13 Nov 2019 06:20:17 +0000 (06:20 +0000)]
[GPGPU] Fix regression test after 395124.
Commit 395124 "NVPTX: Don't insert an extra empty line at the end of the last section"
changed the length of the kernel payload. Update the regression test to the new binary size.
Jonas Devlieghere [Wed, 13 Nov 2019 04:16:33 +0000 (20:16 -0800)]
[Reproducer] Discard reproducer directory if not generated.
If lldb was run in capture mode, but no reproducer was generated, make
sure we clean up the reproducer directory.
Francesco Petrogalli [Mon, 11 Nov 2019 16:48:51 +0000 (16:48 +0000)]
[VFABI] Add LLVM internal mangling for vector functions.
Summary:
This patch adds a custom ISA for vector functions for internal use
in LLVM. The <isa> token is set to "_LLVM_", and it is not attached
to any specific instruction Vector ISA, or Vector Function ABI.
The ISA is used as a token for handling Vector Function ABI-style
vectorization for those vector functions that are not directly
associated to any existing Vector Function ABI (for example, some of
the vector functions exposed by TargetLibraryInfo). The demangling
function for this ISA in a Vector Function ABI context is set to be
the same as the common one shared between X86 and AArch64.
Reviewers: jdoerfert, sdesmalen, simoll
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70089
Justin Hibbits [Thu, 24 Oct 2019 21:22:47 +0000 (16:22 -0500)]
Add 8548 CPU definition and attributes
8548 CPU is GCC's name for the e500v2, so accept this in clang. The
e500v2 doesn't support lwsync, so define __NO_LWSYNC__ for this as well,
as GCC does.
Differential Revision: https://reviews.llvm.org/D67787
Matt Arsenault [Tue, 12 Nov 2019 03:41:00 +0000 (09:11 +0530)]
AMDGPU: Extend add x, (ext setcc) combine to sub
This is the same as the add case, but inverts the operation type.
This avoids regressions in a future patch.
Matt Arsenault [Tue, 27 Aug 2019 16:34:40 +0000 (12:34 -0400)]
AMDGPU: Switch backend default max workgroup size to 1024
Previously this would default to 256, not the maximum supported size
of 1024. Using a maximum lower than the hardware maximum requires
language runtimes to enforce this limit for correctness, which no
language has correctly done. Switch the default to the conservatively
correct maximum, and force frontends to opt-in to the more optimal 256
default maximum.
I don't really understand why the changes in occupancy-levels.ll
increased the computed occupancy, which I expected to decrease. I'm
not sure if these tests should be forcing the old maximum.
Matt Arsenault [Tue, 27 Aug 2019 17:03:36 +0000 (13:03 -0400)]
AMDGPU Reduce reported maximum group size to 1024
While some targets allow encoding 2048, this was never tested or
supported.
Alina Sbirlea [Wed, 13 Nov 2019 00:19:14 +0000 (16:19 -0800)]
[GlobalsAA] Reenable test.
Muhammad Omair Javaid [Wed, 13 Nov 2019 00:30:25 +0000 (05:30 +0500)]
[LLDB] Add core definition for armv8l and armv7l
This patch adds core definitions in lldb ArchSpecs for armv8l and armv7l cores.
This was needed because on Linux running on 32-bit Arm v8 we are returned
armv8l in case we are running 32-bit sysroot on 64bit kernel. In case of 32-bit
kernel and 32-bit sysroot running on arm v8 hardware we are returned armv7l.
This is quite common when we run 32 bit arm using docker container.
Signed-off-by: Muhammad Omair Javaid <omair.javaid@linaro.org>
Differential Revision: https://reviews.llvm.org/D69904
Richard Smith [Wed, 13 Nov 2019 00:35:36 +0000 (16:35 -0800)]
Don't assume that the clang binary's resolved name includes the string
'clang'.
This is not true in practice in some content-addressed file systems.
Leonard Chan [Wed, 13 Nov 2019 00:22:13 +0000 (16:22 -0800)]
[Sema] Add MacroQualified case for FunctionTypeUnwrapper
This is a fix for PR43315. An assertion error is hit for this minimal example:
```
//clang -cc1 -triple x86_64-- -S tstVMStructRC-min.cpp
int (a b)(); // Assertion `Chunk.Kind == DeclaratorChunk::Function' failed.
```
This is because we do not cover the case in the FunctionTypeUnwrapper where it
receives a MacroQualifiedType. We have not run into this earlier because this
is a unique case where the __attribute__ contains both __cdecl__ and
__regparm__ (in that order), and we are compiling for x86_64. Changing the
architecture or the order of __cdecl__ and __regparm__ does not raise the
assertion.
Differential Revision: https://reviews.llvm.org/D67992
Alina Sbirlea [Tue, 12 Nov 2019 23:56:53 +0000 (15:56 -0800)]
Temporarily disable test.
Eric Christopher [Tue, 12 Nov 2019 23:51:51 +0000 (15:51 -0800)]
Temporarily Revert "Reapply [LVI] Normalize pointer behavior" as it's broken python 3.6.
Reverting to figure out if it's a problem in python or the compiler for now.
This reverts commit
885a05f48a5d320946c89590b73a764e5884fe4f.
Jonas Devlieghere [Tue, 12 Nov 2019 23:42:07 +0000 (15:42 -0800)]
[LLDB] Only set FRAMEWORK when we're actually building a framework.
Jonas Devlieghere [Tue, 12 Nov 2019 23:32:50 +0000 (15:32 -0800)]
[LLDB] Remove debug message in AddLLDB.cmake
Douglas Yung [Tue, 12 Nov 2019 23:05:45 +0000 (15:05 -0800)]
Add a shim for setenv on PS4 since it does not exist.
A few years back a similar change was made for getenv since neither function is supported on the PS4 platform.
Recently, commit d889d1e added a call to setenv in compiler-rt which was causing linking errors because the symbol was not found. This fixes that issue by putting in a shim similar to how we previously dealt with the lack of getenv.
Differential Revision: https://reviews.llvm.org/D70033
Craig Topper [Tue, 12 Nov 2019 21:17:00 +0000 (13:17 -0800)]
[X86] Don't consider v64i1 as a legal type unless v64i8 is also a legal type.
This avoids some nasty issues with argument passing and lowering of
arbitrary v64i8 shuffles.
Craig Topper [Tue, 12 Nov 2019 20:26:18 +0000 (12:26 -0800)]
[X86] Only pass v64i8/v32i16 as v16i32 on non-avx512bw targets if the v16i32 type won't be split by prefer-vector-width=256
Otherwise just let the v64i8/v32i16 types be split to v32i8/v16i16.
In reality this shouldn't happen because it means we have a 512-bit
vector argument, but min-legal-vector-width says a value less than
512. But a 512-bit argument should have been factored into the
preferred vector width.
Sterling Augustine [Fri, 8 Nov 2019 23:51:35 +0000 (15:51 -0800)]
Fix include guard and properly order __deregister_frame_info.
Summary:
This patch fixes two problems with the crtbegin.c as written:
1. In do_init, register_frame_info is not guarded by a #define, but in
do_fini, deregister_frame_info is guarded by #ifndef
CRT_HAS_INITFINI_ARRAY. Thus when CRT_HAS_INITFINI_ARRAY is not
defined, frames are registered but then never deregistered.
The frame registry mechanism builds a linked-list from the .so's
static variable do_init.object, and when the .so is unloaded, this
memory becomes invalid and should be deregistered.
Further, libgcc's crtbegin treats the frame registry as independent
from the initfini array mechanism.
This patch fixes this by adding a new #define,
"EH_USE_FRAME_INFO_REGISTRY", which is set by the cmake option
COMPILER_RT_CRT_USE_EH_FRAME_REGISTRY Currently, do_init calls
register_frame_info, and then calls the binary's constructors. This
allows constructors to safely use libunwind. However, do_fini calls
deregister_frame_info and then calls the binary's destructors. This
prevents destructors from safely using libunwind.
This patch also switches that ordering, so that destructors can safely
use libunwind. As it happens, this is a fairly common scenario for
thread sanitizer.
Weverything [Tue, 12 Nov 2019 21:46:03 +0000 (13:46 -0800)]
Add -Wtautological-compare to -Wall
Some warnings in -Wtautological-compare subgroups are DefaultIgnore.
Adding this group to -Wmost, which is part of -Wall, will aid in their
discoverability.
Differential Revision: https://reviews.llvm.org/D69292
Yonghong Song [Tue, 12 Nov 2019 19:31:52 +0000 (11:31 -0800)]
[BPF] generate BTF_KIND_VARs for all non-static globals
Enable to generate BTF_KIND_VARs for non-static
default-section globals which is not allowed previously.
Modified the existing test case to accommodate the new change.
Also removed unused linkage enum members VAR_GLOBAL_TENTATIVE and
VAR_GLOBAL_EXTERNAL.
Differential Revision: https://reviews.llvm.org/D70145
Alina Sbirlea [Thu, 31 Oct 2019 19:35:46 +0000 (12:35 -0700)]
[GlobalsAA] Restrict ModRef result if any internal method has its address taken.
Summary:
If there are any internal methods whose address was taken, conclude there is nothing known in relation of any other internal method and a global.
Reviewers: nlopes, sanjoy.google
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69690
Jonas Devlieghere [Tue, 12 Nov 2019 22:15:06 +0000 (14:15 -0800)]
[LLDB] Fix/silence CMake developer warning for LLDB framework.
This fixes the following warning for developers:
Target 'liblldb' was changed to a FRAMEWORK sometime after install(). This
may result in the wrong install DESTINATION. Set the FRAMEWORK property
earlier.
The solution is to pass the FRAMEWORK flag to add_lldb_library and set
the target property before install(). For now liblldb is the only
customer.
Alina Sbirlea [Tue, 12 Nov 2019 22:07:32 +0000 (14:07 -0800)]
[GVNHoist] Preserve AAResults.
Resolves PR38906, PR40898.
mydeveloperday [Tue, 12 Nov 2019 21:15:17 +0000 (21:15 +0000)]
Allow additional file suffixes/extensions considered as source in main include grouping
Summary:
By additional regex match, grouping of main include can be enabled in files that are not normally considered as a C/C++ source code.
For example, this might be useful in templated code, where template implementations are being held in *Impl.hpp files.
On the occassion, 'assume-filename' option description was reworded as it was misleading. It has nothing to do with `style=file` option and it does not influence sourced style filename.
Reviewers: rsmith, ioeric, krasimir, sylvestre.ledru, MyDeveloperDay
Reviewed By: MyDeveloperDay
Subscribers: MyDeveloperDay, cfe-commits
Patch by: furdyna
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67750
Jonas Devlieghere [Tue, 12 Nov 2019 20:57:00 +0000 (12:57 -0800)]
[LLDB] Always remove debugserver from LLVM_DISTRIBUTION_COMPONENTS
Centralize the logic to remove debugserver from
LLVM_DISTRIBUTION_COMPONENTS when LLDB_USE_SYSTEM_DEBUGSERVER is
enabled. Now this happens regardless of whether the tests are enabled.
Evandro Menezes [Tue, 12 Nov 2019 20:28:25 +0000 (14:28 -0600)]
[AArch64] Update for Exynos
Fix the modeling for loads and stores using the register offset addresing mode.
Evandro Menezes [Tue, 12 Nov 2019 20:13:30 +0000 (14:13 -0600)]
[AArch64] Fix addressing mode predicates
Fix predicates related to the register offset addressing mode.
Michael Kruse [Tue, 12 Nov 2019 19:48:07 +0000 (13:48 -0600)]
[CodeGen] Fix getArrayAccessFor crashes as in bug 32534 with -polly-vectorizer=polly.
Root cause is VectorBlockGenerator::copyStmt iterates all instructions
in basic block, however some load instructions may be not unnecessary
thus removed by simplification. As a result, these load instructions
don't have a corresponding array.
Looking at BlockGenerator::copyBB, it only iterates instructions list
of ScopStmt. Given it must be a block type scop in case of
vectorization, I think we should do the same in
VectorBlockGenerator::copyStmt.
Patch by bin.narwal <bin.narwal@gmail.com>
Differential Revision: https://reviews.llvm.org/D70076
Mark de Wever [Tue, 12 Nov 2019 19:51:06 +0000 (20:51 +0100)]
[Analyzer] Use a reference in a range-based for
Let the checkers use a reference instead of a copy in a range-based
for loop.
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D70047
Mark de Wever [Tue, 12 Nov 2019 19:48:11 +0000 (20:48 +0100)]
[OpenMP] Use an explicit copy in a range-based for
The std::pair<const clang::ValueDecl *, llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>>
type will be copied in a range-based for loop. Make the copy explicit to
avoid the -Wrange-loop-analysis warning.
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D70046
Mark de Wever [Tue, 12 Nov 2019 19:46:19 +0000 (20:46 +0100)]
[AST] Use an explicit copy in a range-based for
The AssociationIteratorTy type will be copied in a range-based for loop.
Make the copy explicit to avoid the -Wrange-loop-analysis warning.
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D70045
shafik [Tue, 12 Nov 2019 19:23:38 +0000 (11:23 -0800)]
[LLDB][Formatters] Re-enable std::function formatter with fixes to improve non-cached lookup performance
Performance issues lead to the libc++ std::function formatter to be disabled. We addressed some of those performance issues by adding caching see D67111
This PR fixes the first lookup performance by not using FindSymbolsMatchingRegExAndType(...) and instead finding the compilation unit the std::function wrapped callable should be in and then searching for the callable directly in the CU.
Differential Revision: https://reviews.llvm.org/D69913
Fangrui Song [Sat, 9 Nov 2019 00:19:33 +0000 (16:19 -0800)]
[llvm-objcopy][COFF] Implement --redefine-sym and --redefine-syms
The parsing error tests in ELF/redefine-symbols.test are not specific to ELF.
Move them to redefine-symbols.test.
Add COFF/redefine-symbols.test for COFF specific tests.
Also fix the documentation regarding --redefine-syms: the old and new
names are separated by whitespace, not an equals sign.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D70036
Davide Italiano [Tue, 12 Nov 2019 19:10:36 +0000 (11:10 -0800)]
[ObjectFileMachO] Fix the build for __arm64__.
Catch up with an API change.
Peter Collingbourne [Fri, 8 Nov 2019 19:03:34 +0000 (11:03 -0800)]
ARM: Don't emit R_ARM_NONE relocations to compact unwinding decoders in .ARM.exidx on Android.
These relocations are specified by the ARM EHABI (section 6.3). As I understand
it, their purpose is to accommodate unwinder implementations that wish to
reduce code size by placing the implementations of the compact unwinding
decoders in a separate translation unit, and using extern weak symbols to
refer to them from the main unwinder implementation, so that they are only
linked when something in the binary needs them in order to unwind.
However, neither of the unwinders used on Android (libgcc, LLVM libunwind)
use this technique, and in fact emitting these relocations ends up being
counterproductive to code size because they cause a copy of the unwinder
to be statically linked into most binaries, regardless of whether it is
actually needed. Furthermore, these relocations create circular dependencies
(between libc and the unwinder) in cases where the unwinder is dynamically
linked and libc contains compact unwind info.
Therefore, deviate from the EHABI here and stop emitting these relocations
on Android.
Differential Revision: https://reviews.llvm.org/D70027
Michael Liao [Tue, 12 Nov 2019 18:37:27 +0000 (13:37 -0500)]
Fix build with shared libraries. NFC.
- Dependent components need linking directly.
Alexey Bataev [Tue, 12 Nov 2019 16:19:26 +0000 (11:19 -0500)]
[OPENMP]Use copy constructors instead of assignment operators in declare
reduction initializers.
Better to use copy constructor at the initialization of the declare
reduction construct rather than assignment operator.
Sam Clegg [Thu, 7 Nov 2019 22:51:25 +0000 (14:51 -0800)]
[libcxxabi] Prevent cmake from removing our explicit system C++ include paths
We build with `-nostdinc++` and add our own header path via
`LIBCXXABI_LIBCXX_INCLUDES`. However cmake tried to be clever and if
`LIBCXXABI_LIBCXX_INCLUDES` happens to match the compilers system path
it will remove the `-I` flag meaning we can't access any C++ headers.
Ideally cmake would be able see that we are using `-nostdinc++` and
disable this behaviour.
Differential Revision: https://reviews.llvm.org/D69973
Krzysztof Parzyszek [Tue, 12 Nov 2019 17:42:27 +0000 (11:42 -0600)]
[Hexagon] Update PS_aligna with max stack alignment once isel completes
Adrian Prantl [Tue, 12 Nov 2019 17:25:59 +0000 (09:25 -0800)]
Performance: Add a set of visited SymbolFiles to the other FindFiles variant.
This is basically the same bug as in r260434.
SymbolFileDWARF::FindTypes has exponential worst-case when digging
through dependency DAG of .pcm files because each object file and .pcm
file may depend on an already-visited .pcm file, which may again have
dependencies. Fixed here by carrying a set of already visited
SymbolFiles around.
rdar://problem/
56993424
Differential Revision: https://reviews.llvm.org/D70106
Julian Lettner [Tue, 12 Nov 2019 16:24:26 +0000 (08:24 -0800)]
[lit] Better/earlier errors for empty runs
Fail early, when we discover no tests at all, or filter out all of them.
There is also `--allow-empty-runs` to disable test to allow workflows
like `LIT_FILTER=abc ninja check-all`. Apparently `check-all` invokes
lit multiple times if certain projects are enabled, which would produce
unwanted "empty runs". Specify via `LIT_OPTS=--allow-empty-runs`.
There are 3 causes for empty runs:
1) No tests discovered. This is always an error. Fix test suite config
or command line.
2) All tests filtered out. This is an error by default, but can be
suppressed via `--alow-empty-runs`. Should prevent accidentally
passing empty runs, but allow the workflow above.
3) The number of shards is greater than the number of tests. Currently,
this is never an error. Personally, I think we should consider
making this an error by default; if this happens, you are doing
something wrong. I added a warning but did not change the behavior,
since this warrants more discussion.
Reviewed By: atrick, jdenny
Differential Revision: https://reviews.llvm.org/D70105
Duncan P. N. Exon Smith [Sun, 10 Nov 2019 21:14:52 +0000 (13:14 -0800)]
clang/Modules: Error if ReadASTBlock does not find the main module
If ReadASTBlock does not find its top-level submodule, there's something
wrong the with the PCM. Error in that case, to avoid hitting problems
further from the source.
Note that the Swift compiler sometimes hits a case in
CompilerInstance::loadModule where the top-level submodule mysteriously
does not have Module::IsFromModuleFile set. That will emit a confusing
warn_missing_submodule, which was never intended for the main module.
The recent audit of error-handling in ReadAST may have rooted out the
real problem. If not, this commit will help to clarify the real
problem, and replace a confusing warning with an error pointing at the
malformed PCM file.
We're specifically sniffing out whether the top-level submodule was
found/processed, in case there is a malformed module file that is
missing it. If there is an error encountered during ReadSubmoduleBlock
the return status should already propagate through. It would be nice to
detect other missing submodules around here to catch other instances of
warn_missing_submodule closer to the source, but that's left as a future
exercise.
https://reviews.llvm.org/D70063
Sanjay Patel [Tue, 12 Nov 2019 16:36:41 +0000 (11:36 -0500)]
[SLP] add test for miscompile with reduction (PR43948); NFC
Krzysztof Parzyszek [Mon, 11 Nov 2019 15:05:21 +0000 (09:05 -0600)]
[Hexagon] Fix vector spill expansion to use proper alignment
1. Add pseudos PS_vloadrv_ai and PS_vstorerv_ai: those are now used
for single vector registers in loadRegFromStackSlot (and store...).
2. Remove pseudos PS_vloadrwu_ai and PS_vstorerwu_ai. The alignment is
now checked when expanding spill pseudos (both in frame lowering
and in expand-post-ra-pseudos), and a proper instruction is generated.
3. Update MachineMemOperands when dealigning vector spill slots.
4. Return vector predicate registers in getCallerSavedRegs.
Krzysztof Parzyszek [Mon, 11 Nov 2019 14:49:07 +0000 (08:49 -0600)]
[Hexagon] Convert stack object offsets to int64, NFC
This will print [SP-56] instead of [SP+
4294967240].
Krzysztof Parzyszek [Sat, 9 Nov 2019 01:07:02 +0000 (19:07 -0600)]
[Hexagon] Handle stack realignment in hexagon-vextract
Krzysztof Parzyszek [Sat, 9 Nov 2019 01:05:28 +0000 (19:05 -0600)]
[Hexagon] Require PS_aligna whenever variable-sized objects are present
Jinsong Ji [Tue, 12 Nov 2019 15:00:09 +0000 (15:00 +0000)]
[PowerPC] Remove allow-deprecated-dag-overlap and fix broken tests
Summary:
This is found during review of https://reviews.llvm.org/D67088.
CHECK-DAG is non-overlapping after https://reviews.llvm.org/D47106.
-allow-deprecated-dag-overlap was introduced to temporary accept old
behavior.
But it actually hide some broken tests, eg: `test/CodeGen/PowerPC/swaps-le-1.ll`
The codegen has changed, but the CHECK-DAG still PASS due to allowing `overlap`.
This patch remove the deprecated options, and fix the broken tests.
Reviewers: #powerpc, hfinkel, nemanjai, steven.zhang, shchenz
Reviewed By: shchenz
Subscribers: shchenz, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69733
Tom Weaver [Tue, 12 Nov 2019 15:17:04 +0000 (15:17 +0000)]
[DBG][OPT] Attempt to salvage or undef debug info when removing trivially deletable instructions in the Reassociate Expression pass.
Reviewed By: aprantl, vsk
Differential revision: https://reviews.llvm.org/D69943
Jinsong Ji [Tue, 12 Nov 2019 14:46:57 +0000 (14:46 +0000)]
[PowerPC][NFC]Fix typo in desc for enable-ppc-prefetching
Florian Hahn [Tue, 12 Nov 2019 14:06:12 +0000 (14:06 +0000)]
[Examples] Add IRTransformations directory to examples.
This patch adds a new IRTransformations directory to llvm/examples/. This is
intended to serve as a new home for example transformations/analysis
code used by various tutorials.
If LLVM_BUILD_EXAMPLES is enabled, the ExamplesIRTransforms library is
linked into the opt binary and the example passes become available.
To start off with, it contains the CFG simplifications used in the IR
part of the 'Getting Started With LLVM: Basics' tutorial at the US LLVM
Developers Meeting 2019.
Reviewers: paquette, jfb, meikeb, lhames, kbarton
Reviewed By: paquette
Differential Revision: https://reviews.llvm.org/D69416
Muhammad Omair Javaid [Tue, 12 Nov 2019 13:48:32 +0000 (18:48 +0500)]
Revert "Fix lookup of symbols at the same address with no size vs. size"
This reverts commit
3f594ed1686b44138bee245c708773e526643aaf.
This change has cause LLDB expression evaluation to fail on Arm Linux.
Differential Revision: https://reviews.llvm.org/D63540
Pavel Labath [Tue, 12 Nov 2019 13:25:18 +0000 (14:25 +0100)]
[lldb] Fix more -Wdeprecated-copy warnings
This warning triggers when a class defines a copy constructor but not a
copy-assignment operator (which then gets auto-generated by the
compiler). Fix the warning by deleting the other operator too, as the
default implementation works just fine.
Pavel Labath [Tue, 12 Nov 2019 13:33:52 +0000 (14:33 +0100)]
[lldb] Fix some warnings in the python plugin
Alex Denisov [Tue, 12 Nov 2019 09:57:32 +0000 (10:57 +0100)]
Mark llvm::ConstantExpr::getAsInstruction as const
Summary:
getAsInstruction is the only non-const member method.
It is impossible to enforce const-correctness because of it.
Reviewers: jmolloy, majnemer
Reviewed By: jmolloy
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70113
Tim Northover [Tue, 18 Sep 2018 09:34:39 +0000 (10:34 +0100)]
AArch64: add arm64_32 support to Clang.
Michał Górny [Sun, 10 Nov 2019 17:39:55 +0000 (18:39 +0100)]
[lldb] [Process/NetBSD] Use PT_STOP to stop the process [NFCI]
Differential Revision: https://reviews.llvm.org/D70060
Florian Hahn [Tue, 12 Nov 2019 10:35:31 +0000 (10:35 +0000)]
[AArch64ExpandPseudos] Preserve renamable state when expanding MOVi64 & co.
If the MOVi operand was renamable, the operands of the expanded
instructions are also renamable.
Reviewers: thegameg, samparker, zatrazz
Reviewed By: thegameg
Differential Revision: https://reviews.llvm.org/D70061
Diana Picus [Thu, 7 Nov 2019 12:09:32 +0000 (13:09 +0100)]
[InstCombine] Skip scalable vectors in combineLoadToOperationType
Don't try to canonicalize loads to scalable vector types to loads
of integers.
This removes one assertion when trying to use a TypeSize as a parameter
to DataLayout::isLegalInteger. It does not handle the second part of the
function (which looks at bitcasts).
This patch also contains a NFC fix for Load Analysis, where a variable
initialization that would cause the same assertion is moved closer to
its use. This allows us to run the new test for InstCombine without
having to teach LocationSize to play nicely with scalable vectors.
Differential Revision: https://reviews.llvm.org/D70075
Simon Pilgrim [Tue, 12 Nov 2019 11:24:00 +0000 (11:24 +0000)]
[X86] Cleanup prefixes + regenerate for fp-intrinsics-fma.ll
Simon Pilgrim [Tue, 12 Nov 2019 11:14:03 +0000 (11:14 +0000)]
FileCheckPattern::FindRegexVarEnd - make helper function static. NFC
Fixes cppcheck warning.
Simon Pilgrim [Tue, 12 Nov 2019 11:11:40 +0000 (11:11 +0000)]
[X86] Add PR39464 addcarry/subborrow test cases
Additional coverage for D70079
Tatyana Krasnukha [Mon, 11 Nov 2019 17:36:55 +0000 (20:36 +0300)]
[lldb][test] Macros in expressions require DWARF 5
Florian Hahn [Tue, 12 Nov 2019 10:23:26 +0000 (10:23 +0000)]
[LoopInterchange] Only skip PHIs with incoming values from the inner loop.
Currently we have limited support for outer loops with multiple basic
blocks after the inner loop exit. But the current checks for creating
PHIs for loop exit values only assumes the header and latches of the
outer loop. It is better to just skip incoming values defined in the
original inner loops. Those are handled earlier.
Reviewers: efriedma, mcrosier
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D70059
Raphael Isemann [Tue, 12 Nov 2019 09:58:46 +0000 (10:58 +0100)]
[lldb][NFC] Simplify a return in ThreadPlanStepInRange::DefaultShouldStopHereCallback
We know should_stop_here is false here, so we might as well return false directly.
Pavel Labath [Thu, 7 Nov 2019 09:33:18 +0000 (10:33 +0100)]
DWARFDebugLoclists: add location list "interpretation" logic
Summary:
This patch extracts the logic for computing the "absolute" locations,
which was partially present in the debug_loclists dumper, completes it,
and moves it into a separate function. This makes it possible to later
reuse the same logic for uses other than dumping.
The dumper is changed to reuse the location list interpreter, and its
format is changed somewhat. In "verbose" mode it prints the "raw" value
of a location list, the interpreted location (if available) and the
expression itself. In non-verbose mode it prints only one of the
location forms: it prefers the interpreted form, but falls back to the
"raw" format if interpretation is not possible (for instance, because we
were not given a base address, or the resolution of indirect addresses
failed).
This patch also undos some of the changes made in D69672, namely the
part about making all functions static. The main reason for this is that
I learned that the original approach (dumping only fully resolved
locations) meant that it was impossible to rewrite one of the existing
tests. To make that possible (and make the "inline location" dump work
in more cases), I now reuse the same dumping mechanism as is used for
section-based dumping. As this required having more objects know about
the various location lists classes, it seemed like a good idea to create
an interface abstracting the difference between them.
Therefore, I now create a DWARFLocationTable class, which will serve as
a base class for the location list classes. DWARFDebugLoclists is made
to inherit from that. DWARFDebugLoc will follow.
Another positive effect of this change is that section-based dumping
code will not need to use templates (as originally) envisioned, and that
the argument lists of the dumping functions become shorter.
Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70081
David Zarzycki [Mon, 11 Nov 2019 13:07:51 +0000 (15:07 +0200)]
[X86] Add more add/sub carry tests
Preparation for: https://reviews.llvm.org/D70079
https://reviews.llvm.org/D70077
mydeveloperday [Tue, 12 Nov 2019 09:14:51 +0000 (09:14 +0000)]
[clang-format] [PR36294] AlwaysBreakAfterReturnType works incorrectly for some operator functions
Summary:
https://bugs.llvm.org/show_bug.cgi?id=36294
Addressing bug related to returning after return type not being honoured for some operator types.
```
$ bin/clang-format --style="{BasedOnStyle: llvm, AlwaysBreakAfterReturnType: TopLevelDefinitions}" /tmp/foo.cpp
class Foo {
public:
bool operator!() const;
bool operator<(Foo const &) const;
bool operator*() const;
bool operator->() const;
bool operator+() const;
bool operator-() const;
bool f() const;
};
bool Foo::operator!() const { return true; }
bool
Foo::operator<(Foo const &) const {
return true;
}
bool Foo::operator*() const { return true; }
bool Foo::operator->() const { return true; }
bool
Foo::operator+() const {
return true;
}
bool
Foo::operator-() const {
return true;
}
bool
Foo::f() const {
return true;
}
```
Reviewers: mitchell-stellar, klimek, owenpan, sammccall, rianquinn
Reviewed By: sammccall
Subscribers: merge_guards_bot, cfe-commits
Tags: #clang-format, #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D69573
Raphael Isemann [Tue, 12 Nov 2019 09:21:49 +0000 (10:21 +0100)]
[lldb] Add missing include to ObjCLanguage.cpp to fix build
Raphael Isemann [Tue, 12 Nov 2019 09:04:32 +0000 (10:04 +0100)]
[lldb][NFC] Move LLVM RTTI implementation from enum to static ID variable
Summary:
swift-lldb currently has to patch the ExpressionKind enum to add support for Swift expressions. If we implement LLVM's RTTI
with a static ID variable instead of a centralised enum we can drop that patch.
Reviewers: labath, davide
Reviewed By: labath
Subscribers: JDevlieghere, lldb-commits
Tags: #upstreaming_lldb_s_downstream_patches, #lldb
Differential Revision: https://reviews.llvm.org/D70070
Raphael Isemann [Tue, 12 Nov 2019 09:02:59 +0000 (10:02 +0100)]
[lldb][NFC] Remove unused CompilerType::IsPossibleCPlusPlusDynamicType
Reviewers: davide, xiaobai
Reviewed By: davide, xiaobai
Subscribers: davide, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70074
Raphael Isemann [Mon, 11 Nov 2019 13:25:54 +0000 (14:25 +0100)]
[lldb] Check if we actually have a Clang type in ObjCLanguage::GetPossibleFormattersMatches
We call IsPossibleDynamicType but we also need to check if this is a Clang type,
otherwise other languages with dynamic types (like Swift) might end up being interpreted
as potential Obj-C dynamic types.
Daniil Suchkov [Mon, 30 Sep 2019 05:16:37 +0000 (12:16 +0700)]
[NFC][InstCombine] Add tests that show a number of canonicalization opportunities
Reviewers: spatel, RKSimon, lebedev.ri, apilipenko
Reviewed-By: apilipenko
Tags: #llvm
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D68263
Tim Renouf [Mon, 11 Nov 2019 11:06:09 +0000 (11:06 +0000)]
MCP: Fixed bug with dest overlapping copy source
In MachineCopyPropagation, when propagating the source of a copy into
the operand of a later instruction, bail if a destination overlaps
(partly defines) the copy source. If the instruction where the
substitution is happening is also a copy, allowing the propagation
confuses the tracking mechanism.
Differential Revision: https://reviews.llvm.org/D69953
Change-Id: Ic570754f878f2d91a4a50a9bdcf96fbaa240726d
Craig Topper [Tue, 12 Nov 2019 07:30:55 +0000 (23:30 -0800)]
[X86] Add fptosi test to fp-intrinsics.ll
Craig Topper [Tue, 12 Nov 2019 04:35:58 +0000 (20:35 -0800)]
[X86] Update stale comment. NFC
Mikael Holmen [Tue, 12 Nov 2019 07:28:12 +0000 (08:28 +0100)]
[VFABI] Remove unused variables in testcase, fix buildbot
E.g. the buildbot at
http://lab.llvm.org:8011/builders/ppc64le-lld-multistage-test/builds/7259/steps/build-stage2-unified-tree/logs/stdio
failed with
/home/buildbots/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/Transforms/Utils/VFABIUtils.cpp:50:22: error: unused variable 'FnAttrs' [-Werror,-Wunused-variable]
const AttributeSet FnAttrs = Attrs.getFnAttributes();
^
1 error generated.
Georgii Rymar [Fri, 8 Nov 2019 12:21:24 +0000 (15:21 +0300)]
[llvm-readelf/llvm-readobj][test] - Convert elf-linker-options.ll to use YAML.
This converts elf-linker-options.ll to use yaml2obj instead of llc,
improves and cleanups it a bit.
This opens a road to add an additional tests for checking the broken cases.
Differential revision: https://reviews.llvm.org/D70004
Georgii Rymar [Wed, 6 Nov 2019 15:14:12 +0000 (18:14 +0300)]
[yaml2obj/obj2yaml] - Add support for SHT_LLVM_LINKER_OPTIONS sections.
SHT_LLVM_LINKER_OPTIONS section contains pairs of null-terminated strings.
This patch adds support for them.
Differential revision: https://reviews.llvm.org/D69895
Hideto Ueno [Tue, 12 Nov 2019 06:36:49 +0000 (06:36 +0000)]
[Attributor] Use must-be-executed-context in align deduction
Summary:
This patch introduces align attribute deduction for callsite argument, function argument, function returned and floating value based on must-be-executed-context.
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69797
Nick Terrell [Tue, 12 Nov 2019 06:07:12 +0000 (22:07 -0800)]
[Support] Optimize SHA1 implementation
* Add inline to the helper functions because gcc-9 won't inline all of
them without the hint. I've avoided `__attribute__((always_inline))`
because gcc and clang will inline without it, and improves
compatibility.
* Replace the byte-by-byte copy in update() with endian::readbe32()
since perf reports that 1/2 of the time is spent copying into the
buffer before this patch.
When lld uses --build-id=sha1 it spends 30-45% of CPU in SHA1 depending on the binary (not wall-time since it is parallel). This patch speeds up SHA1 by a factor of 2 on clang-8 and 3 on gcc-6. This leads to a >10% improvement in overall linking time.
lld-speed-test benchmarks run on an Intel i9-9900k with Turbo disabled on CPU 0 compiled with clang-9. Stats recorded with `perf stat -r 5`. All inputs are using `--build-id=sha1`.
| Input | Before (seconds) | After (seconds) |
| --- | --- | --- |
| chrome | 2.14 | 1.82 (-15%) |
| chrome-icf | 2.56 | 2.29 (-10%) |
| clang | 0.65 | 0.53 (-18%) |
| clang-fsds | 0.69 | 0.58 (-16%) |
| clang-gdb-index | 21.71 | 19.3 (-11%) |
| gold | 0.42 | 0.34 (-19%) |
| gold-fsds | 0.431 | 0.355 (-17%) |
| linux-kernel | 0.625 | 0.575 (-8%) |
| llvm-as | 0.045 | 0.039 (-14%) |
| llvm-as-fsds | 0.035 | 0.039 (-11%) |
| mozilla | 11.3 | 9.8 (-13%) |
| mozilla-gc | 11.84 | 10.36 (-12%) |
| mozilla-O0 | 8.2 | 5.84 (-28%) |
| scylla | 5.59 | 4.52 (-19%) |
Reviewed By: ruiu, MaskRay
Differential Revision: https://reviews.llvm.org/D69295
Fangrui Song [Tue, 12 Nov 2019 05:51:59 +0000 (21:51 -0800)]
AMDGPU/SI: make ~SIScheduleBlockCreator trivial
Fangrui Song [Tue, 12 Nov 2019 05:26:26 +0000 (21:26 -0800)]
[PDB] Make pdb::DbiModuleDescriptor destructor trivial
Vasileios Porpodas [Mon, 11 Nov 2019 18:50:20 +0000 (18:50 +0000)]
[SLP] Look-ahead operand reordering heuristic.
Summary: This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for examples).
Reviewers: RKSimon, ABataev, dtemirbulatov, Ayal, hfinkel, rnk
Reviewed By: RKSimon, dtemirbulatov
Subscribers: xbolva00, Carrot, hiraditya, phosek, rnk, rcorcs, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60897
Thomas Finch [Tue, 12 Nov 2019 04:48:28 +0000 (20:48 -0800)]
Fix null dereference in yaml::Document::skip
Summary: The attached test case replicates a null dereference crash in
`yaml::Document::skip()`. This was fixed by adding a check and early
return in the method.
Reviewers: Bigcheese, hintonda, beanz
Reviewed By: hintonda
Subscribers: hiraditya, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69974
LLVM GN Syncbot [Tue, 12 Nov 2019 03:49:52 +0000 (03:49 +0000)]
gn build: Merge
e9a06e06064
Francesco Petrogalli [Wed, 30 Oct 2019 19:08:21 +0000 (19:08 +0000)]
[VFABI] Read/Write functions for the VFABI attribute.
The attribute is stored at the `FunctionIndex` attribute set, with the
name "vector-function-abi-variant".
The get/set methods of the attribute have assertion to verify that:
1. Each name in the attribute is a valid VFABI mangled name.
2. Each name in the attribute correspond to a function declared in the
module.
Differential Revision: https://reviews.llvm.org/D69976
António Afonso [Mon, 11 Nov 2019 21:39:30 +0000 (13:39 -0800)]
Add rpath to liblldb so vendors can ship their own python framework (or others)
Summary:
I want to be able to specify which python framework to use for lldb in macos. With python2.7 we could just rely on the MacOS one but python3.7 is not shipped with the OS.
An alternative is to use the one shipped with Xcode but that could be path dependent or maybe the user doesn't have Xcode installed at all.
A definite solution is to just ship a python framework with lldb. To make this possible I added "@loader_path/../../../" to the rpath so it points to the same directory as the LLDB.framework, this way we can just drop any frameworks there.
Reviewers: hhb, sgraenitz, xiaobai, smeenai, beanz, labath
Reviewed By: labath
Subscribers: beanz, labath, mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69931
aqjune [Wed, 6 Nov 2019 16:12:17 +0000 (01:12 +0900)]
Add InstCombine/InstructionSimplify support for Freeze Instruction
Summary:
- Add llvm::SimplifyFreezeInst
- Add InstCombiner::visitFreeze
- Add llvm tests
Reviewers: majnemer, sanjoy, reames, lebedev.ri, spatel
Reviewed By: reames, lebedev.ri
Subscribers: reames, lebedev.ri, filcab, regehr, trentxintong, llvm-commits
Differential Revision: https://reviews.llvm.org/D29013
Nemanja Ivanovic [Tue, 12 Nov 2019 02:37:09 +0000 (20:37 -0600)]
[NFC] Fix test case after
edab7dd426249bd40059b49b255ba9cc5b784753
The author of the patch forgot to add -verify-machineinstrs to the RUN
lines which would have made the issue appear on all bots. Added that
as well as a fix for the undefined register issue (after the hoisting).
Craig Topper [Tue, 12 Nov 2019 02:16:14 +0000 (18:16 -0800)]
[X86] Remove setOperationAction lines that say to promote MVT::i1
MVT::i1 should be removed by type legalization before we reach
any code that would act on the promote action.
Mainly to avoid replicating this for strict FP versions of these
operations.
Juneyoung Lee [Tue, 12 Nov 2019 02:23:19 +0000 (11:23 +0900)]
[IR] Resolve an error at freeze's unit tests
Fangrui Song [Tue, 12 Nov 2019 02:11:15 +0000 (18:11 -0800)]
[MC] Make MCFragment trivially destructible
aqjune [Wed, 6 Nov 2019 16:17:49 +0000 (01:17 +0900)]
[IR] Redefine Freeze instruction
Summary:
This patch redefines freeze instruction from being UnaryOperator to a subclass of UnaryInstruction.
ConstantExpr freeze is removed, as discussed in the previous review.
FreezeOperator is not added because there's no ConstantExpr freeze.
`freeze i8* null` test is added to `test/Bindings/llvm-c/freeze.ll` as well, because the null pointer-related bug in `tools/llvm-c/echo.cpp` is now fixed.
InstVisitor has visitFreeze now because freeze is not unaryop anymore.
Reviewers: whitequark, deadalnix, craig.topper, jdoerfert, lebedev.ri
Reviewed By: craig.topper, lebedev.ri
Subscribers: regehr, nlopes, mehdi_amini, hiraditya, steven_wu, dexonsmith, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69932
Duncan P. N. Exon Smith [Sun, 10 Nov 2019 18:42:29 +0000 (10:42 -0800)]
clang/Modules: Clean up modules on error in ReadAST
ReadASTBlock and ReadASTExtensions can both return failures. Be
consistent and remove all the just-loaded modules, just like when
ReadASTCore returns failures.
https://reviews.llvm.org/D70055
Craig Topper [Tue, 12 Nov 2019 00:30:42 +0000 (16:30 -0800)]
[X86] Remove some else branches after checking for !useSoftFloat() that set operations to Expand.
If we're using soft floats, then these operations shoudl be
softened during type legalization. They'll never get to
LegalizeVectorOps or LegalizeDAG so they don't need to be
Expanded there.
Duncan P. N. Exon Smith [Sun, 10 Nov 2019 19:07:20 +0000 (11:07 -0800)]
clang/Modules: Add missing diagnostics for malformed AST files
These were found via an audit. In the case of `ParseLineTable` this is
actually dead code, since parsing the line table always succeeds, but
it's prudent to be defensive since it's possible an assertion there
could be converted to a `true` return in the future.
Jonas Devlieghere [Mon, 11 Nov 2019 23:58:27 +0000 (15:58 -0800)]
[lldb] Re-enable VSCode tests
The VSCode tests were all disabled on macOS because the implementation
had some issues that resulted in flakiness on Darwin. It seems most of
these issues have been addressed. I've re-enabled all the tests that
consistently passed locally.