platform/upstream/llvm.git
5 years ago[ELF][RISCV] Allow PT_LOAD to have overlapping p_offset ranges on EM_RISCV
Fangrui Song [Wed, 28 Aug 2019 12:06:06 +0000 (12:06 +0000)]
[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

5 years ago[clangd] Fix SelectionTree to allow selection range expression in foreach loops.
Sam McCall [Wed, 28 Aug 2019 12:05:12 +0000 (12:05 +0000)]
[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

5 years ago[TargetLowering] Add buildLegalVectorShuffle facility to help build legal shuffles
Amaury Sechet [Wed, 28 Aug 2019 12:00:06 +0000 (12:00 +0000)]
[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

5 years ago[DAGCombine] Remove LoadedSlice::Cost default 'ForCodeSize' constructor arguments...
Simon Pilgrim [Wed, 28 Aug 2019 11:50:36 +0000 (11:50 +0000)]
[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

5 years agogn build: Merge r370187
Nico Weber [Wed, 28 Aug 2019 11:42:20 +0000 (11:42 +0000)]
gn build: Merge r370187

llvm-svn: 370188

5 years ago[ARM] Move MVEVPTBlockPass to a separate file. NFC
David Green [Wed, 28 Aug 2019 11:37:31 +0000 (11:37 +0000)]
[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

5 years ago[lldb][NFC] Test custom C++ operators
Raphael Isemann [Wed, 28 Aug 2019 11:18:47 +0000 (11:18 +0000)]
[lldb][NFC] Test custom C++ operators

llvm-svn: 370186

5 years ago[lldb] Fix and test completion for ambiguous long options
Raphael Isemann [Wed, 28 Aug 2019 10:17:23 +0000 (10:17 +0000)]
[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

5 years ago[MVE] VMOVX patterns
David Green [Wed, 28 Aug 2019 10:13:23 +0000 (10:13 +0000)]
[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

5 years ago[mach-o] Extend LC_DATA_IN_CODE support to x86_64
Rui Ueyama [Wed, 28 Aug 2019 10:11:50 +0000 (10:11 +0000)]
[mach-o] Extend LC_DATA_IN_CODE support to x86_64

Patch by LemonBoy

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

llvm-svn: 370183

5 years ago[ELF][AMDGPU][SPARC] Allow PT_LOAD to have overlapping p_offset ranges on EM_AMDGPU...
Fangrui Song [Wed, 28 Aug 2019 09:45:06 +0000 (09:45 +0000)]
[ELF][AMDGPU][SPARC] Allow PT_LOAD to have overlapping p_offset ranges on EM_AMDGPU and EM_SPARCV9

llvm-svn: 370180

5 years ago[lldb][NFC] Get rid of C-strings in HandleOptionCompletion
Raphael Isemann [Wed, 28 Aug 2019 09:32:30 +0000 (09:32 +0000)]
[lldb][NFC] Get rid of C-strings in HandleOptionCompletion

llvm-svn: 370179

5 years ago[clangd] Surface errors from command-line parsing
Ilya Biryukov [Wed, 28 Aug 2019 09:24:55 +0000 (09:24 +0000)]
[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

5 years ago[LLVM-C] Fix ByVal Attribute crashing
Hans Wennborg [Wed, 28 Aug 2019 09:21:56 +0000 (09:21 +0000)]
[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

5 years agoDelete minimize_source_to_dependency_directives_invalid_error.c
Hans Wennborg [Wed, 28 Aug 2019 09:14:00 +0000 (09:14 +0000)]
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

5 years ago[lldb][NFC] Update documentation of Handle[Argument]Completion
Raphael Isemann [Wed, 28 Aug 2019 09:02:32 +0000 (09:02 +0000)]
[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

5 years ago[LV] Fold tail by masking - handle reductions
Ayal Zaks [Wed, 28 Aug 2019 09:02:23 +0000 (09:02 +0000)]
[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

5 years ago[ELF][RISCV] Assign st_shndx of __global_pointer$ to 1 if .sdata does not exist
Fangrui Song [Wed, 28 Aug 2019 09:01:03 +0000 (09:01 +0000)]
[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

5 years ago[ARM][ParallelDSP] Change search for muls
Sam Parker [Wed, 28 Aug 2019 08:51:13 +0000 (08:51 +0000)]
[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

5 years ago[NFC] Unbreak tests
David Bolvansky [Wed, 28 Aug 2019 08:42:40 +0000 (08:42 +0000)]
[NFC] Unbreak tests

llvm-svn: 370170

5 years ago[NFC] Updated test
David Bolvansky [Wed, 28 Aug 2019 08:40:45 +0000 (08:40 +0000)]
[NFC] Updated test

llvm-svn: 370169

5 years agoAnnotate return values of allocation functions with dereferenceable_or_null
David Bolvansky [Wed, 28 Aug 2019 08:28:20 +0000 (08:28 +0000)]
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

5 years ago[llvm-objdump] Add the missing ARMv8 subarch detection
Yi Kong [Wed, 28 Aug 2019 06:37:22 +0000 (06:37 +0000)]
[llvm-objdump] Add the missing ARMv8 subarch detection

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

llvm-svn: 370163

5 years ago[LoopFusion] Fix another -Wunused-function in -DLLVM_ENABLE_ASSERTIONS=off build
Fangrui Song [Wed, 28 Aug 2019 03:12:40 +0000 (03:12 +0000)]
[LoopFusion] Fix another -Wunused-function in -DLLVM_ENABLE_ASSERTIONS=off build

llvm-svn: 370156

5 years ago[clang-doc] Use llvm::createStringError and canonicalize error messages
Fangrui Song [Wed, 28 Aug 2019 02:56:03 +0000 (02:56 +0000)]
[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

5 years ago[compiler-rt] Don't use libcxx if it's not enabled by LLVM_ENABLE_PROJECTS
Vitaly Buka [Wed, 28 Aug 2019 02:41:14 +0000 (02:41 +0000)]
[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

5 years agoUpdate name of objc runtime SPI function we call for class names.
Jason Molenda [Wed, 28 Aug 2019 02:14:07 +0000 (02:14 +0000)]
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

5 years agoFixup build of clang-interpreter example after change in r370122.
Douglas Yung [Wed, 28 Aug 2019 02:13:24 +0000 (02:13 +0000)]
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

5 years agoAMDGPU/GlobalISel: Fix constraining scalar and/or/xor
Matt Arsenault [Wed, 28 Aug 2019 02:11:03 +0000 (02:11 +0000)]
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

5 years ago[libomptarget] Refactor syncwarp macro to inline function
Jon Chesterfield [Wed, 28 Aug 2019 02:02:53 +0000 (02:02 +0000)]
[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

5 years agoFix build break due to close brace lost in merge
Jon Chesterfield [Wed, 28 Aug 2019 01:56:26 +0000 (01:56 +0000)]
Fix build break due to close brace lost in merge

llvm-svn: 370148

5 years agoRevert r370105 - Update two x86 datalayouts for r370083, looks like racing commits
Richard Trieu [Wed, 28 Aug 2019 01:55:06 +0000 (01:55 +0000)]
Revert r370105 - Update two x86 datalayouts for r370083, looks like racing commits

r370083 has been reverted, which this change depends on.

llvm-svn: 370147

5 years ago[libomptarget] Refactor shfl_down_sync macro to inline function
Jon Chesterfield [Wed, 28 Aug 2019 01:47:41 +0000 (01:47 +0000)]
[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

5 years ago[test] Speculative fix for r369966 on llvm-clang-x86_64-win
Vedant Kumar [Wed, 28 Aug 2019 01:39:36 +0000 (01:39 +0000)]
[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

5 years ago[libomptarget] Refactor shfl_sync macro to inline function
Jon Chesterfield [Wed, 28 Aug 2019 01:31:04 +0000 (01:31 +0000)]
[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

5 years ago[Clang][Bundler] Do not require host triple for extracting device bundles
Sergey Dmitriev [Wed, 28 Aug 2019 01:26:13 +0000 (01:26 +0000)]
[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

5 years agoRevert "Change the X86 datalayout to add three address spaces for 32 bit signed,"
Vlad Tsyrklevich [Wed, 28 Aug 2019 01:08:54 +0000 (01:08 +0000)]
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

5 years agoFix "commas at the end of enumerator lists are a C99-specific"
Vitaly Buka [Wed, 28 Aug 2019 01:04:50 +0000 (01:04 +0000)]
Fix "commas at the end of enumerator lists are a C99-specific"

llvm-svn: 370141

5 years agoAMDGPU/GlobalISel: Implement addrspacecast for 32-bit constant addrspace
Matt Arsenault [Wed, 28 Aug 2019 00:58:24 +0000 (00:58 +0000)]
AMDGPU/GlobalISel: Implement addrspacecast for 32-bit constant addrspace

llvm-svn: 370140

5 years ago[lit] Fix the way we check if an environment var is set
Jonas Devlieghere [Wed, 28 Aug 2019 00:52:08 +0000 (00:52 +0000)]
[lit] Fix the way we check if an environment var is set

The old method would throw a KeyError.

llvm-svn: 370138

5 years ago[test] Disable TestConcurrentManySignals on Darwin.
Jonas Devlieghere [Wed, 28 Aug 2019 00:35:37 +0000 (00:35 +0000)]
[test] Disable TestConcurrentManySignals on Darwin.

This test is flaky on GreenDragon. Disable it until we figure out why.

llvm-svn: 370136

5 years ago[lit] Don't set DYLD_LIBRARY_PATH when DYLD_INSERT_LIBRARIES is set.
Jonas Devlieghere [Wed, 28 Aug 2019 00:32:19 +0000 (00:32 +0000)]
[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

5 years ago[ObjC] Fix type checking for qualified id block parameters.
Volodymyr Sapsai [Wed, 28 Aug 2019 00:25:06 +0000 (00:25 +0000)]
[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

5 years agoRe-land [clang-scan-deps] Minimizer: Correctly handle multi-line content with CR...
Alexandre Ganea [Wed, 28 Aug 2019 00:04:06 +0000 (00:04 +0000)]
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

5 years ago[NFC] Assert preconditions and merge all users into one codepath in Loads.cpp
Philip Reames [Tue, 27 Aug 2019 23:36:31 +0000 (23:36 +0000)]
[NFC] Assert preconditions and merge all users into one codepath in Loads.cpp

llvm-svn: 370128

5 years ago[lld][WebAssembly] Support for growable tables
Jacob Gravelle [Tue, 27 Aug 2019 22:58:21 +0000 (22:58 +0000)]
[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

5 years agoRevert "[lldb] Move redundant persistent variable counter to ClangPersistentVariables"
Adrian Prantl [Tue, 27 Aug 2019 22:50:40 +0000 (22:50 +0000)]
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

5 years ago[preprocessor] Add an opportunity to retain excluded conditional blocks
Evgeny Mankov [Tue, 27 Aug 2019 22:15:32 +0000 (22:15 +0000)]
[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

5 years agoArrayRef'ized CompilerInvocation::CreateFromArgs
Dmitri Gribenko [Tue, 27 Aug 2019 22:13:31 +0000 (22:13 +0000)]
ArrayRef'ized CompilerInvocation::CreateFromArgs

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 370122

5 years ago[sanitizer_common] Close superfluous file descriptors in spawned process
Julian Lettner [Tue, 27 Aug 2019 22:12:26 +0000 (22:12 +0000)]
[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

5 years ago[dotest] Remove check for LLDB_TESTSUITE_FORCE_FINISH
Jonas Devlieghere [Tue, 27 Aug 2019 21:59:24 +0000 (21:59 +0000)]
[dotest] Remove check for LLDB_TESTSUITE_FORCE_FINISH

llvm-svn: 370120

5 years ago[clang][Index][NFC] Move IndexDataConsumer default implementation
Jan Korous [Tue, 27 Aug 2019 21:49:39 +0000 (21:49 +0000)]
[clang][Index][NFC] Move IndexDataConsumer default implementation

llvm-svn: 370116

5 years ago[Clang][Bundler] Fix for a hang when unbundling fat binary
Sergey Dmitriev [Tue, 27 Aug 2019 21:47:52 +0000 (21:47 +0000)]
[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

5 years ago[InstCombine] Disable some portions of foldGEPICmp for GEPs that return a vector...
Craig Topper [Tue, 27 Aug 2019 21:38:56 +0000 (21:38 +0000)]
[InstCombine] Disable some portions of foldGEPICmp for GEPs that return a vector of pointers. Fix other portions.

llvm-svn: 370114

5 years ago[RISCV] Implement RISCVRegisterInfo::getPointerRegClass
Luis Marques [Tue, 27 Aug 2019 21:37:57 +0000 (21:37 +0000)]
[RISCV] Implement RISCVRegisterInfo::getPointerRegClass

Fixes bug 43041

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

llvm-svn: 370113

5 years ago[Analysis] Improve EmitGEPOffset handling of vector GEPs with scalar indices.
Craig Topper [Tue, 27 Aug 2019 21:31:44 +0000 (21:31 +0000)]
[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

5 years agoFix asan-symbolize-bad-path.cpp on Darwin
Alexander Richardson [Tue, 27 Aug 2019 21:10:47 +0000 (21:10 +0000)]
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

5 years ago[libc++] Add yet another test for inverted character classes
Louis Dionne [Tue, 27 Aug 2019 20:39:10 +0000 (20:39 +0000)]
[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

5 years agoDiagnose _Bool as a C99 extension.
Aaron Ballman [Tue, 27 Aug 2019 20:33:05 +0000 (20:33 +0000)]
Diagnose _Bool as a C99 extension.

llvm-svn: 370108

5 years agoDebug Info: Support for DW_AT_export_symbols for anonymous structs
Shafik Yaghmour [Tue, 27 Aug 2019 20:17:35 +0000 (20:17 +0000)]
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

5 years ago[Platform/Android] Read the adb server from an env variable if set
Nathan Lanza [Tue, 27 Aug 2019 20:00:02 +0000 (20:00 +0000)]
[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

5 years agoUpdate two x86 datalayouts for r370083, looks like racing commits
Reid Kleckner [Tue, 27 Aug 2019 19:55:10 +0000 (19:55 +0000)]
Update two x86 datalayouts for r370083, looks like racing commits

llvm-svn: 370105

5 years ago[GlobalISel] Replace hard coded dynamic alloca handling with G_DYN_STACKALLOC.
Amara Emerson [Tue, 27 Aug 2019 19:54:27 +0000 (19:54 +0000)]
[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

5 years ago[clangd] Add a distinct highlighting for local variables
Nathan Ridge [Tue, 27 Aug 2019 19:39:11 +0000 (19:39 +0000)]
[clangd] Add a distinct highlighting for local variables

Summary:
It's useful to be able to distinguish local variables from namespace
scope variables.

Reviewers: hokein, jvikstrom

Reviewed By: hokein

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

Tags: #clang

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

llvm-svn: 370103

5 years ago[Loads/SROA] Remove blatantly incorrect code and fix a bug revealed in the process
Philip Reames [Tue, 27 Aug 2019 19:34:43 +0000 (19:34 +0000)]
[Loads/SROA] Remove blatantly incorrect code and fix a bug revealed in the process

The code we had isSafeToLoadUnconditionally was blatantly wrong. This function takes a "Size" argument which is supposed to describe the span loaded from. Instead, the code use the size of the pointer passed (which may be unrelated!) and only checks that span. For any Size > LoadSize, this can and does lead to miscompiles.

Worse, the generic code just a few lines above correctly handles the cases which *are* valid. So, let's delete said code.

Removing this code revealed two issues:
1) As noted by jdoerfert the removed code incorrectly handled external globals.  The test update in SROA is to stop testing incorrect behavior.
2) SROA was confusing bytes and bits, but this wasn't obvious as the Size parameter was being essentially ignored anyway.  Fixed.

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

llvm-svn: 370102

5 years agoAMDGPU: Always emit amdgpu-flat-work-group-size
Matt Arsenault [Tue, 27 Aug 2019 19:25:40 +0000 (19:25 +0000)]
AMDGPU: Always emit amdgpu-flat-work-group-size

The backend default maximum should be the hardware maximum, so the
frontend should set the implementation defined default maximum.

llvm-svn: 370101

5 years agoDiagnose both _Complex and _Imaginary as C99 extensions.
Aaron Ballman [Tue, 27 Aug 2019 19:15:24 +0000 (19:15 +0000)]
Diagnose both _Complex and _Imaginary as C99 extensions.

llvm-svn: 370100

5 years agoDAG: computeNumSignBits for MUL
Matt Arsenault [Tue, 27 Aug 2019 19:05:33 +0000 (19:05 +0000)]
DAG: computeNumSignBits for MUL

Copied directly from the IR version.

Most of the testcases I've added for this are somewhat problematic
because they really end up testing the yet to be implemented version
for MUL_I24/MUL_U24.

llvm-svn: 370099

5 years agoAMDGPU: Add baseline test for num sign bits of mul
Matt Arsenault [Tue, 27 Aug 2019 19:01:02 +0000 (19:01 +0000)]
AMDGPU: Add baseline test for num sign bits of mul

llvm-svn: 370098

5 years ago[XCOFF][AIX] Generate symbol table entries with llvm-readobj
Jason Liu [Tue, 27 Aug 2019 18:54:46 +0000 (18:54 +0000)]
[XCOFF][AIX] Generate symbol table entries with llvm-readobj

Summary:

This patch implements main entry and auxiliary entries of symbol table generation for llvm-readobj on AIX.
The source code of aix_xcoff_xlc_test8.o (compile with xlc) is:

-bash-4.2$ cat test8.c
extern int i;
extern int TestforXcoff;
extern int fun(int i);
static int static_i;
char* p="abcd";
int fun1(int j) {
  static_i++;
  j++;
  j=j+*p;
  return j;
}
int main() {
  i++;
  fun(i);
  return fun1(i);
}

Patch provided by DiggerLin

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

llvm-svn: 370097

5 years agoRemove clang-tidy-vs from clang-tools-extra (PR41791)
Alex Lorenz [Tue, 27 Aug 2019 18:36:08 +0000 (18:36 +0000)]
Remove clang-tidy-vs from clang-tools-extra (PR41791)

The clang-tidy-vs visual studio plugin in clang-tools-extra contains a
security vulnerability in the YamlDotNet package [1]. I posted to cfe-dev [2],
asking if there was anyone who was interested in updating the the plugin
to address the vulnerability. Reid mentioned that Zach (the original committer),
said that there's another plugin (Clang Power Tools) that provides clang-tidy support,
with additional extra features, so it would be ok to remove clang-tidy-vs.

This commit removes the plugin to address the security vulnerability, and adds
a section to the release notes that mentions that the plugin was removed, and
suggests to use Clang Power Tools.

Fixes PR 41791.

[1]: https://nvd.nist.gov/vuln/detail/CVE-2018-1000210
[2]: http://lists.llvm.org/pipermail/cfe-dev/2019-August/063196.html

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

llvm-svn: 370096

5 years agoRevert Autogenerate the shebang lines for tools/opt-viewer
Reid Kleckner [Tue, 27 Aug 2019 18:31:29 +0000 (18:31 +0000)]
Revert Autogenerate the shebang lines for tools/opt-viewer

This reverts r369486 (git commit 8d18384809957cc923752e10a86adab129e3df48)

The opt-viewer tests don't pass after this change, and fixing them isn't
trivial. opt-viewer.py imports optmap, which requires adjusting
pythonpath, which is more work than I'm willing to do to fix forward.

llvm-svn: 370095

5 years agoAdd GWP-ASan fuzz target to compiler-rt/tools.
Mitch Phillips [Tue, 27 Aug 2019 18:28:07 +0000 (18:28 +0000)]
Add GWP-ASan fuzz target to compiler-rt/tools.

Summary:
@eugenis to approve addition of //compiler-rt/tools.
@pree-jackie please confirm that this WFY.

D66494 introduced the GWP-ASan stack_trace_compressor_fuzzer. Building fuzz
targets in compiler-rt is a new affair, and has some challenges:
- If the host compiler doesn't have compiler-rt, the -fsanitize=fuzzer may not
  be able to link against `libclang_rt.fuzzer*`.
- Things in compiler-rt generally aren't built when you want to build with
  sanitizers using `-DLLVM_USE_SANITIZER`. This tricky to work around, so
  we create the new tools directory so that we can build fuzz targets with
  sanitizers. This has the added bonus of fixing the problem above as well, as
  we can now just guard the fuzz target build to only be done with
  `-DLLVM_USE_SANITIZE_COVERAGE=On`.

Reviewers: eugenis, pree-jackie

Reviewed By: eugenis, pree-jackie

Subscribers: dberris, mgorny, #sanitizers, llvm-commits, eugenis, pree-jackie, lebedev.ri, vitalybuka, morehouse

Tags: #sanitizers, #llvm

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

llvm-svn: 370094

5 years ago[driver][xray] fix the macOS support checker by supporting -macos
Alex Lorenz [Tue, 27 Aug 2019 18:26:36 +0000 (18:26 +0000)]
[driver][xray] fix the macOS support checker by supporting -macos
triple in addition to -darwin

The previous check incorrectly checked for macOS support by
allowing -darwin triples only, and -macos triple was not supported.

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

llvm-svn: 370093

5 years ago[ORCv2] - New Speculate Query Implementation
Praveen Velliengiri [Tue, 27 Aug 2019 18:23:36 +0000 (18:23 +0000)]
[ORCv2] - New Speculate Query Implementation

Summary:
This patch introduces, SequenceBBQuery - new heuristic to find likely next callable functions it tries to find the blocks with calls in order of execution sequence of Blocks.

It still uses BlockFrequencyAnalysis to find high frequency blocks. For a handful of hottest blocks (plan to customize), the algorithm traverse and discovered the caller blocks along the way to Entry Basic Block and Exit Basic Block. It uses Block Hint, to stop traversing the already visited blocks in both direction. It implicitly assumes that once the block is visited during discovering entry or exit nodes, revisiting them again does not add much. It also branch probability info (cached result) to traverse only hot edges (planned to customize) from hot blocks. Without BPI, the algorithm mostly return's all the blocks in the CFG with calls.

It also changes the heuristic queries, so they don't maintain states. Hence it is safe to call from multiple threads.

It also implements, new instrumentation to avoid jumping into JIT on every call to the function with the help _orc_speculate.decision.block and _orc_speculate.block.

"Speculator Registration Mechanism is also changed" - kudos to @lhames

Open to review, mostly looking to change implementation of SequeceBBQuery heuristics with good data structure choices.

Reviewers: lhames, dblaikie

Reviewed By: lhames

Subscribers: mgorny, hiraditya, mgrang, llvm-commits, lhames

Tags: #speculative_compilation_in_orc, #llvm

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

llvm-svn: 370092

5 years ago[Tblgen][MCA] Add the ability to mark groups as LoadQueue and StoreQueue. NFCI
Andrea Di Biagio [Tue, 27 Aug 2019 18:20:34 +0000 (18:20 +0000)]
[Tblgen][MCA] Add the ability to mark groups as LoadQueue and StoreQueue. NFCI

Before this patch, users were not allowed to optionally mark processor resource
groups as load/store queues. That is because tablegen class MemoryQueue was
originally declared as expecting a ProcResource template argument (instead of a
more generic ProcResourceKind).

That was an oversight, since the original intention from D54957 was to let user
mark any processor resource as either load/store queue.  This patch adds the
ability to use processor resource groups in MemoryQueue definitions. This is not
a user visible change.

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

llvm-svn: 370091

5 years ago[dotest] Remove results port
Jonas Devlieghere [Tue, 27 Aug 2019 18:18:46 +0000 (18:18 +0000)]
[dotest] Remove results port

The results port was used by dosep.py to deal with test results coming
form different processes. With dosep.py gone, I don't think we need this
any longer.

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

llvm-svn: 370090

5 years agoAMDGPU: Add amdgpu-32bit-address-high-bits to MIR serialization
Matt Arsenault [Tue, 27 Aug 2019 18:18:38 +0000 (18:18 +0000)]
AMDGPU: Add amdgpu-32bit-address-high-bits to MIR serialization

llvm-svn: 370089

5 years ago[JITLink] Fix bogus TimerGroup constructor call.
Lang Hames [Tue, 27 Aug 2019 18:05:05 +0000 (18:05 +0000)]
[JITLink] Fix bogus TimerGroup constructor call.

llvm-svn: 370088

5 years agoMove EH spec mismatches under -fms-compatibility
Reid Kleckner [Tue, 27 Aug 2019 17:52:03 +0000 (17:52 +0000)]
Move EH spec mismatches under -fms-compatibility

-fms-extensions is intended to enable conforming language extensions and
-fms-compatibility is intended to language rule relaxations, so a user
could plausibly compile with -fno-ms-compatibility on Windows while
still using dllexport, for example.  This exception specification
validation behavior has been handled as a warning since before
-fms-compatibility was added in 2011. I think it's just an oversight
that it hasn't been moved yet.

This will help users find conformance issues in their code such as those
found in _com_ptr_t as described in https://llvm.org/PR42842.

Reviewers: hans

Subscribers: STL_MSFT, cfe-commits

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

llvm-svn: 370087

5 years agoAMDGPU: Fix crash from inconsistent register types for v3i16/v3f16
Matt Arsenault [Tue, 27 Aug 2019 17:51:56 +0000 (17:51 +0000)]
AMDGPU: Fix crash from inconsistent register types for v3i16/v3f16

This is something of a workaround since computeRegisterProperties
seems to be doing the wrong thing.

llvm-svn: 370086

5 years ago[ORC] NFC remove unimplemented query
Praveen Velliengiri [Tue, 27 Aug 2019 17:51:50 +0000 (17:51 +0000)]
[ORC] NFC remove unimplemented query

Summary: CFGWalk Query is unimplemented for valid reasons. But the declaration got included in commit file.

Reviewers: lhames, dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 370085

5 years agoRecommit "[GlobalISel] Import patterns containing INSERT_SUBREG"
Jessica Paquette [Tue, 27 Aug 2019 17:47:06 +0000 (17:47 +0000)]
Recommit  "[GlobalISel] Import patterns containing INSERT_SUBREG"

I thought `llvm::sort` was stable for some reason but it's not.

Use `llvm::stable_sort` in `CodeGenTarget::getSuperRegForSubReg`.

Original patch: https://reviews.llvm.org/D66498

llvm-svn: 370084

5 years agoChange the X86 datalayout to add three address spaces for 32 bit signed,
Amy Huang [Tue, 27 Aug 2019 17:46:53 +0000 (17:46 +0000)]
Change the X86 datalayout to add three address spaces for 32 bit signed,
32 bit unsigned, and 64 bit pointers.

llvm-svn: 370083

5 years agoUse FileEntryRef for PPCallbacks::HasInclude
Alex Lorenz [Tue, 27 Aug 2019 17:32:42 +0000 (17:32 +0000)]
Use FileEntryRef for PPCallbacks::HasInclude

This fixes the issue where a filename dependendency was missing if the file that
was referenced with __has_include() was accessed through a symlink in an earlier run,
if the file manager was reused between runs.

llvm-svn: 370081

5 years agoRevert "[GlobalISel] Import patterns containing INSERT_SUBREG"
Jessica Paquette [Tue, 27 Aug 2019 17:26:44 +0000 (17:26 +0000)]
Revert "[GlobalISel] Import patterns containing INSERT_SUBREG"

When EXPENSIVE_CHECKS are enabled, GlobalISelEmitterSubreg.td doesn't get
stable output.

Reverting while I debug it.

See: https://reviews.llvm.org/D66498
llvm-svn: 370080

5 years ago[X86] Remove encoding information from the TAILJMP instructions that are lowered...
Craig Topper [Tue, 27 Aug 2019 17:24:23 +0000 (17:24 +0000)]
[X86] Remove encoding information from the TAILJMP instructions that are lowered by MCInstLowering. Fix LowerPATCHABLE_TAIL_CALL to also convert them to regular JMP/JCC instructions

There are 5 instructions here that are converted from TAILJMP opcodes to regular JMP/JCC opcodes during MCInstLowering. So normally there encoding information isn't used. The exception being when XRay wraps them in PATCHABLE_TAIL_CALL.

For the ones that weren't already handled in MCInstLowering, add handling for those and remove their encoding information.

This patch fixes PATCHABLE_TAIL_CALL to do the same opcode conversion as the regular lowering patch. Then removes the encoding information.

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

llvm-svn: 370079

5 years ago[lldb] Fix x86 compilation
Tatyana Krasnukha [Tue, 27 Aug 2019 17:22:03 +0000 (17:22 +0000)]
[lldb] Fix x86 compilation

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

Patch by Leonid Mashinskiy

llvm-svn: 370078

5 years ago[JITLink] Add timers and -show-times option to llvm-jitlink.
Lang Hames [Tue, 27 Aug 2019 15:51:19 +0000 (15:51 +0000)]
[JITLink] Add timers and -show-times option to llvm-jitlink.

The timers track time spent loading objects, linking, and (if applicable)
running JIT-link'd code.

llvm-svn: 370075

5 years ago[JITLink][ORC] Track eh-frame section size for registration/deregistration.
Lang Hames [Tue, 27 Aug 2019 15:50:32 +0000 (15:50 +0000)]
[JITLink][ORC] Track eh-frame section size for registration/deregistration.

On MachO, processing of the eh-frame section should stop if the end of the
__eh_frame section is reached, regardless of whether or not there is a null CFI
length field at the end of the section. This patch tracks the eh-frame section
size and threads it through the appropriate APIs so that processing can be
terminated correctly.

No testcase yet: This patch is all API plumbing (rather than modification of
linked memory) which the existing infrastructure does not provide a way of
testing. Committing without a testcase until I have an idea of how to write
one.

llvm-svn: 370074

5 years ago[RISCV] Set MaxAtomicInlineWidth and MaxAtomicPromoteWidth for RV32/RV64 targets...
Sam Elliott [Tue, 27 Aug 2019 15:41:16 +0000 (15:41 +0000)]
[RISCV] Set MaxAtomicInlineWidth and MaxAtomicPromoteWidth for RV32/RV64 targets with atomics

Summary: This ensures that libcalls aren't generated when the target supports atomics. Atomics aren't in the base RV32I/RV64I instruction sets, so MaxAtomicInlineWidth and MaxAtomicPromoteWidth are set only when the atomics extension is being targeted. This must be done in setMaxAtomicWidth, as this should be done after handleTargetFeatures has been called.

Reviewers: jfb, jyknight, wmi, asb

Reviewed By: asb

Subscribers: pzheng, MaskRay, s.egerton, lenary, dexonsmith, psnobl, benna, Jim, JohnLLVM, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, lewis-revill, cfe-commits

Tags: #clang

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

llvm-svn: 370073

5 years ago[JITLink] Don't under-align zero-fill sections.
Lang Hames [Tue, 27 Aug 2019 15:22:23 +0000 (15:22 +0000)]
[JITLink] Don't under-align zero-fill sections.

If content sections have lower alignment than zero-fill sections then bump the
overall segment alignment to avoid under-aligning the zero-fill sections.

llvm-svn: 370072

5 years ago[DAGCombiner] cancel fnegs from multiplied operands of FMA
Sanjay Patel [Tue, 27 Aug 2019 15:17:46 +0000 (15:17 +0000)]
[DAGCombiner] cancel fnegs from multiplied operands of FMA

(-X) * (-Y) + Z --> X * Y + Z

This is a missing optimization that shows up as a potential regression in D66050,
so we should solve it first. We appear to be partly missing this fold in IR as well.

We do handle the simpler case already:
(-X) * (-Y) --> X * Y

And it might be beneficial to make the constraint less conservative (eg, if both
operands are cheap, but not necessarily cheaper), but that causes infinite looping
for the existing fmul transform.

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

llvm-svn: 370071

5 years agoHandle local commons for XCOFF object file writing
Jason Liu [Tue, 27 Aug 2019 15:14:45 +0000 (15:14 +0000)]
Handle local commons for XCOFF object file writing

Summary:
Adds support for emitting common local global symbols to an XCOFF object file.
Local commons are emitted into the .bss section with a storage class of
C_HIDEXT.

Patch by: daltenty

Reviewers: sfertile, hubert.reinterpretcast

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

llvm-svn: 370070

5 years agoRevert "[CodeGen] Do the Simple Early Return in block-placement pass to optimize...
Jinsong Ji [Tue, 27 Aug 2019 14:59:08 +0000 (14:59 +0000)]
Revert "[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks"

This reverts commit b3d258fc44b588f06eb35f8e4b9a6d1fc859acec.

@skatkov is reporting crash in D63972#1646303
Contacted @ZhangKang, and revert the commit on behalf of him.

llvm-svn: 370069

5 years agoUpdate the SARIF exporter to SARIF 2.1
Joe Ranieri [Tue, 27 Aug 2019 14:43:54 +0000 (14:43 +0000)]
Update the SARIF exporter to SARIF 2.1

This updates the SARIF exporter to produce SARIF 2.1 output. The bulk of the diffs come from two changes to SARIF:
* https://github.com/oasis-tcs/sarif-spec/issues/309
* https://github.com/oasis-tcs/sarif-spec/issues/179

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

llvm-svn: 370068

5 years ago[MIPS GlobalISel] ClampScalar G_SHL, G_ASHR and G_LSHR
Petar Avramovic [Tue, 27 Aug 2019 14:41:44 +0000 (14:41 +0000)]
[MIPS GlobalISel] ClampScalar G_SHL, G_ASHR and G_LSHR

ClampScalar G_SHL, G_ASHR and G_LSHR to s32 for MIPS32.

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

llvm-svn: 370067

5 years agoReplace some custom C11 extension warnings with the generic warning.
Aaron Ballman [Tue, 27 Aug 2019 14:41:39 +0000 (14:41 +0000)]
Replace some custom C11 extension warnings with the generic warning.

llvm-svn: 370066

5 years ago[GlobalISel] Factor narrowScalar for G_ASHR and G_LSHR. NFC
Petar Avramovic [Tue, 27 Aug 2019 14:33:05 +0000 (14:33 +0000)]
[GlobalISel] Factor narrowScalar for G_ASHR and G_LSHR. NFC

Main difference is in the way Hi for Long shift (HiL) is made.
G_LSHR fills HiL with zeros, while G_ASHR fills HiL with sign bit value.

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

llvm-svn: 370064

5 years ago[GlobalISel] Fix narrowScalar for shifts to match algorithm from SDAG
Petar Avramovic [Tue, 27 Aug 2019 14:22:32 +0000 (14:22 +0000)]
[GlobalISel] Fix narrowScalar for shifts to match algorithm from SDAG

Fix typos. Use Hi and Lo prefixes for Or instead of LHS and RHS
to match names of surrounding variables.

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

llvm-svn: 370062