platform/upstream/llvm.git
4 years ago[AArch64] Remove overlapping scheduling definitions (NFC)
Evandro Menezes [Thu, 24 Oct 2019 16:37:01 +0000 (11:37 -0500)]
[AArch64] Remove overlapping scheduling definitions (NFC)

The scheduling definitions for ASIMD transpose and zipping overlapped with
others a few lines below.  Somehow, they didn't raise errors before.

There seem to be other overlapping definitions.  Somehow, they still don't
raise errors.

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

4 years agoRevert "[NFC] Rename LLVM_NO_DEAD_STRIP"
David Tenty [Wed, 30 Oct 2019 18:56:20 +0000 (14:56 -0400)]
Revert "[NFC] Rename LLVM_NO_DEAD_STRIP"

This reverts commit 11c2a85db8849db1a5907e80d9966592248ef825.

4 years ago[globalisel][docs] Fix a label that was renamed
Daniel Sanders [Wed, 30 Oct 2019 18:47:12 +0000 (11:47 -0700)]
[globalisel][docs] Fix a label that was renamed

4 years ago[PowerPC][AIX] Adds support for writing the data section in object files
jasonliu [Wed, 30 Oct 2019 18:31:31 +0000 (18:31 +0000)]
[PowerPC][AIX] Adds support for writing the data section in object files

Adds support for generating the XCOFF data section in object files for global variables with initialization.

Merged aix-xcoff-common.ll into aix-xcoff-data.ll.

Changed variable name charr to chrarray in the test case to test if readobj works with 8-character names.

Authored by: xingxue

Reviewers: hubert.reinterptrtcast, sfertile, jasonliu, daltenty, Xiangling_L.

Reviewed by: hubert.reinterpretcast, sfertile, daltenty.

Subscribers: DiggerLin, Wuzish, nemanjai, hiraditya, MaskRay, jsji, shchenz, llvm-commits

Tags: #llvm

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

4 years ago[DebugInfo][DAG] Distinguish different kinds of location indirection
Jeremy Morse [Wed, 30 Oct 2019 18:34:44 +0000 (18:34 +0000)]
[DebugInfo][DAG] Distinguish different kinds of location indirection

From SelectionDAGs point of view, debug variable locations specified with
dbg.declare and dbg.addr are indirect -- they specify the address of
something. But calling conventions might mean that a Value is placed on
the stack somewhere, and this too is indirection. Previously this was
mixed up in the "IsIndirect" field of DBG_VALUE insts; this patch
separates them by encoding the indirection in a DIExpression.

If we have a dbg.declare or dbg.addr, then the expression produces an
address that then becomes a DWARF memory location. We can represent
this by putting a DW_OP_deref on the _end_ of the expression. If a Value
has been placed on the stack, then we need to put a DW_OP_deref on the
_start_ of the expression, to load the Value from the stack and have
the rest of the expression operate on it.

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

4 years ago[LegacyPassManager] Delete BasicBlockPass/Manager.
Alina Sbirlea [Wed, 30 Oct 2019 18:19:06 +0000 (11:19 -0700)]
[LegacyPassManager] Delete BasicBlockPass/Manager.

Summary:
Delete the BasicBlockPass and BasicBlockManager, all its dependencies and update documentation.
The BasicBlockManager was improperly tested and found to be potentially broken, and was deprecated as of rL373254.

In light of the switch to the new pass manager coming before the next release, this patch is a first cleanup of the LegacyPassManager.

Reviewers: chandlerc, echristo

Subscribers: mehdi_amini, sanjoy.google, llvm-commits

Tags: #llvm

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

4 years ago[X86] Add FIXME comment to merge more of computeZeroableShuffleElements and getTarget...
Simon Pilgrim [Wed, 30 Oct 2019 18:26:30 +0000 (18:26 +0000)]
[X86] Add FIXME comment to merge more of computeZeroableShuffleElements and getTargetShuffleAndZeroables

4 years ago[X86][SSE] combineX86ShuffleChain - use resolveZeroablesFromTargetShuffle helper...
Simon Pilgrim [Wed, 30 Oct 2019 18:25:32 +0000 (18:25 +0000)]
[X86][SSE] combineX86ShuffleChain - use resolveZeroablesFromTargetShuffle helper. NFCI.

4 years ago[sanitizer_common] Create max_allocation_size_mb flag.
Matt Morehouse [Wed, 30 Oct 2019 18:17:56 +0000 (11:17 -0700)]
[sanitizer_common] Create max_allocation_size_mb flag.

Summary:
The flag allows the user to specify a maximum allocation size that the
sanitizers will honor.  Any larger allocations will return nullptr or
crash depending on allocator_may_return_null.

Reviewers: kcc, eugenis

Reviewed By: kcc, eugenis

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years agoFix readability-identifier-naming to prevent variables becoming keywords.
Daniel [Wed, 30 Oct 2019 18:15:47 +0000 (14:15 -0400)]
Fix readability-identifier-naming to prevent variables becoming keywords.

Do not provide a fix-it when clang-tidy encounters a name that would become
a keyword.

4 years ago[MSP430] fix typo in test name; NFC
Sanjay Patel [Wed, 30 Oct 2019 18:15:25 +0000 (14:15 -0400)]
[MSP430] fix typo in test name; NFC

4 years ago[MSP430] adjust tests for Shift Amount Threshold; NFC
Sanjay Patel [Wed, 30 Oct 2019 18:11:55 +0000 (14:11 -0400)]
[MSP430] adjust tests for Shift Amount Threshold; NFC

Baseline results for D69120.

Patch by: @joanlluch (Joan LLuch)

