Commit Graph

325468 Commits

Author SHA1 Message Date
Sam McCall 9004c077c0 [clang-tidy] readability-identifier-naming shouldn't complain about CRTP pseudo-overrides
Reviewers: ilya-biryukov

Subscribers: xazax.hun, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66864

llvm-svn: 370193
2019-08-28 12:08:57 +00:00
Fangrui Song 523f999acf [ELF][RISCV] Allow PT_LOAD to have overlapping p_offset ranges on EM_RISCV
Port the D64906 technique to RISC-V. It deletes 3 alignments at
PT_LOAD boundaries for the default case: the size of a RISC-V binary
decreases by at most 12kb.

llvm-svn: 370192
2019-08-28 12:06:06 +00:00
Sam McCall ab6594575a [clangd] Fix SelectionTree to allow selection range expression in foreach loops.
Reviewers: hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66869

llvm-svn: 370191
2019-08-28 12:05:12 +00:00
Amaury Sechet 4f4387dd12 [TargetLowering] Add buildLegalVectorShuffle facility to help build legal shuffles
Summary: There are at least 2 ways to express the same shuffle. Various pieces of code explicit check for both option, but other places do not when they would benefit from doing it. This patches refactor the codebase to use buildLegalVectorShuffle in order to make that behavior more consistent.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66804

llvm-svn: 370190
2019-08-28 12:00:06 +00:00
Simon Pilgrim c5b38e2869 [DAGCombine] Remove LoadedSlice::Cost default 'ForCodeSize' constructor arguments. NFCI.
These were always being passed in and it allowed me to add the explicit tag to stop a cppcheck warning about 1 argument constructors.

llvm-svn: 370189
2019-08-28 11:50:36 +00:00
Nico Weber d2f5854567 gn build: Merge r370187
llvm-svn: 370188
2019-08-28 11:42:20 +00:00
David Green 379f6186dd [ARM] Move MVEVPTBlockPass to a separate file. NFC
This just pulls the MVEVPTBlockPass into a separate file, as opposed to being
wrapped up in Thumb2ITBlockPass.

Differential revision: https://reviews.llvm.org/D66579

llvm-svn: 370187
2019-08-28 11:37:31 +00:00
Raphael Isemann f0ad3e4093 [lldb][NFC] Test custom C++ operators
llvm-svn: 370186
2019-08-28 11:18:47 +00:00
Raphael Isemann efb8b7b1ec [lldb] Fix and test completion for ambiguous long options
The refactoring patch for the option completion broke the completion
for ambiguous long options. As this feature was also untested (as
testing ambiguous options with the current test methods is impossible),
I just noticed now. This patch restores the old behavior and adds a
test for this feature.

llvm-svn: 370185
2019-08-28 10:17:23 +00:00
David Green 1c5b143c99 [MVE] VMOVX patterns
This adds fp16 VMOVX patterns, using the same patterns as rL362482 with some
adjustments for MVE. It allows us to move fp16 registers without going into and
out of gprs.

VMOVX is able to move the top bits from a fp16 in a fp reg into the bottom bits
of another register, zeroing the rest. This can be used for odd MVE register
lanes. The top bits are not read by fp16 instructions, so no move is required
there if we are dealing with even lanes.

Differential revision: https://reviews.llvm.org/D66793

llvm-svn: 370184
2019-08-28 10:13:23 +00:00
Rui Ueyama 91864f82c7 [mach-o] Extend LC_DATA_IN_CODE support to x86_64
Patch by LemonBoy

Differential Revision: https://reviews.llvm.org/D62185

llvm-svn: 370183
2019-08-28 10:11:50 +00:00
Fangrui Song 54a6f6839b [ELF][AMDGPU][SPARC] Allow PT_LOAD to have overlapping p_offset ranges on EM_AMDGPU and EM_SPARCV9
llvm-svn: 370180
2019-08-28 09:45:06 +00:00
Raphael Isemann ac5a475b53 [lldb][NFC] Get rid of C-strings in HandleOptionCompletion
llvm-svn: 370179
2019-08-28 09:32:30 +00:00
Ilya Biryukov d73ac96d80 [clangd] Surface errors from command-line parsing
Summary:
Those errors are exposed at the first character of a file,
for a lack of a better place.

