Commit Graph

331886 Commits

Author SHA1 Message Date
Craig Topper 3e1aee2ba7 [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.
2019-11-12 14:56:02 -08:00
Craig Topper 0f04ffc073 [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.
2019-11-12 14:56:01 -08:00
Sterling Augustine 38c356176b 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.
2019-11-12 14:54:41 -08:00
Weverything 9740f9f0b6 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
2019-11-12 14:36:57 -08:00
Yonghong Song 166cdc0281 [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
2019-11-12 14:34:08 -08:00
Alina Sbirlea db69f1b229 [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
2019-11-12 14:24:56 -08:00
Jonas Devlieghere a247bd1f27 [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.
2019-11-12 14:17:19 -08:00
Alina Sbirlea 4ae74cc99f [GVNHoist] Preserve AAResults.
Resolves PR38906, PR40898.
2019-11-12 14:10:04 -08:00
mydeveloperday 335ac2eb66 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
2019-11-12 21:26:52 +00:00
Jonas Devlieghere fbb228c7d2 [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.
2019-11-12 12:58:26 -08:00
Evandro Menezes 9b1e86f0cb [AArch64] Update for Exynos
Fix the modeling for loads and stores using the register offset addresing mode.
2019-11-12 14:37:41 -06:00
Evandro Menezes 98856e3943 [AArch64] Fix addressing mode predicates
Fix predicates related to the register offset addressing mode.
2019-11-12 14:37:28 -06:00
Michael Kruse 0aff3174dc [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
2019-11-12 13:58:28 -06:00
Mark de Wever 964842861c [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
2019-11-12 20:53:08 +01:00
Mark de Wever 51abcebbb6 [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
2019-11-12 20:50:38 +01:00
Mark de Wever 2149028c49 [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
2019-11-12 20:47:46 +01:00
shafik 91e94a7015 [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
2019-11-12 11:30:18 -08:00
Fangrui Song 7af6025bd1 [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
2019-11-12 11:28:00 -08:00
Davide Italiano 96915495f9 [ObjectFileMachO] Fix the build for __arm64__.
Catch up with an API change.
2019-11-12 11:10:36 -08:00
Peter Collingbourne 1549b4699a 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
2019-11-12 10:52:59 -08:00
Michael Liao ceb72d07b0 Fix build with shared libraries. NFC.
- Dependent components need linking directly.
2019-11-12 13:40:35 -05:00
Alexey Bataev 3c676e3891 [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.
2019-11-12 13:13:37 -05:00
Sam Clegg 4230fa9390 [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
2019-11-12 10:08:40 -08:00
Krzysztof Parzyszek ef150e2ea5 [Hexagon] Update PS_aligna with max stack alignment once isel completes 2019-11-12 11:47:29 -06:00
Adrian Prantl 3b73dcdc96 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
2019-11-12 09:38:37 -08:00
Julian Lettner 54a9b4c02f [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
2019-11-12 09:11:36 -08:00
Duncan P. N. Exon Smith 83dcb34b6b 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
2019-11-12 08:40:53 -08:00
Sanjay Patel 2d06375c3f [SLP] add test for miscompile with reduction (PR43948); NFC 2019-11-12 11:36:41 -05:00
Krzysztof Parzyszek 592dd45924 [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.
2019-11-12 09:43:21 -06:00
Krzysztof Parzyszek e3eb10c541 [Hexagon] Convert stack object offsets to int64, NFC
This will print [SP-56] instead of [SP+4294967240].
2019-11-12 09:43:21 -06:00
Krzysztof Parzyszek 67294c97fb [Hexagon] Handle stack realignment in hexagon-vextract 2019-11-12 09:43:21 -06:00
Krzysztof Parzyszek 0a58ef5eb5 [Hexagon] Require PS_aligna whenever variable-sized objects are present 2019-11-12 09:43:21 -06:00
Jinsong Ji 228dd96c6f [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
2019-11-12 15:18:54 +00:00
Tom Weaver 41c3f76dcd [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
2019-11-12 15:17:04 +00:00
Jinsong Ji 4cc0c2998d [PowerPC][NFC]Fix typo in desc for enable-ppc-prefetching 2019-11-12 14:46:57 +00:00
Florian Hahn 7d0b1d77b3 [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
2019-11-12 14:14:48 +00:00
Muhammad Omair Javaid a6c40f56ae Revert "Fix lookup of symbols at the same address with no size vs. size"
This reverts commit 3f594ed168.

This change has cause LLDB expression evaluation to fail on Arm Linux.

Differential Revision: https://reviews.llvm.org/D63540
2019-11-12 19:02:17 +05:00
Pavel Labath 6aa60b0514 [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.
2019-11-12 14:39:47 +01:00
Pavel Labath 1dfb1a85e7 [lldb] Fix some warnings in the python plugin 2019-11-12 14:39:34 +01:00
Alex Denisov 5022a5fcae 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
2019-11-12 14:24:12 +01:00
Tim Northover 44e5879f0f AArch64: add arm64_32 support to Clang. 2019-11-12 12:45:18 +00:00
Michał Górny 77cc246412 [lldb] [Process/NetBSD] Use PT_STOP to stop the process [NFCI]
Differential Revision: https://reviews.llvm.org/D70060
2019-11-12 12:35:02 +01:00
Florian Hahn 636412bf31 [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
2019-11-12 11:29:04 +00:00
Diana Picus 7f1dcc8952 [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
2019-11-12 12:27:09 +01:00
Simon Pilgrim 8794f67876 [X86] Cleanup prefixes + regenerate for fp-intrinsics-fma.ll 2019-11-12 11:24:00 +00:00
Simon Pilgrim 6da34a8b84 FileCheckPattern::FindRegexVarEnd - make helper function static. NFC
Fixes cppcheck warning.
2019-11-12 11:14:19 +00:00
Simon Pilgrim 002625113b [X86] Add PR39464 addcarry/subborrow test cases
Additional coverage for D70079
2019-11-12 11:14:18 +00:00
Tatyana Krasnukha 3130a88137 [lldb][test] Macros in expressions require DWARF 5 2019-11-12 13:58:06 +03:00
Florian Hahn 1ee93240c0 [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
2019-11-12 10:30:51 +00:00
Raphael Isemann ec4c96d685 [lldb][NFC] Simplify a return in ThreadPlanStepInRange::DefaultShouldStopHereCallback
We know should_stop_here is false here, so we might as well return false directly.
2019-11-12 10:58:54 +01:00