4 years agoAdd an option to hicpp-signed-bitwise for positive integer literals.
Vladimir Plyashkun [Wed, 30 Oct 2019 18:07:49 +0000 (14:07 -0400)]
Add an option to hicpp-signed-bitwise for positive integer literals.

This gives developers a way to deviate from the coding standard to reduce the
chattiness of the check.

4 years agoMove this release note to its appropriate location; NFC.
Aaron Ballman [Wed, 30 Oct 2019 17:48:26 +0000 (13:48 -0400)]
Move this release note to its appropriate location; NFC.

4 years agoFix modernize-use-nodiscard for classes marked [[nodiscard]]
Aaron Ballman [Wed, 30 Oct 2019 17:44:18 +0000 (13:44 -0400)]
Fix modernize-use-nodiscard for classes marked [[nodiscard]]

Current implementation suggests to add [[nodiscard]] to methods even if the
return type is marked already as [[nodiscard]].

Patch by Eugene Sedykh.

4 years agogn build: Merge 29dc0b17de6
LLVM GN Syncbot [Wed, 30 Oct 2019 17:40:59 +0000 (17:40 +0000)]
gn build: Merge 29dc0b17de6

4 years agoFix a false positive in misc-redundant-expression check
Aaron Ballman [Wed, 30 Oct 2019 17:35:20 +0000 (13:35 -0400)]
Fix a false positive in misc-redundant-expression check

Do not warn for redundant conditional expressions when the true and false
branches are expanded from different macros even when they are defined by
one another.

Patch by Daniel Krupp.

4 years ago[SLP] Vectorize jumbled stores.
Alexey Bataev [Tue, 15 Oct 2019 14:32:17 +0000 (10:32 -0400)]
[SLP] Vectorize jumbled stores.

Summary:
Patch adds support for vectorization of the jumbled stores. The value
operands are vectorized and then shuffled in the right order before
store.

Reviewers: RKSimon, spatel, hfinkel, mkuper

Subscribers: llvm-commits

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

4 years ago[NFC] Move this set of STRICT_* cases to be next to the non-strict cases.
Kevin P. Neal [Wed, 30 Oct 2019 17:29:07 +0000 (13:29 -0400)]
[NFC] Move this set of STRICT_* cases to be next to the non-strict cases.

Requested by Cameron McInally in D69275.

4 years agoAdd the readability-redundant-access-specifiers check.
Aaron Ballman [Wed, 30 Oct 2019 17:26:41 +0000 (13:26 -0400)]
Add the readability-redundant-access-specifiers check.

This finds redundant access specifier declarations inside classes, structs, and unions.

Patch by Mateusz Mackowski.

4 years ago[AMDGPU] Simplify VCCZ bug handling
Jay Foad [Wed, 30 Oct 2019 13:47:32 +0000 (13:47 +0000)]
[AMDGPU] Simplify VCCZ bug handling

Summary:
VCCZBugHandledSet was used to make sure we don't apply the same
workaround more than once to a single cbranch instruction, but it's not
necessary because the workaround involves inserting an s_waitcnt
instruction, which is enough for subsequent iterations to detect that no
further workaround is necessary.

Also beef up the test case to check that the workaround was only applied
once. I have also manually verified that the test still passes even if I
hack the big do-while loop in runOnMachineFunction to run a minimum of
five iterations.

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[clang][driver][flang] Mark test as unsupported on darwin
Peter Waller [Wed, 30 Oct 2019 16:57:40 +0000 (16:57 +0000)]
[clang][driver][flang] Mark test as unsupported on darwin

D63607 made mac builders unhappy by failing this test, and it isn't
yet obvious why. Mark as unsupported as a temporary measure.

Signed-off-by: Peter Waller <peter.waller@arm.com>
4 years ago[LLDB][Python] warning fix for LLDBSwigPythonBreakpointCallbackFunction
Lawrence D'Anna [Wed, 30 Oct 2019 03:07:08 +0000 (20:07 -0700)]
[LLDB][Python] warning fix for LLDBSwigPythonBreakpointCallbackFunction

This is a quick followup to this commit:

https://reviews.llvm.org/rGa69bbe02a2352271e8b14542073f177e24c499c1

In that, I #pragma-squelch this warning in `ScriptInterpreterPython.cpp`
but we get the same warning in `PythonTestSuite.cpp`.

This patch squelches the same warning in the same way as the
reviweed commit.   I'm submitting it without review under the
"obviously correct" rule.

At least if this is incorrect the main commit was also incorrect.

By the way, as far as I can tell, these functions are extern "C" because
SWIG does that to everything, not because they particularly need to be.

4 years ago[LLDB][PythonFile] fix dangerous borrow semantics on python2
Lawrence D'Anna [Wed, 30 Oct 2019 16:45:13 +0000 (09:45 -0700)]
[LLDB][PythonFile] fix dangerous borrow semantics on python2

Summary:
It is inherently unsafe to allow a python program to manipulate borrowed
memory from a python object's destructor.     It would be nice to
flush a borrowed file when python is finished with it, but it's not safe
to do on python 2.

Python 3 does not suffer from this issue.

Reviewers: labath, mgorny

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[NFC][MachineOutliner] Fix typo in comment
David Tellenbach [Wed, 30 Oct 2019 16:28:11 +0000 (16:28 +0000)]
[NFC][MachineOutliner] Fix typo in comment

4 years ago[nfc][libomptarget] Move named_sync() into target_impl
Jon Chesterfield [Wed, 30 Oct 2019 13:39:49 +0000 (13:39 +0000)]
[nfc][libomptarget] Move named_sync() into target_impl

Summary: [nfc][libomptarget] Move named_sync() into target_impl

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: ABataev

Subscribers: openmp-commits

Tags: #openmp

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