Previously, all errors were stored inside the AST and report
accordingly. However, errors in command-line argument parsing could
result in failure to produce the AST, so we need an alternative ways to
report those errors.

We take the following approach in this patch:
  - buildCompilerInvocation() now requires an explicit DiagnosticConsumer.
  - TUScheduler and TestTU now collect the diagnostics produced when
    parsing command line arguments.
    If pasing of the AST failed, diagnostics are reported via a new
    ParsingCallbacks::onFailedAST method.
    If parsing of the AST succeeded, any errors produced during
    command-line parsing are stored alongside the AST inside the
    ParsedAST instance and reported as previously by calling the
    ParsingCallbacks::onMainAST method;
  - The client code that uses ClangdServer's DiagnosticConsumer
    does not need to change, it will receive new diagnostics in the
    onDiagnosticsReady() callback

Errors produced when parsing command-line arguments are collected using
the same StoreDiags class that is used to collect all other errors. They
are recognized by their location being invalid. IIUC, the location is
invalid as there is no source manager at this point, it is created at a
later stage.

Although technically we might also get diagnostics that mention the
command-line arguments FileID with after the source manager was created
(and they have valid source locations), we choose to not handle those
and they are dropped as not coming from the main file. AFAICT, those
diagnostics should always be notes, therefore it's safe to drop them
without loosing too much information.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: nridge, javed.absar, MaskRay, jkorous, arphaman, cfe-commits, gribozavr

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66759

llvm-svn: 370177
2019-08-28 09:24:55 +00:00
Hans Wennborg 0af82068a8 [LLVM-C] Fix ByVal Attribute crashing
With the introduction of the typed byval attribute change there was no
way that the LLVM-C API could create the correct class Attribute. If a
program that uses the C API creates a ByVal attribute and annotates a
function with that attribute LLVM will crash when it assembles or write
that module containing the function out as bitcode.

This change is a minimal fix to at least allow code to work, this is
because the byval change is on the 9.0 and I don't want to introduce new
LLVM-C API this late in the release cycle.

By Jakob Bornecrantz!

Differential revision: https://reviews.llvm.org/D66144

llvm-svn: 370176
2019-08-28 09:21:56 +00:00
Hans Wennborg 248abe2b66 Delete minimize_source_to_dependency_directives_invalid_error.c
It was added in r370129 with a .gitattributes file that means the file
always shows up as having a local diff in Git checkouts (at least on
Linux). Deleting it until we can figure out the right way to do this.

llvm-svn: 370175
2019-08-28 09:14:00 +00:00
Raphael Isemann 9774a2ba27 [lldb][NFC] Update documentation of Handle[Argument]Completion
We no longer have return values or any of the mentioned arguments
in these functions since the introduction of CompletionRequest.

llvm-svn: 370174
2019-08-28 09:02:32 +00:00
Ayal Zaks d15df0ede5 [LV] Fold tail by masking - handle reductions
Allow vectorizing loops that have reductions when tail is folded by masking.
A select is introduced in VPlan, choosing between the last value carried by the
loop-exit/live-out instruction of the reduction, and the penultimate value
carried by the reduction phi, according to the "i < n" mask of fold-tail.
This select replaces the last value as the live-out value of the loop.

Differential Revision: https://reviews.llvm.org/D66720

llvm-svn: 370173
2019-08-28 09:02:23 +00:00
Fangrui Song 8fbe81fb29 [ELF][RISCV] Assign st_shndx of __global_pointer$ to 1 if .sdata does not exist
This essentially reverts the code change of D63132 and switches to a simpler approach.

In an executable/shared object, st_shndx of a symbol can be:

1) SHN_UNDEF: undefined symbol (or canonical PLT)
2) SHN_ABS: absolute symbol
3) any other value (usually a regular section index) represents a relative symbol.
  The actual value does not matter.

Many ld.so (musl, all archs except MIPS of FreeBSD rtld-elf) even treat 2) and 3)
the same. If .sdata does not exist, it does not matter what value/section
__global_pointer$ has, as long as it is relative (otherwise there will be a pedantic
lld error. See D63132). Just set the st_shndx arbitrarily to 1.

Dummy st_shndx=1 may be used by __rela_iplt_start, linker-script-defined symbols outside a section, __dso_handle, etc.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D66798

llvm-svn: 370172
2019-08-28 09:01:03 +00:00
Sam Parker a761ba0f2d [ARM][ParallelDSP] Change search for muls
rL369567 reverted a couple of recent changes made to ARMParallelDSP
because of a miscompilation error: PR43073.

The issue stemmed from an underlying bug that was caused by adding
muls into a reduction before it was proved that they could be executed
in parallel with another mul.

Most of the changes here are from the previously reverted commits.
The additional changes have been made area:
1) The Search function now doesn't insert any muls into the Reduction
   object. That now happens once the search has successfully finished.
2) For any muls added into the reduction but that weren't paired, we
   accumulate their values as an input into the smlad.

Differential Revision: https://reviews.llvm.org/D66660

llvm-svn: 370171
2019-08-28 08:51:13 +00:00
David Bolvansky 207c653965 [NFC] Unbreak tests
llvm-svn: 370170
2019-08-28 08:42:40 +00:00
David Bolvansky a0a8dd225d [NFC] Updated test
llvm-svn: 370169
2019-08-28 08:40:45 +00:00
David Bolvansky 05bda8b4e5 Annotate return values of allocation functions with dereferenceable_or_null
Summary:
Example
define dso_local noalias i8* @_Z6maixxnv() local_unnamed_addr #0 {
entry:
  %call = tail call noalias dereferenceable_or_null(64) i8* @malloc(i64 64) #6
  ret i8* %call
}


Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: aaron.ballman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66651

llvm-svn: 370168
2019-08-28 08:28:20 +00:00
Yi Kong b9d87b9528 [llvm-objdump] Add the missing ARMv8 subarch detection
Differential Revision: https://reviews.llvm.org/D66849

llvm-svn: 370163
2019-08-28 06:37:22 +00:00
Fangrui Song 6964027315 [LoopFusion] Fix another -Wunused-function in -DLLVM_ENABLE_ASSERTIONS=off build
llvm-svn: 370156
2019-08-28 03:12:40 +00:00
Fangrui Song 180380651c [clang-doc] Use llvm::createStringError and canonicalize error messages
"Bad block found.\n" -> "bad block found"

The lower cased form with no full stop or newline is more common in LLVM
tools.

Reviewed By: juliehockett

Differential Revision: https://reviews.llvm.org/D66783

llvm-svn: 370155
2019-08-28 02:56:03 +00:00
Vitaly Buka acd8499028 [compiler-rt] Don't use libcxx if it's not enabled by LLVM_ENABLE_PROJECTS
This fixes sanitizer-x86_64-linux-fuzzer which switched to new layout and not it
can't link as libcxx is always there.
We should support and tests libcxx but still it was unexpected that libfuzzer
ignored LLVM_ENABLE_PROJECTS_USED.

llvm-svn: 370153
2019-08-28 02:41:14 +00:00
Jason Molenda deeda85f3f Update name of objc runtime SPI function we call for class names.
A new SPI was added to the objc runtime to get class names without
any demangling; AppleObjCRuntimeV2::ParseClassInfoArray was using
the original prototype name but had not been updated for the final
name yet, so lldb was falling back to the old function and doing
extra work for classes that were demangled.  This commit fixes that.

llvm-svn: 370152
2019-08-28 02:14:07 +00:00
Douglas Yung e816421087 Fixup build of clang-interpreter example after change in r370122.
This should fix the build failure on llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast.

