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.
Nico Weber [Wed, 30 Oct 2019 15:22:39 +0000 (11:22 -0400)]
gn build: (manually) merge
67474c60d34
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
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
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
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
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
Roman Lebedev [Wed, 30 Oct 2019 14:27:13 +0000 (17:27 +0300)]
[NFC][LoopUnroll] Tests for peeling of first iteration (PR43840)
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
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.
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.
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.
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>
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
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
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
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
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
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
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.
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. :/
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
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
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
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.
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
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.
Simon Pilgrim [Wed, 30 Oct 2019 11:27:25 +0000 (11:27 +0000)]
[X86] combineOrShiftToFunnelShift - use getShiftAmountTy instead of hardwiring to MVT::i8
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
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.
LLVM GN Syncbot [Wed, 30 Oct 2019 10:43:37 +0000 (10:43 +0000)]
gn build: Merge
6bf55804924
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
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
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
Alex Richardson [Wed, 30 Oct 2019 09:35:10 +0000 (09:35 +0000)]
[UpdateTestChecks] Fix invalid python string escapes
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
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
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
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
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.
Craig Topper [Wed, 30 Oct 2019 05:59:37 +0000 (22:59 -0700)]
[X86] Add test case for PR43758. NFC
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
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
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
Fangrui Song [Wed, 30 Oct 2019 05:55:17 +0000 (22:55 -0700)]
[Orc][test] 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
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.
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
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
Nico Weber [Wed, 30 Oct 2019 01:50:16 +0000 (21:50 -0400)]
gn build: (manually) merge
a34680a3
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
Julian Lettner [Mon, 25 Feb 2019 05:49:42 +0000 (21:49 -0800)]
[lit] Refactor ordering of tests
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
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
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.
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
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
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.
Jonas Devlieghere [Tue, 29 Oct 2019 23:30:37 +0000 (16:30 -0700)]
[lldbsuite] Remove the DumpFormatter
This formatter is never used or referenced.
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.
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.
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
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
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
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.
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
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
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.
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
Daniel Sanders [Tue, 29 Oct 2019 20:27:48 +0000 (13:27 -0700)]
[globalisel][docs] Fix warning treated as error
I had hoped that I could have some
```
.. code-block:: MIR
```
sections for MIR examples which causes a warning about pygments not
supporting it but we have warnings treated as errors
Daniel Sanders [Sat, 26 Oct 2019 02:54:01 +0000 (19:54 -0700)]
[globalisel][docs] Rewrite the IRTranslator documentation
Summary:
I haven't refreshed the Function Calls section as I don't feel I have
sufficient knowledge of that area. It would be appreciated if someone could
review that section.
Note: I'm aware that pygments doesn't support 'mir' as used in one of the
code-block directives. This currently emits a warning and I decided to
keep it to enable finding them later. Maybe we can teach pygments to
support it.
Depends on D69456
Reviewers: volkan, aditya_nandakumar
Subscribers: rovka, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69457
Richard Smith [Tue, 29 Oct 2019 20:06:34 +0000 (13:06 -0700)]
Fix argument numbering confusion when diagnosing a non-viable operator().
This could lead to crashes if operator() is a variadic template, as we
could end up asking for an out-of-bounds argument.
Davide Italiano [Tue, 29 Oct 2019 20:05:56 +0000 (13:05 -0700)]
[ValueObjectDisplay] Generalize the description of an option.
Philip Reames [Tue, 29 Oct 2019 18:07:36 +0000 (11:07 -0700)]
[SelectionDAG] Enable lowering unordered atomics loads w/LoadSDNode (and stores w/StoreSDNode) by default
Enable the new SelectionDAG representation for unordered loads and stores introduced in r371441 by default. As a reminder, the new lowering changes the representation of an unordered atomic load from an AtomicSDNode - which is essentially a black box which gets passed through without combines messing with it - to a LoadSDNode w/a atomic marker on the MMO. The later parallels the way we handle volatiles, and I've audited the code to ensure that every location which checks one checks the other.
This has been fairly heavily fuzzed, and I examined diffs in a reasonable large corpus of assembly by hand, so I'm reasonable sure this is correct for the common case. Late in the review for this, it was discovered that I hadn't correctly handled cases which could be legalized into CAS operations. This points out that there's a strong bias in the IR of the frontend I'm working with towards only legal atomics. If there are problems with this patch, the most likely area will be legalization.
Differential Revision: https://reviews.llvm.org/D69219
Philip Reames [Fri, 25 Oct 2019 21:50:39 +0000 (14:50 -0700)]
[Docs] Reflect the slow migration from guard to widenable condition which is currently in progress.
Joel E. Denny [Thu, 17 Oct 2019 14:03:06 +0000 (14:03 +0000)]
[lit] Extend internal diff to support `-` argument
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:
```
# RUN: program | diff file -
```
Such cases exist now, in `clang/test/Analysis` for example. We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-` as a command-line option. This patch adds support for
`-` to mean stdin.
Reviewed By: probinson, rnk
Differential Revision: https://reviews.llvm.org/D67643
Joel E. Denny [Thu, 17 Oct 2019 14:02:42 +0000 (14:02 +0000)]
[lit] Make internal diff work in pipelines
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:
```
# RUN: program | diff file -
# RUN: not diff file1 file2 | FileCheck %s
```
Such cases exist now, in `clang/test/Analysis` for example. We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.
To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation. A
follow-up patch will implement `-` to mean stdin.
Also, when lit's `diff` prints differences to stdout in Windows, this
patch ensures it always terminate lines with `\n` not `\r\n`. That
way, strict FileCheck directives checking the `diff` output succeed in
both Linux and Windows. This wasn't an issue when `diff` was internal
to lit because `diff` didn't then write to the true stdout, which is
where the `\n` -> `\r\n` conversion happened in Python.
Reviewed By: probinson, stella.stamenova
Differential Revision: https://reviews.llvm.org/D66574
Craig Topper [Tue, 29 Oct 2019 17:47:02 +0000 (10:47 -0700)]
[X86] Narrow i64 compares with constant to i32 when the upper 32-bits are known zero.
This catches some cases. There are probably ways to improve this.
I tried doing it as a combine on the setcc, but that broke
some cases involving flag reuse in place of test.
I renamed the isX86CCUnsigned to isX86CCSigned and flipped its
polarity to make it consistent with the similar functions for
ISD::SETCC. This avoids calling EQ/NE as being signed or unsigned.
Fixes PR43823.
Differential Revision: https://reviews.llvm.org/D69499
shafik [Tue, 29 Oct 2019 18:33:11 +0000 (11:33 -0700)]
[LLDB] Fix for windows bots broken by unsupported tests
Daniel Sanders [Sat, 26 Oct 2019 01:16:40 +0000 (18:16 -0700)]
[globalisel][docs] Rewrite the pipeline overview
Summary:
Rewrite the pipeline overview to be more focused on the structure and
flexibility as well as highlight the increased usefulness of
MachineVerifier and increased testability resulting from the smaller
incremental passes approach.
The diagrams are lifted from the slides for the LLVMDev 2019 talk
'Generating Optimized Code with GlobalISel' and adapted to be readable on
the white background used in the docs.
Reviewers: volkan
Subscribers: rovka, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69456
Simon Pilgrim [Tue, 29 Oct 2019 17:53:03 +0000 (17:53 +0000)]
[X86][VBMI2] Add vector funnel shift tests
Demonstrates missed opportunity to combine to the VBMI2 SHLDV/SHRDV ops - combineOrShiftToFunnelShift should handle vector ops (and we should eventually move this to DAGCombine).
Louis Dionne [Thu, 24 Oct 2019 21:16:37 +0000 (14:16 -0700)]
[libc++] Force the ABI namespace to be a reserved identifier
Summary:
When the ABI namespace isn't a reserved identifier, we were issuing a
warning, but this should have been an error since the beginning. This
commit enforces that the ABI namespace is a reserved identifier, and
changes the ABI namespace used by LibFuzzer.
Reviewers: phosek, EricWF
Subscribers: mgorny, christof, jkorous, dexonsmith, #sanitizers, libcxx-commits, llvm-commits
Tags: #sanitizers, #libc, #llvm
Differential Revision: https://reviews.llvm.org/D69408
Vlad Tsyrklevich [Tue, 29 Oct 2019 17:20:38 +0000 (10:20 -0700)]
Revert "[clang-format] Remove the dependency on frontend"
This reverts commit
ec66603ac7ea655be5c2c5f508c5bf0d5eaeb65b. It was
causing ubsan failures like the following on the ubsan bot:
llvm/lib/Support/SourceMgr.cpp:440:48: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xfffffffffffffffa
Ehsan Amiri [Tue, 29 Oct 2019 16:08:00 +0000 (12:08 -0400)]
[SVE][AArch64] Adding pattern matching for some SVE instructions.
Adding patten matching for two SVE intrinsics: frecps and frsqrts.
Also added patterns for fsub and fmul - these SDNodes directly correspond
to machine instructions.
Review: https://reviews.llvm.org/D68476
Patch authored by mgudim (Mikhail Gudim).
Fangrui Song [Tue, 29 Oct 2019 17:00:46 +0000 (10:00 -0700)]
[ELF] Delete redundant comment after D56554. NFC
Michał Górny [Mon, 21 Oct 2019 17:27:51 +0000 (19:27 +0200)]
[lld] [ELF] Add '-z nognustack' opt to suppress emitting PT_GNU_STACK
Add a new '-z nognustack' option that suppresses emitting PT_GNU_STACK
segment. This segment is not supported at all on NetBSD (stack is
always non-executable), and the option is meant to be used to disable
emitting it.
Differential Revision: https://reviews.llvm.org/D56554
Lawrence D'Anna [Tue, 29 Oct 2019 04:59:04 +0000 (21:59 -0700)]
[LLDB][Python] fix another fflush issue on NetBSD
Summary:
Here's another instance where we were calling fflush on an input
stream, which is illegal on NetBSD.
Reviewers: labath, mgorny
Reviewed By: mgorny
Subscribers: krytarowski, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69488
Fangrui Song [Tue, 29 Oct 2019 16:38:33 +0000 (09:38 -0700)]
[SLP] Fix -Wunused-variable. NFC
Guillaume Chatelet [Tue, 29 Oct 2019 16:28:34 +0000 (17:28 +0100)]
isBuiltinFunc() uses StringRef instead of const char*
Summary: This prevents a bug when passing nullptr, StringRef ctor would call strlen(nullptr).
Reviewers: vlad.tsyrklevich
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69569
Sander de Smalen [Tue, 29 Oct 2019 12:49:34 +0000 (12:49 +0000)]
Reland [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize (Take 2)
llvm/test/DebugInfo/MIR/X86/live-debug-values-reg-copy.mir failed with
EXPENSIVE_CHECKS enabled, causing the patch to be reverted in
rG2c496bb5309c972d59b11f05aee4782ddc087e71.
This patch relands the patch with a proper fix to the
live-debug-values-reg-copy.mir tests, by ensuring the MIR encodes the
callee-saves correctly so that the CalleeSaved info is taken from MIR
directly, rather than letting it be recalculated by the PEI pass. I've
done this by running `llc -stop-before=prologepilog` on the LLVM
IR as captured in the test files, adding the extra MOV instructions
that were manually added in the original test file, then running `llc
-run-pass=prologepilog` and finally re-added the comments for the MOV
instructions.
Alexey Bataev [Mon, 28 Oct 2019 17:46:10 +0000 (13:46 -0400)]
[SLP] Generalization of stores vectorization.
Stores are vectorized with maximum vectorization factor of 16. Patch
tries to improve the situation and use maximal vectorization factor.
Reviewers: spatel, RKSimon, mkuper, hfinkel
Differential Revision: https://reviews.llvm.org/D43582
Guillaume Chatelet [Tue, 29 Oct 2019 15:35:11 +0000 (16:35 +0100)]
Fix missing memcpy builtin on ppc64be
See D68028
Simon Pilgrim [Tue, 29 Oct 2019 15:29:32 +0000 (15:29 +0000)]
[X86] Pull out combineOrShiftToFunnelShift helper. NFCI.
Saleem Abdulrasool [Tue, 29 Oct 2019 15:24:10 +0000 (08:24 -0700)]
build: make standalone builds work again
Apple's greendragon bot uses a standalone build of lldb which would
fail to build after a recent change to LLVM as it relied on LLVM setting
global flags for its build. Attempt to repair the standalone build for
greendragon bot.
Saleem Abdulrasool [Tue, 29 Oct 2019 15:20:58 +0000 (08:20 -0700)]
build: workaround stale caches (NFC)
`LLVM_DEFAULT_TARGET_TRIPLE` is a cached variable, which means that it
may actually be unset. Furthermore, in standalone builds, the variable
may be fully undefined. Apply the regular expression over the empty
string in such a case. This should improve the state of the green
dragon bot.
Sanjay Patel [Tue, 29 Oct 2019 14:39:59 +0000 (10:39 -0400)]
[InstCombine] make icmp vector canonicalization safe for constant with undef elements
This is a fix for:
https://bugs.llvm.org/show_bug.cgi?id=43730
...and as shown there, we have existing test cases that show potential miscompiles.
We could just bail out for vector constants that contain any undef elements, or we can do as shown here:
allow the transform, but replace the undefs with a safe value.
For most of the tests shown, this results in a full splat constant (no undefs) which is probably a win
for further IR analysis because we conservatively don't match undefs in most cases. Codegen can probably
recover these kinds of undef lanes via demanded elements analysis if that's profitable.
Differential Revision: https://reviews.llvm.org/D69519
Guillaume Chatelet [Wed, 25 Sep 2019 09:31:28 +0000 (11:31 +0200)]
[clang] Add no_builtin attribute
Summary:
This is a follow up on https://reviews.llvm.org/D61634
This patch is simpler and only adds the no_builtin attribute.
Reviewers: tejohnson, courbet, theraven, t.p.northover, jdoerfert
Subscribers: mgrang, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68028
This is a re-submit after it got reverted in https://reviews.llvm.org/rGbd8791610948 since the breakage doesn't seem to come from this patch.
Raphael Isemann [Tue, 29 Oct 2019 14:13:02 +0000 (15:13 +0100)]
[lldb][NFC] Make LLVMUserExpression::DoExecute return early
The giant if-else isn't conforming to LLVM code style.
Alexey Bataev [Tue, 29 Oct 2019 14:06:11 +0000 (10:06 -0400)]
[OPENMP]Fix PR43772: No warning in non-combined target regions.
Need to analyze inner target regions in case of implicit mapping of the
data members when target region is created in one of the class member
functions.
Florian Hahn [Tue, 29 Oct 2019 13:41:19 +0000 (13:41 +0000)]
[bugpoint] Try to reduce passes after reducing everything.
In some cases, we fail to reduce the pass list earlier because of
complex pass dependencies, but we can reduce it after we simplified the
reproducer.
An example of that is PR43474, which can limit the crash to
-loop-interchange. Adding a test case would require at least 2
interacting Loop passes I think.
Reviewers: davide, reames, modocache
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D69236