4 years ago[ELF][test] Change references of %T to %t.dir
Fangrui Song [Tue, 29 Oct 2019 17:17:22 +0000 (10:17 -0700)]
[ELF][test] Change references of %T to %t.dir

Test files in the same directory share the same %T.  %T is easy to
misuse and cause race conditions (when running concurrently) so it has
been deprecated since D48842 (see docs/CommandGuide/lit.rst).

While here, add `rm -rf %t.dir` so that tests cannot depend on old files lying around.

Reviewed By: jhenderson, ruiu

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

4 years agoFix pattern error for S2_tstbit_i instruction
Ikhlas Ajbar [Mon, 7 Oct 2019 05:13:48 +0000 (00:13 -0500)]
Fix pattern error for S2_tstbit_i instruction

It used to generate S2_tstbit_i with constant -33 which resulted in an assert.
The reason is log2_32 was called with 64bit value 0.

4 years ago[SLPVectorizer] Use getAPInt() for comparison. NFCI.
Simon Pilgrim [Wed, 30 Oct 2019 16:15:56 +0000 (16:15 +0000)]
[SLPVectorizer] Use getAPInt() for comparison. NFCI.

Technically integers can assert on getZExtValue() if beyond i64 range, and a fuzzer usually find this.....

4 years ago[scudo][standalone] Add a free list to the Secondary
Kostya Kortchinsky [Tue, 29 Oct 2019 16:30:50 +0000 (09:30 -0700)]
[scudo][standalone] Add a free list to the Secondary

Summary:
The secondary allocator is slow, because we map and unmap each block
on allocation and deallocation.

While I really like the security benefits of such a behavior, this
yields very disappointing performance numbers on Android for larger
allocation benchmarks.

So this change adds a free list to the secondary, that will hold
recently deallocated chunks, and (currently) release the extraneous
memory. This allows to save on some memory mapping operations on
allocation and deallocation. I do not think that this lowers the
security of the secondary, but can increase the memory footprint a
little bit (RSS & VA).

The maximum number of blocks the free list can hold is templatable,
`0U` meaning that we fallback to the old behavior. The higher that
number, the higher the extra memory footprint.

I added default configurations for all our platforms, but they are
likely to change in the near future based on needs and feedback.

Reviewers: hctim, morehouse, cferris, pcc, eugenis, vitalybuka

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years agoUpdating the documentation for the _Noreturn attribute; NFC.
Aaron Ballman [Wed, 30 Oct 2019 15:36:44 +0000 (11:36 -0400)]
Updating the documentation for the _Noreturn attribute; NFC.

4 years ago[LLD] - Fix a test after obj2yaml change.
Georgii Rymar [Wed, 30 Oct 2019 15:28:52 +0000 (18:28 +0300)]
[LLD] - Fix a test after obj2yaml change.

I am not sure why obj2yaml is used to check the linkers output,
but anyways, the format was changed in https://reviews.llvm.org/rG6e779e953e9d.

4 years agogn build: (manually) merge 67474c60d34
Nico Weber [Wed, 30 Oct 2019 15:22:39 +0000 (11:22 -0400)]
gn build: (manually) merge 67474c60d34

4 years ago[AIX] Lowering CPI/JTI/BA to MIR
Xiangling Liao [Wed, 30 Oct 2019 14:31:37 +0000 (10:31 -0400)]
[AIX] Lowering CPI/JTI/BA to MIR

Enable lowering of constant pool index, jump table index, and bloack address to MIR on AIX.

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

4 years ago[AArch64][MachineOutliner] Return address signing for outlined functions
David Tellenbach [Wed, 30 Oct 2019 14:11:51 +0000 (14:11 +0000)]
[AArch64][MachineOutliner] Return address signing for outlined functions

Summary:
During AArch64 frame lowering instructions to enable return address
signing are inserted into function if needed. Functions generated during
machine outlining don't run through target frame lowering and hence are
missing such instructions.

This patch introduces the following changes:

  1. If not all functions that potentially participate in function outlining
     agree on their return address signing scope and their return address
     signing key, outlining is disabled for these functions.
  2. If not all functions that potentially participate in function outlining
     agree on their support for v8.3A features, outlining is disabled for
     these functions.
  2. If all candidate functions agree on the signing scope, signing key and
     and their support for v8.3 features, the outlined function behaves as
     if it had the same scope and key attributes and as if it would provide
     the same v8.3A support as the original functions.

Reviewers: olista01, paquette, t.p.northover, ostannard

Reviewed By: ostannard

Subscribers: ostannard, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SelectionDAG] Add support for FP_ROUND in WidenVectorOperand.
Jay Foad [Wed, 23 Oct 2019 13:22:16 +0000 (14:22 +0100)]
[SelectionDAG] Add support for FP_ROUND in WidenVectorOperand.

Summary:
This is used on AMDGPU for rounding from v3f64 (which is illegal) to
v3f32 (which is legal).

Subscribers: jvesely, nhaehnle, tpr, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[ObjectYAML] - Redefine LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex*) as LLVM_YAML_I...
Georgii Rymar [Tue, 29 Oct 2019 11:40:30 +0000 (14:40 +0300)]
[ObjectYAML] - Redefine LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex*) as LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR.

I am using it in https://reviews.llvm.org/D69399.

This change changes how obj2yaml dumps arrays of `llvm::yaml::Hex8/llvm::yaml::Hex16/llvm::yaml::Hex32`
from:

```
PayloadBytes:
- 0x01
- 0x02
...
```

To

```
PayloadBytes:    [ 0x01, 0x02, ... ]
```

The latter way is shorter and looks better for arrays.

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

4 years ago[bugpoint] Reduce metadata that does not contribute to crash.
Florian Hahn [Wed, 30 Oct 2019 14:30:42 +0000 (14:30 +0000)]
[bugpoint] Reduce metadata that does not contribute to crash.

