Commit Graph

325454 Commits

Author SHA1 Message Date
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
Julian Lettner d3136661ba [sanitizer_common] Close superfluous file descriptors in spawned process
Use attribute flag `POSIX_SPAWN_CLOEXEC_DEFAULT` in the call to
`posix_spawn`.

If this flag is set, then only file descriptors explicitly described by
the file_actions argument are available in the spawned process; all of
the other file descriptors are automatically closed in the spawned
process.

POSIX_SPAWN_CLOEXEC_DEFAULT is an Apple-specific extension.

llvm-svn: 370121
2019-08-27 22:12:26 +00:00
Jonas Devlieghere 50c094a368 [dotest] Remove check for LLDB_TESTSUITE_FORCE_FINISH
llvm-svn: 370120
2019-08-27 21:59:24 +00:00
Jan Korous cfd641d84a [clang][Index][NFC] Move IndexDataConsumer default implementation
llvm-svn: 370116
2019-08-27 21:49:39 +00:00
Sergey Dmitriev 4368971b05 [Clang][Bundler] Fix for a hang when unbundling fat binary
clang-offload-bundler tool may hang under certain conditions when it extracts a subset of all available device bundles from the fat binary that is handled by the BinaryFileHandler. This patch fixes this problem.

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

llvm-svn: 370115
2019-08-27 21:47:52 +00:00
Craig Topper 5bbb604bb5 [InstCombine] Disable some portions of foldGEPICmp for GEPs that return a vector of pointers. Fix other portions.
llvm-svn: 370114
2019-08-27 21:38:56 +00:00
Luis Marques c894c6c983 [RISCV] Implement RISCVRegisterInfo::getPointerRegClass
Fixes bug 43041

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

llvm-svn: 370113
2019-08-27 21:37:57 +00:00
Craig Topper 33585ddf14 [Analysis] Improve EmitGEPOffset handling of vector GEPs with scalar indices.
This patch splats the scalar index if necessary before using it
in any integer casts or other arithmetic.

llvm-svn: 370112
2019-08-27 21:31:44 +00:00
Alexander Richardson 79f3459deb Fix asan-symbolize-bad-path.cpp on Darwin
I accidentally made the CHECK line stricter when committing D65322.
While it happens to work for Linux and FreeBSD, it broke on Darwin.
This commit restores the previous behaviour.

llvm-svn: 370110
2019-08-27 21:10:47 +00:00
Louis Dionne b5aefed40a [libc++] Add yet another test for inverted character classes
This was reported as part of a bug report that ended up being a
duplicate for r340609, but I'm adding the test case since it's
ever so slightly different from what we had before.

llvm-svn: 370109
2019-08-27 20:39:10 +00:00
Aaron Ballman 27e66bf710 Diagnose _Bool as a C99 extension.
llvm-svn: 370108
2019-08-27 20:33:05 +00:00
Shafik Yaghmour 528f5da6d8 Debug Info: Support for DW_AT_export_symbols for anonymous structs
This implements the DWARF 5 feature described in:

http://dwarfstd.org/ShowIssue.php?issue=141212.1

To support recognizing anonymous structs:

  struct A {
    struct { // Anonymous struct
        int y;
    };
  } a;

This patch adds support in CGDebugInfo::CreateLimitedType(...) for this new flag and an accompanying test to verify this feature.

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

llvm-svn: 370107
2019-08-27 20:17:35 +00:00
Nathan Lanza 0c01d92051 [Platform/Android] Read the adb server from an env variable if set
Summary:
The environment variable ANDROID_ADB_SERVER_PORT can be defined to have
adbd litsen on a different port. Teach lldb how to understand this via
simply checking the env var.

Reviewers: xiaobai, clayborg

Subscribers: srhines

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

llvm-svn: 370106
2019-08-27 20:00:02 +00:00
Reid Kleckner 06dc817852 Update two x86 datalayouts for r370083, looks like racing commits
llvm-svn: 370105
2019-08-27 19:55:10 +00:00
Amara Emerson e20b91c265 [GlobalISel] Replace hard coded dynamic alloca handling with G_DYN_STACKALLOC.
This change moves the actual stack pointer manipulation into the legalizer,
available to targets via lower(). The codegen is slightly different because
we're using explicit masks instead of G_PTRMASK, and using G_SUB rather than
adding a negative amount via G_GEP.

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

llvm-svn: 370104
2019-08-27 19:54:27 +00:00