llvm-svn: 370151
2019-08-28 02:13:24 +00:00
Matt Arsenault a8bbcbd006 AMDGPU/GlobalISel: Fix constraining scalar and/or/xor
If the result register already had a register class assigned, the
sources may not have been properly constrained.

llvm-svn: 370150
2019-08-28 02:11:03 +00:00
Jon Chesterfield be3d487313 [libomptarget] Refactor syncwarp macro to inline function
Summary:
[libomptarget] Refactor syncwarp macro to inline function
See also abandoned D66846, split into this diff and others.

Reviewers: jdoerfert, ABataev, grokos, ronlieb, gregrodgers

Subscribers: openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D66857

llvm-svn: 370149
2019-08-28 02:02:53 +00:00
Jon Chesterfield e73e3013a6 Fix build break due to close brace lost in merge
llvm-svn: 370148
2019-08-28 01:56:26 +00:00
Richard Trieu 1709f4847e Revert r370105 - Update two x86 datalayouts for r370083, looks like racing commits
r370083 has been reverted, which this change depends on.

llvm-svn: 370147
2019-08-28 01:55:06 +00:00
Jon Chesterfield 327aa81123 [libomptarget] Refactor shfl_down_sync macro to inline function
Summary:
[libomptarget] Refactor shfl_down_sync macro to inline function
See also abandoned D66846, split into this diff and others.

Reviewers: jdoerfert, ABataev, grokos, ronlieb, gregrodgers

Subscribers: openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D66853

llvm-svn: 370146
2019-08-28 01:47:41 +00:00
Vedant Kumar 4a44569cbd [test] Speculative fix for r369966 on llvm-clang-x86_64-win
Run the MIR pipeline in this test to completion to try and avoid a "Bad
machine code" error.

Build failure:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190826/688338.html

llvm-svn: 370145
2019-08-28 01:39:36 +00:00
Jon Chesterfield b9b712df82 [libomptarget] Refactor shfl_sync macro to inline function
Summary:
[libomptarget] Refactor shfl_sync macro to inline function
See also abandoned D66846, split into this diff and others.

Reviewers: jdoerfert, ABataev, grokos, ronlieb, gregrodgers

Subscribers: openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D66852

llvm-svn: 370144
2019-08-28 01:31:04 +00:00
Sergey Dmitriev 60a99f4964 [Clang][Bundler] Do not require host triple for extracting device bundles
Bundler currently requires host triple to be provided no matter if you are performing bundling or unbundling, but for unbundling operation such requirement is too restrictive. You may for example want to examine device part of the object for a particular offload target, but you have to extract host part as well even though you do not need it. Host triple isn't really needed for unbundling, so this patch removes that requirement.

Differential Revision: https://reviews.llvm.org/D66601

llvm-svn: 370143
2019-08-28 01:26:13 +00:00
Vlad Tsyrklevich 57076d3199 Revert "Change the X86 datalayout to add three address spaces for 32 bit signed,"
This reverts commit r370083 because it caused check-lld failures on
sanitizer-x86_64-linux-fast.

llvm-svn: 370142
2019-08-28 01:08:54 +00:00
Vitaly Buka 712a9b02c0 Fix "commas at the end of enumerator lists are a C99-specific"
llvm-svn: 370141
2019-08-28 01:04:50 +00:00
Matt Arsenault 5c7e96dc26 AMDGPU/GlobalISel: Implement addrspacecast for 32-bit constant addrspace
llvm-svn: 370140
2019-08-28 00:58:24 +00:00
Jonas Devlieghere eb0df9b285 [lit] Fix the way we check if an environment var is set
The old method would throw a KeyError.

llvm-svn: 370138
2019-08-28 00:52:08 +00:00
Jonas Devlieghere de37c444ef [test] Disable TestConcurrentManySignals on Darwin.
This test is flaky on GreenDragon. Disable it until we figure out why.