Add a new reducer that drops metadata that does not contribute to the
crash from instructions.

It adjusts the metadata.ll test case, as now also the instruction level
metadata will get dropped.

Reviewers: davide, reames, modocache

Reviewed By: reames

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

4 years ago[NFC][LoopUnroll] Tests for peeling of first iteration (PR43840)
Roman Lebedev [Wed, 30 Oct 2019 14:27:13 +0000 (17:27 +0300)]
[NFC][LoopUnroll] Tests for peeling of first iteration (PR43840)

4 years ago[OpenMP] Reset affinity mask in the process child on FreeBSD
David Carlier [Wed, 30 Oct 2019 14:51:22 +0000 (14:51 +0000)]
[OpenMP] Reset affinity mask in the process child on FreeBSD

Reviewers: dim, chandlerc, jdoerfert

Reviewed By: dim

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

4 years ago[OPENMP][DOC]Provide correct info about supported features, NFC.
Alexey Bataev [Wed, 30 Oct 2019 14:38:11 +0000 (10:38 -0400)]
[OPENMP][DOC]Provide correct info about supported features, NFC.

Removed the explicit list of supported features from OpenMP 5.0 and used
the reference to the table instead. Also, fixed info about constructs
that can be executed in SPMD mode, if and num_threads clauses do not
affect it anymore.

4 years ago[OPENMP][DOC]Update list of supported functions, NFC.
Alexey Bataev [Wed, 30 Oct 2019 14:32:08 +0000 (10:32 -0400)]
[OPENMP][DOC]Update list of supported functions, NFC.

Added support for parallel master taskloop simd construct.

4 years ago[OPENMP50]Add support for parallel master taskloop simd directive.
Alexey Bataev [Fri, 25 Oct 2019 14:27:13 +0000 (10:27 -0400)]
[OPENMP50]Add support for parallel master taskloop simd directive.

Added full support for parallel master taskloop simd directive.

4 years ago[compiler-rt] libhwasan interceptor ABI intercept longjmp/setjmp
David Tellenbach [Wed, 30 Oct 2019 14:04:40 +0000 (14:04 +0000)]
[compiler-rt] libhwasan interceptor ABI intercept longjmp/setjmp

Summary:
The hwasan interceptor ABI doesn't have interceptors for longjmp and setjmp.
This patch introduces them.

We require the size of the jmp_buf on the platform to be at least as large as
the jmp_buf in our implementation. To enforce this we compile
hwasan_type_test.cpp that ensures a compile time failure if this is not true.

Tested on both GCC and clang using an AArch64 virtual machine.

Reviewers: eugenis, kcc, pcc, Sanatizers

Reviewed By: eugenis, Sanatizers

Tags: #sanatizers, #llvm

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

Patch By: Matthew Malcomson <matthew.malcomson@arm.com>

4 years ago[IR] Allow fast math flags on calls with floating point array type.
Jay Foad [Thu, 17 Oct 2019 08:25:23 +0000 (09:25 +0100)]
[IR] Allow fast math flags on calls with floating point array type.

Summary:
This extends the rules for when a call instruction is deemed to be an
FPMathOperator, which is based on the type of the call (i.e. the return
type of the function being called). Previously we only allowed
floating-point and vector-of-floating-point types. Now we also allow
arrays (nested to any depth) of floating-point and
vector-of-floating-point types.

This was motivated by llpc, the pipeline compiler for AMD GPUs
(https://github.com/GPUOpen-Drivers/llpc). llpc has many math library
functions that operate on vectors, typically represented as <4 x float>,
and some that operate on matrices, typically represented as
[4 x <4 x float>], and it's useful to be able to decorate calls to all
of them with fast math flags.

Reviewers: spatel, wristow, arsenm, hfinkel, aemerson, efriedma, cameron.mcinally, mcberg2017, jmolloy

Subscribers: wdng, llvm-commits

Tags: #llvm

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

4 years ago[ASTImporter] Add support for BuiltinTemplateDecl
Raphael Isemann [Wed, 30 Oct 2019 13:50:35 +0000 (14:50 +0100)]
[ASTImporter] Add support for BuiltinTemplateDecl

Summary:
That decl kind is currently not implemented. BuiltinTemplateDecl is for decls that are hardcoded in the
ASTContext, so we can import them like we do other builtin decls by just taking the equivalent
decl from the target ASTContext.

Reviewers: martong, a.sidorin, shafik

Reviewed By: martong, shafik

Subscribers: rnkovacs, kristina, cfe-commits

Tags: #clang

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

4 years agoLiveIntervals: Split live intervals on multiple dead defs
Krzysztof Parzyszek [Wed, 30 Oct 2019 13:21:27 +0000 (08:21 -0500)]
LiveIntervals: Split live intervals on multiple dead defs

This is a follow-up to D67448.

Split live intervals with multiple dead defs during the initial
execution of the live interval analysis, but do it outside of the
function createAndComputeVirtRegInterval.

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

4 years agominidump: Rename some architecture constants
Pavel Labath [Wed, 30 Oct 2019 13:31:57 +0000 (14:31 +0100)]
minidump: Rename some architecture constants

The architecture enum contains two kinds of contstants: the "official" ones
defined by Microsoft, and unofficial constants added by breakpad to cover the
architectures not described by the first ones.

Up until now, there was no big need to differentiate between the two. However,
now that Microsoft has defined
https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
a constant for ARM64, we have a name clash.

This patch renames all breakpad-defined constants with to include the prefix
"BP_". This frees up the name "ARM64", which I'll re-introduce with the new
"official" value in a follow-up patch.

Reviewers: amccarth, clayborg

Subscribers: lldb-commits, llvm-commits

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

4 years ago[nfc][libomptarget] Move smid() into target_impl
Jon Chesterfield [Wed, 30 Oct 2019 13:37:46 +0000 (13:37 +0000)]
[nfc][libomptarget] Move smid() into target_impl

Summary: [nfc][libomptarget] Move smid() into target_impl

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: ABataev

Subscribers: openmp-commits

Tags: #openmp

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

4 years ago[libomptarget] Always call malloc, free via SafeMalloc, SafeFree wrapper
Jon Chesterfield [Wed, 30 Oct 2019 13:31:56 +0000 (13:31 +0000)]
[libomptarget] Always call malloc, free via SafeMalloc, SafeFree wrapper

Summary:
[libomptarget] Always call malloc, free via SafeMalloc, SafeFree wrapper

NFC for release, adds some verbosity to debug printing. Motivation is to provide
one place where local modifications can be made to the behaviour of all heap
allocation or deallocation while debugging.

Reviewers: jdoerfert, ABataev, grokos

Reviewed By: ABataev

Subscribers: openmp-commits

Tags: #openmp

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

4 years agoRename a flang test case
Jeremy Morse [Wed, 30 Oct 2019 13:24:55 +0000 (13:24 +0000)]
Rename a flang test case

On Windows and macOS, the filesystem is case insensitive, and these files
interfere with each other. Reading through, the case of the file extension
is part of the test. I've altered the rest of the name instead.

4 years agolldb-vscode: Add a forgotten cast to void
Pavel Labath [Wed, 30 Oct 2019 13:27:26 +0000 (14:27 +0100)]
lldb-vscode: Add a forgotten cast to void

"git push" works even with a dirty working tree. :/

4 years ago[lldb-vscod] fix build with NDEBUG on windows
SquallATF [Wed, 30 Oct 2019 13:20:21 +0000 (14:20 +0100)]
[lldb-vscod] fix build with NDEBUG on windows

Summary: _setmode in assert will not run when build with NDEBUG

Reviewers: mstorsjo, labath, amccarth

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

4 years agoCOFF: Set section permissions
Pavel Labath [Wed, 16 Oct 2019 15:16:41 +0000 (17:16 +0200)]
COFF: Set section permissions

Summary:
This enables us to reason about whether a given address can be
executable, for instance during unwinding.

Reviewers: amccarth, mstorsjo

Subscribers: lldb-commits

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

4 years ago[ARM][AArch64][DebugInfo] Improve call site instruction interpretation
Djordje Todorovic [Wed, 30 Oct 2019 10:04:53 +0000 (11:04 +0100)]
[ARM][AArch64][DebugInfo] Improve call site instruction interpretation

Extend the describeLoadedValue() with support for target specific ARM and
AArch64 instructions interpretation. The patch provides specialization for
ADD and SUB operations that include a register and an immediate/offset
operand. Some of the instructions can operate with global string addresses
or constant pool indexes but such cases are omitted since we currently lack
flexible support for processing such operands at DWARF production stage.

Patch by Nikola Prica

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

4 years ago[lldb] [test] Mark TestCustomShell XFAIL on *bsd as well
Michał Górny [Wed, 30 Oct 2019 12:26:13 +0000 (13:26 +0100)]
[lldb] [test] Mark TestCustomShell XFAIL on *bsd as well

All *BSD targets do not implement ShellExpandArguments, so mark
the test appropriately.

4 years ago[AArch64][SVE] Implement masked store intrinsics
Kerry McLaughlin [Wed, 30 Oct 2019 11:44:29 +0000 (11:44 +0000)]
[AArch64][SVE] Implement masked store intrinsics

Summary:
Adds support for codegen of masked stores, with non-truncating
and truncating variants.

Reviewers: huntergr, greened, dmgreen, rovka, sdesmalen

Reviewed By: dmgreen, sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[X86] combineOrShiftToFunnelShift - use isOperationLegalOrCustom to check FSHL/FSHR...
Simon Pilgrim [Wed, 30 Oct 2019 11:39:18 +0000 (11:39 +0000)]
[X86] combineOrShiftToFunnelShift - use isOperationLegalOrCustom to check FSHL/FSHR support

Remove hard wired legality check.

4 years ago[X86] combineOrShiftToFunnelShift - use getShiftAmountTy instead of hardwiring to...
Simon Pilgrim [Wed, 30 Oct 2019 11:27:25 +0000 (11:27 +0000)]
[X86] combineOrShiftToFunnelShift - use getShiftAmountTy instead of hardwiring to MVT::i8

4 years ago[AArch64][SVE] Implement additional integer arithmetic intrinsics
Kerry McLaughlin [Wed, 30 Oct 2019 11:13:49 +0000 (11:13 +0000)]
[AArch64][SVE] Implement additional integer arithmetic intrinsics

Summary:
Add intrinsics for the following:
  - sxt[b|h|w] & uxt[b|h|w]
  - cls & clz
  - not & cnot

Reviewers: huntergr, sdesmalen, dancgr

Reviewed By: sdesmalen

Subscribers: cameron.mcinally, tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[AMDGPU] Consolidate one more getGeneration check
Jay Foad [Tue, 29 Oct 2019 17:11:21 +0000 (17:11 +0000)]
[AMDGPU] Consolidate one more getGeneration check

This one should have been done in r363902 when hasReadVCCZBug was
introduced.

4 years agogn build: Merge 6bf55804924
LLVM GN Syncbot [Wed, 30 Oct 2019 10:43:37 +0000 (10:43 +0000)]
gn build: Merge 6bf55804924

4 years ago[clang][driver] Add basic --driver-mode=flang support for fortran
Peter Waller [Mon, 10 Jun 2019 13:12:43 +0000 (14:12 +0100)]
[clang][driver] Add basic --driver-mode=flang support for fortran

This patch adds a new Flang mode. When in Flang mode, the driver will
invoke flang for fortran inputs instead of falling back to the GCC
toolchain as it would otherwise do.

The behaviour of other driver modes are left unmodified to preserve
backwards compatibility.

It is intended that a soon to be implemented binary in the flang project
will import libclangDriver and run the clang driver in the new flang
mode.

Please note that since the binary invoked by the driver is under
development, there will no doubt be further tweaks necessary in future
commits.

* Initial support is added for basic driver phases
  * -E, -fsyntax-only, -emit-llvm -S, -emit-llvm, -S, (none specified)
  * -### tests are added for all of the above
  * This is more than is supported by f18 so far, which will emit errors
    for those options which are unimplemented.

* A test is added that ensures that clang gives a reasonable error
  message if flang is not available in the path (without -###).

* Test that the driver accepts multiple inputs in --driver-mode=flang.

* Test that a combination of C and Fortran inputs run both clang and
  flang in --driver-mode=flang.

* clang/test/Driver/fortran.f95 is fixed to use the correct fortran
  comment character.

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

4 years ago[llvm-objcopy] - Do not crash on object that has relocations but no symbol table.
Georgii Rymar [Mon, 28 Oct 2019 09:52:28 +0000 (12:52 +0300)]
[llvm-objcopy] - Do not crash on object that has relocations but no symbol table.

It was revealed by D69260.

Tool crashed when scanned relocations in a object without a symbol table.
This patch teaches it either to handle such objects (when relocations
does not use symbols we do not need a symbol table to proceed)
or to show an appropriate error otherwise.

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

4 years agoEnable OpenBSD support.
AndreyChurbanov [Wed, 30 Oct 2019 09:35:53 +0000 (12:35 +0300)]
Enable OpenBSD support.

Patch by devnexen (David CARLIER)

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

4 years ago[UpdateTestChecks] Fix invalid python string escapes
Alex Richardson [Wed, 30 Oct 2019 09:35:10 +0000 (09:35 +0000)]
[UpdateTestChecks] Fix invalid python string escapes

4 years ago[Alignment] Use Align for TFI.getStackAlignment() in X86ISelLowering
Guillaume Chatelet [Wed, 30 Oct 2019 09:13:15 +0000 (10:13 +0100)]
[Alignment] Use Align for TFI.getStackAlignment() in X86ISelLowering

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, craig.topper, rnk

Reviewed By: rnk

Subscribers: rnk, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[update_cc_test_checks.py] Fix invalid python string escape sequence
Alex Richardson [Wed, 30 Oct 2019 09:17:29 +0000 (09:17 +0000)]
[update_cc_test_checks.py] Fix invalid python string escape sequence

This works with current python version but will be an error with 3.9

4 years ago[AddressSanitizer] Only instrument globals of default address space
Karl-Johan Karlsson [Wed, 30 Oct 2019 06:45:39 +0000 (07:45 +0100)]
[AddressSanitizer] Only instrument globals of default address space

The address sanitizer ignore memory accesses from different address
spaces, however when instrumenting globals the check for different
address spaces is missing. This result in assertion failure. The fault
was found in an out of tree target.

The patch skip all globals of non default address space.

Reviewed By: leonardchan, vitalybuka

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

4 years ago[PowerPC] Clear the sideeffect bit for those instructions that didn't have the match...
QingShan Zhang [Wed, 30 Oct 2019 07:56:35 +0000 (07:56 +0000)]
[PowerPC] Clear the sideeffect bit for those instructions that didn't have the match pattern

If the instruction have match pattern, llvm-tblgen will infer the sideeffect bit from the match pattern and it works well.
If not, the tblgen will set it as true that hurt the scheduling.

PowerPC has some instructions that didn't specify the match pattern(i.e. LXSD etc), which is manually selected post-ra according
to the register pressure. We need to clear the sideeffect flag for these instructions.

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

4 years ago[Target] Change PATCHABLE_EVENT_CALL/PATCHABLE_TYPED_EVENT_CALL to use unknown instea...
Craig Topper [Wed, 30 Oct 2019 07:35:20 +0000 (00:35 -0700)]
[Target] Change PATCHABLE_EVENT_CALL/PATCHABLE_TYPED_EVENT_CALL to use unknown instead of i8imm/i16imm/i32imm in its definition.

These instructions don't use immediates, they use registers. But
the register class needed is target specific. So just use unknown.

4 years ago[X86] Add test case for PR43758. NFC
Craig Topper [Wed, 30 Oct 2019 05:59:37 +0000 (22:59 -0700)]
[X86] Add test case for PR43758. NFC

4 years ago[llvm-objcopy] Add REQUIRES directive to fix a test
Seiya Nuta [Wed, 30 Oct 2019 07:08:24 +0000 (16:08 +0900)]
[llvm-objcopy] Add REQUIRES directive to fix a test

Buildbot failure log: http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/11164

4 years ago[X86] Make memcmp vector lowering handle arbitrary expansions
David Zarzycki [Mon, 28 Oct 2019 12:39:40 +0000 (14:39 +0200)]
[X86] Make memcmp vector lowering handle arbitrary expansions

Teach combineVectorSizedSetCCEquality() to handle arbitrary memcmp
expansions but do not change any default policy for now.

This also fixes a bug in the memcmp expansion itself when large
displacements are needed.

https://reviews.llvm.org/D69507

4 years ago[llvm-objcopy][MachO] Support indirect symbol table
Seiya Nuta [Wed, 30 Oct 2019 06:12:17 +0000 (15:12 +0900)]
[llvm-objcopy][MachO] Support indirect symbol table

Summary:
Parse the indirect symbol table and update the indexes of
symbol entries in the table in the writer in case they have
been changed.

Reviewers: alexshap, rupprecht, jhenderson

Reviewed By: alexshap, rupprecht

Subscribers: jakehehrlich, abrachet, llvm-commits

Tags: #llvm

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

4 years ago[Orc][test] Fix -DBUILD_SHARED_LIBS=on build
Fangrui Song [Wed, 30 Oct 2019 05:55:17 +0000 (22:55 -0700)]
[Orc][test] Fix -DBUILD_SHARED_LIBS=on build

4 years ago[lli-child-target] Fix -DBUILD_SHARED_LIBS=on build
Fangrui Song [Wed, 30 Oct 2019 05:46:13 +0000 (22:46 -0700)]
[lli-child-target] Fix -DBUILD_SHARED_LIBS=on build

4 years ago[lli] Fix -DBUILD_SHARED_LIBS=on build
Fangrui Song [Wed, 30 Oct 2019 05:37:28 +0000 (22:37 -0700)]
[lli] Fix -DBUILD_SHARED_LIBS=on build

This fixes:

  ld.lld: error: undefined symbol: vtable for llvm::orc::rpc::ResponseAbandoned
  >>> referenced by lli.cpp

In -DBUILD_SHARED_LIBS=on builds, all directly referenced references must
be linked to appease -Wl,-z,defs.

4 years agoRevert "[llvm-cov] Add option to whitelist filenames"
Vlad Tsyrklevich [Wed, 30 Oct 2019 05:38:38 +0000 (22:38 -0700)]
Revert "[llvm-cov] Add option to whitelist filenames"

This reverts commit bfed824b57d14e2ba98ddbaf1a1410cf04a3e279, the
included test fails on many bots including the sanitier bots, e.g. in
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36140

4 years ago[WebAssembly][lld] Fix for static linking of PIC code
Sam Clegg [Mon, 28 Oct 2019 22:24:52 +0000 (15:24 -0700)]
[WebAssembly][lld] Fix for static linking of PIC code

When statically linking PIC code we create an internalized __memory_base
so that memory-base-relative relocation work correctly.  The value of
this global should be zero, and not the globalBase since the globalBase
offset is already taken into account by getVirtualAddress.

Fixes: https://github.com/emscripten-core/emscripten/issues/9013

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

4 years agogn build: (manually) merge a34680a3
Nico Weber [Wed, 30 Oct 2019 01:50:16 +0000 (21:50 -0400)]
gn build: (manually) merge a34680a3

4 years ago[llvm-cov] Add option to whitelist filenames
Vedant Kumar [Tue, 29 Oct 2019 22:47:23 +0000 (15:47 -0700)]
[llvm-cov] Add option to whitelist filenames

Add the `-whitelist-filename-regex` option to restrict coverage
reporting to file paths that match a whitelist regex.

Patch by Michael Daniels!

rdar://56720320

4 years ago[lit] Refactor ordering of tests
Julian Lettner [Mon, 25 Feb 2019 05:49:42 +0000 (21:49 -0800)]
[lit] Refactor ordering of tests

4 years ago[ADT] add equality operator for SmallSet
Fedor Sergeev [Thu, 24 Oct 2019 19:24:44 +0000 (12:24 -0700)]
[ADT] add equality operator for SmallSet

Makes it easier to migrate existing code that uses std::set.

Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D69417

4 years agoBreak out OrcError and RPC
Chris Bieneman [Wed, 9 Oct 2019 21:27:52 +0000 (14:27 -0700)]
Break out OrcError and RPC

Summary:
When createing an ORC remote JIT target the current library split forces the target process to link large portions of LLVM (Core, Execution Engine, JITLink, Object, MC, Passes, RuntimeDyld, Support, Target, and TransformUtils). This occurs because the ORC RPC interfaces rely on the static globals the ORC Error types require, which starts a cycle of pulling in more and more.

This patch breaks the ORC RPC Error implementations out into an "OrcError" library which only depends on LLVM Support. It also pulls the ORC RPC headers into their own subdirectory.

With this patch code can include the Orc/RPC/*.h headers and will only incur link dependencies on LLVMOrcError and LLVMSupport.

Reviewers: lhames

Reviewed By: lhames

Subscribers: mgorny, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoSuppress useless GCC "bitfield is too small to hold all values of enum class" warning.
Richard Smith [Wed, 30 Oct 2019 00:05:40 +0000 (17:05 -0700)]
Suppress useless GCC "bitfield is too small to hold all values of enum class" warning.

4 years agoAMDGPU/GlobalISel: Legalize FDIV32
Austin Kerbow [Tue, 29 Oct 2019 16:55:49 +0000 (09:55 -0700)]
AMDGPU/GlobalISel: Legalize FDIV32

Reviewers: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

4 years ago[MS] Fix constexpr data member pointer conversions
Reid Kleckner [Tue, 29 Oct 2019 00:05:34 +0000 (17:05 -0700)]
[MS] Fix constexpr data member pointer conversions

Constexpr data member conversions work by starting with the class that
originally introduced the field, and converting from there to the type
that the user desires. Before this change, Clang was using the
inheritance model from the final destination class type instead of the
model from the class that originally introduced the field. To fix this,
find the relevant FieldDecl and take its parent class instead of using
the member pointer type the user provided.

Indirect field decls require some special handling to find the parent
class.

Fixes PR43803

4 years ago[lldbsuite] Remove unused test_event files
Jonas Devlieghere [Tue, 29 Oct 2019 23:35:28 +0000 (16:35 -0700)]
[lldbsuite] Remove unused test_event files

These files don't appear to be used anywhere and the corresponding tests
are not run.

4 years ago[lldbsuite] Remove the DumpFormatter
Jonas Devlieghere [Tue, 29 Oct 2019 23:30:37 +0000 (16:30 -0700)]
[lldbsuite] Remove the DumpFormatter

This formatter is never used or referenced.

4 years ago[lldbsuite] Remove pre_kill_hook package
Jonas Devlieghere [Tue, 29 Oct 2019 23:29:12 +0000 (16:29 -0700)]
[lldbsuite] Remove pre_kill_hook package

This package was only used by dosep.py which has since been removed.

4 years ago[lldbsuite] Remove unused support files
Jonas Devlieghere [Tue, 29 Oct 2019 23:26:49 +0000 (16:26 -0700)]
[lldbsuite] Remove unused support files

To the best of my understanding these files or their content is nowhere
referenced.

4 years ago[lit] Small improvements in cl_arguments.py
Julian Lettner [Thu, 21 Feb 2019 07:33:15 +0000 (23:33 -0800)]
[lit] Small improvements in cl_arguments.py

*) `--max-tests` should be positive integer
*) `--max-time` should be positive integer
*) Remove unnecessary defaults for command line option parsing

4 years agoThread safety analysis: Peel away NoOp implicit casts in initializers
Aaron Puchert [Tue, 29 Oct 2019 23:37:06 +0000 (00:37 +0100)]
Thread safety analysis: Peel away NoOp implicit casts in initializers

Summary:
This happens when someone initializes a variable with guaranteed copy
elision and an added const qualifier. Fixes PR43826.

Reviewers: aaron.ballman, rsmith

Reviewed By: aaron.ballman

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

4 years ago[LLD][ELF] Support --[no-]mmap-output-file with F_no_mmap
Nick Terrell [Tue, 29 Oct 2019 22:46:22 +0000 (15:46 -0700)]
[LLD][ELF] Support --[no-]mmap-output-file with F_no_mmap

Summary:
Add a flag `F_no_mmap` to `FileOutputBuffer` to support
`--[no-]mmap-output-file` in ELF LLD. LLD currently explicitly ignores
this flag for compatibility with GNU ld and gold.

We need this flag to speed up link time for large binaries in certain
scenarios. When we link some of our larger binaries we find that LLD
takes 50+ GB of memory, which causes memory pressure. The memory
pressure causes the VM to flush dirty pages of the output file to disk.
This is normally okay, since we should be flushing cold pages. However,
when using BtrFS with compression we need to write 128KB at a time when
we flush a page. If any page in that 128KB block is written again, then
it must be flushed a second time, and so on. Since LLD doesn't write
sequentially this causes write amplification. The same 128KB block will
end up being flushed multiple times, causing the linker to many times
more IO than necessary. We've observed 3-5x faster builds with
-no-mmap-output-file when we hit this scenario.

The bad scenario only applies to compressed filesystems, which group
together multiple pages into a single compressed block. I've tested
BtrFS, but the problem will be present for any compressed filesystem
on Linux, since it is caused by the VM.

Silently ignoring --no-mmap-output-file caused a silent regression when
we switched from gold to lld. We pass --no-mmap-output-file to fix this
edge case, but since lld silently ignored the flag we didn't realize it
wasn't being respected.

Benchmark building a 9 GB binary that exposes this edge case. I linked 3
times with --mmap-output-file and 3 times with --no-mmap-output-file and
took the average. The machine has 24 cores @ 2.4 GHz, 112 GB of RAM,
BtrFS mounted with -compress-force=zstd, and an 80% full disk.

| Mode    | Time  |
|---------|-------|
| mmap    | 894 s |
| no mmap | 126 s |

When compression is disabled, BtrFS performs just as well with and
without mmap on this benchmark.

I was unable to reproduce the regression with any binaries in
lld-speed-test.

Reviewed By: ruiu, MaskRay

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

4 years agoReplace std::function in PrintingPolicy with a callbacks object.
Richard Smith [Wed, 16 Oct 2019 00:51:08 +0000 (17:51 -0700)]
Replace std::function in PrintingPolicy with a callbacks object.

This makes PrintingPolicy significantly more lightweight and provides
groundwork for more printing customization hooks.

4 years ago[LLDB][breakpoints] ArgInfo::count -> ArgInfo::max_positional_args
Lawrence D'Anna [Tue, 29 Oct 2019 20:42:38 +0000 (13:42 -0700)]
[LLDB][breakpoints] ArgInfo::count -> ArgInfo::max_positional_args

Summary:
Move breakpoints from the old, bad ArgInfo::count to the new, better
ArgInfo::max_positional_args.   Soon ArgInfo::count will be no more.

It looks like this functionality is already well tested by
`TestBreakpointCommandsFromPython.py`, so there's no need to write
additional tests for it.

Reviewers: labath, jingham, JDevlieghere

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[Headers] Fix compatibility between arm_acle.h and intrin.h
Eli Friedman [Tue, 29 Oct 2019 21:52:56 +0000 (14:52 -0700)]
[Headers] Fix compatibility between arm_acle.h and intrin.h

Make sure they don't both define __nop.

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

4 years agoAccept __is_same_as as a GCC-compatibility synonym for the proper trait name __is_same.
Richard Smith [Tue, 29 Oct 2019 21:44:38 +0000 (14:44 -0700)]
Accept __is_same_as as a GCC-compatibility synonym for the proper trait name __is_same.

4 years ago[DWARF5] Added support for deleted C++ special member functions.
Adrian Prantl [Tue, 29 Oct 2019 16:20:14 +0000 (09:20 -0700)]
[DWARF5] Added support for deleted C++ special member functions.

This patch adds support for deleted C++ special member functions in
clang and llvm. Also added Defaulted member encodings for future
support for defaulted member functions.

Patch by Sourabh Singh Tomar!

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