llvm-svn: 370136
2019-08-28 00:35:37 +00:00
Jonas Devlieghere 1fcdcd09bc [lit] Don't set DYLD_LIBRARY_PATH when DYLD_INSERT_LIBRARIES is set.
Setting DYLD_INSERT_LIBRARIES to the Asan runtime and DYLD_LIBRARY_PATH
to the LLVM shared library dir causes the test suite to crash with a
segfault. We see this on the LLDB sanitized bot [1] on GreenDragon. I've
spent some time investigating, but I'm not sure what's going on (yet).

Originally I thought this was because we were building compiler-rt and
were loading an incompatible, just-built Asan library. However, the
issue persists even without compiler-rt. It doesn't look like the Asan
runtime is opening any other libraries that might be found in LLVM's
shared library dir and talking to the team confirms that. Another
possible explanation is that we're loading lldb form a place we don't
expect, but that doesn't make sense either, because DYLD_LIBRARY_PATH is
always set without the crash. I tried different Python versions and
interpreters but the issue persist.

As a (temporary?) workaround I propose not setting DYLD_LIBRARY_PATH
when DYLD_INSERT_LIBRARIES is set so we can turn the Asan bot on again
and get useful results.

[1] http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-sanitized/

Differential revision: https://reviews.llvm.org/D66845

llvm-svn: 370135
2019-08-28 00:32:19 +00:00
Volodymyr Sapsai 73152a2ec2 [ObjC] Fix type checking for qualified id block parameters.
When checking if block types are compatible, we are checking for
compatibility their return types and parameters' types. As these types
have different variance, we need to check them in different order.

rdar://problem/52788423

Reviewers: erik.pilkington, arphaman

Reviewed By: arphaman

Subscribers: jkorous, dexonsmith, ributzka, cfe-commits

Differential Revision: https://reviews.llvm.org/D66831

llvm-svn: 370130
2019-08-28 00:25:06 +00:00
Alexandre Ganea 57b4e107e4 Re-land [clang-scan-deps] Minimizer: Correctly handle multi-line content with CR+LF line endings
Previously, an #error directive with quoted, multi-line content, along with CR+LF line endings wasn't handled correctly.

Differential Revision: https://reviews.llvm.org/D66556

llvm-svn: 370129
2019-08-28 00:04:06 +00:00
Philip Reames 93a26ec98d [NFC] Assert preconditions and merge all users into one codepath in Loads.cpp
llvm-svn: 370128
2019-08-27 23:36:31 +00:00
Jacob Gravelle 92ed86d239 [lld][WebAssembly] Support for growable tables
Adds --growable-table flag to handle building wasm modules with tables
that can grow.

Wasm tables that we use to store function pointers. In order to add functions
to that table at runtime, we need to either preallocate space, or grow the table.
In order to specify a table with no maximum size, we need some flag to handle
that case, separately from a potential --max-table-size= flag.

Note that the number of elements in the table isn't knowable until link-time,
so it's unclear if we will want a --max-table-size= flag in the future.

llvm-svn: 370127
2019-08-27 22:58:21 +00:00
Adrian Prantl 29db51dad4 Revert "[lldb] Move redundant persistent variable counter to ClangPersistentVariables"
This reverts commit r367842 since it wasn't quite as NFC as advertised
and broke Swift support.  See https://reviews.llvm.org/D46083 for the
rationale behind the original functionality.

rdar://problem/54619322

llvm-svn: 370126
2019-08-27 22:50:40 +00:00
Evgeny Mankov 2ed2e62498 [preprocessor] Add an opportunity to retain excluded conditional blocks
It is handy for clang tooling, for instance, in source to source transformation.

Reviewers: vpykhtin (Valery Pykhtin), erichkeane (Erich Keane)

Subscribers: rsmith (Richard Smith), akyrtzi (Argyrios Kyrtzidis)

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66597

llvm-svn: 370123
2019-08-27 22:15:32 +00:00
Dmitri Gribenko 1fac68b0dc ArrayRef'ized CompilerInvocation::CreateFromArgs
Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66797

llvm-svn: 370122
2019-08-27 22:13:31 +00:00