Paul Hoad [Wed, 13 Mar 2019 08:15:03 +0000 (08:15 +0000)]
Revert "[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present"
This reverts commit
b358cbb9b78389e20f7be36e1a98e26515c3ecce.
llvm-svn: 356030
Paul Hoad [Wed, 13 Mar 2019 08:07:46 +0000 (08:07 +0000)]
[clang-format] [PR25010] AllowShortIfStatementsOnASingleLine not working if an "else" statement is present
Summary:
Addressing: PR25010 - https://bugs.llvm.org/show_bug.cgi?id=25010
Code like:
```
if(true) var++;
else {
var--;
}
```
is reformatted to be
```
if (true)
var++;
else {
var--;
}
```
Even when `AllowShortIfStatementsOnASingleLine` is true
The following revision comes from a +1'd suggestion in the PR to support AllowShortIfElseStatementsOnASingleLine
This suppresses the clause prevents the merging of the if when there is a compound else
Reviewers: klimek, djasper, JonasToth, alexfh, krasimir, reuk
Reviewed By: reuk
Subscribers: reuk, Higuoxing, jdoerfert, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D59087
llvm-svn: 356029
Jan Vesely [Wed, 13 Mar 2019 07:13:34 +0000 (07:13 +0000)]
sincos: Simplify declaration headers.
This follows the same pattern as modf and fract.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356028
Jan Vesely [Wed, 13 Mar 2019 07:13:32 +0000 (07:13 +0000)]
fdim: Use binary_decl_tt.inc instead of custom inc file.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356027
Jan Vesely [Wed, 13 Mar 2019 07:13:30 +0000 (07:13 +0000)]
nextafter: Use binary_decl_tt.inc instead of custom inc file.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356026
Jan Vesely [Wed, 13 Mar 2019 07:13:28 +0000 (07:13 +0000)]
copysign: Use binary_decl_tt.inc instead of custom inc file.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356025
Jan Vesely [Wed, 13 Mar 2019 07:13:26 +0000 (07:13 +0000)]
atan2pi: Use binary_decl_tt.inc instead of custom inc file.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356024
Jan Vesely [Wed, 13 Mar 2019 07:13:24 +0000 (07:13 +0000)]
atan2: Use binary_decl_tt.inc instead of custom inc file.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356023
Jan Vesely [Wed, 13 Mar 2019 07:13:22 +0000 (07:13 +0000)]
hypot: Use binary_decl_tt.inc instead of custom inc file
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356022
Jan Vesely [Wed, 13 Mar 2019 07:06:19 +0000 (07:06 +0000)]
Move unary_instrinsic.inc to private headers.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356021
Jan Vesely [Wed, 13 Mar 2019 07:06:15 +0000 (07:06 +0000)]
Move binary_intrinsic.h to private headers.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356020
Jan Vesely [Wed, 13 Mar 2019 07:06:13 +0000 (07:06 +0000)]
Move ternary_intrinsic.h to private headers.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356019
Jan Vesely [Wed, 13 Mar 2019 07:06:10 +0000 (07:06 +0000)]
trunc: Remove llvm intrinsic from the header.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356018
Jan Vesely [Wed, 13 Mar 2019 07:06:08 +0000 (07:06 +0000)]
round: Remove llvm intrinsic from the header
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356017
Jan Vesely [Wed, 13 Mar 2019 07:06:06 +0000 (07:06 +0000)]
rint: Remove llvm intrinsic from the header.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356016
Jan Vesely [Wed, 13 Mar 2019 07:06:03 +0000 (07:06 +0000)]
floor: Remove llvm isntrinsic from the header.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356015
Jan Vesely [Wed, 13 Mar 2019 07:06:00 +0000 (07:06 +0000)]
fabs: Remove llvm intrinsic from the header.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356014
Jan Vesely [Wed, 13 Mar 2019 07:05:58 +0000 (07:05 +0000)]
ceil: Remove llvm intrinsic from the header.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356013
Jan Vesely [Wed, 13 Mar 2019 07:05:56 +0000 (07:05 +0000)]
sqrt: Split function generation to a shared inc file.
This will be reused by other unary functions.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356012
Jan Vesely [Wed, 13 Mar 2019 07:05:53 +0000 (07:05 +0000)]
mad: Convert to standard ternary header
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356011
Jan Vesely [Wed, 13 Mar 2019 06:58:53 +0000 (06:58 +0000)]
travis: Deduplicate LLVM_CONFIG variable
Reviewers: Aaron Watry, Tom Stellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356010
Jan Vesely [Wed, 13 Mar 2019 06:58:51 +0000 (06:58 +0000)]
travis: Use gcc-6 for llvm-7 build
llvm does not expose -std=c++11 in cxx flags.
gcc-6 switched default from c++98 to c++14
Reviewers: Aaron Watry, Tom Stellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356009
Craig Topper [Wed, 13 Mar 2019 05:14:52 +0000 (05:14 +0000)]
[X86] Remove 'cx16' from 'prescott' and 'yonah' as they are 32-bit only CPUs and cmpxchg16b requires 64-bit mode.
llvm-svn: 356008
Craig Topper [Wed, 13 Mar 2019 05:14:50 +0000 (05:14 +0000)]
[X86] Add 'yonah' test to predefined-arch-macros.c test.
llvm-svn: 356007
Philip Reames [Wed, 13 Mar 2019 03:25:20 +0000 (03:25 +0000)]
[ImplicitNullChecks] Support unordered atomic accesses
Update the INC pass to allow folding unordered atomics. This is the first optimization unblocked by the changes landed from D57601.
llvm-svn: 356006
Fangrui Song [Wed, 13 Mar 2019 03:22:33 +0000 (03:22 +0000)]
Delete unused declaration of DeclContextPrintAction after the removal of -print-decl-contexts by D52529
llvm-svn: 356005
Philip Reames [Wed, 13 Mar 2019 03:17:58 +0000 (03:17 +0000)]
[Tests] Expand implicit null check coverage
llvm-svn: 356004
Davide Italiano [Wed, 13 Mar 2019 02:47:51 +0000 (02:47 +0000)]
[TestBatchMode] We already log this output to a file.
llvm-svn: 356003
Davide Italiano [Wed, 13 Mar 2019 02:44:32 +0000 (02:44 +0000)]
[testsuite] Remove other traces broken in python 3.
They can be reinstated in case somebody needs to debug
this test in the future.
llvm-svn: 356002
Evgeniy Stepanov [Wed, 13 Mar 2019 01:37:58 +0000 (01:37 +0000)]
Revert "[llvm] Skip over empty line table entries."
This reverts commit r355972.
See the discussion at https://reviews.llvm.org/D58952.
llvm-svn: 356001
Davide Italiano [Wed, 13 Mar 2019 01:26:01 +0000 (01:26 +0000)]
[testsuite] Remove dead code in TestFormats.
llvm-svn: 356000
Davide Italiano [Wed, 13 Mar 2019 00:48:32 +0000 (00:48 +0000)]
[test] Some unicode sequences can't be printed, and Py 3 is more picky.
Given this was under trace, it can just be removed. If somebody
ever needs to debug this testcase again and print the data, they
can add a new statement.
llvm-svn: 355999
Davide Italiano [Wed, 13 Mar 2019 00:48:29 +0000 (00:48 +0000)]
[Python] Fix another batch of python 2/python 3 portability issues.
llvm-svn: 355998
Craig Topper [Wed, 13 Mar 2019 00:43:03 +0000 (00:43 +0000)]
[X86] Enable printAliasInstr for the Intel assembly printer so that AAM and AAD will print without an immediate when the immediate is 10.
llvm-svn: 355997
Heejin Ahn [Wed, 13 Mar 2019 00:37:31 +0000 (00:37 +0000)]
[WebAssembly] Place 'try' and 'catch' correctly wrt EH_LABELs
Summary:
After instruction selection phase, possibly-throwing calls, which were
previously invoke, are wrapped in `EH_LABEL` instructions. For example:
```
EH_LABEL <mcsymbol .Ltmp0>
CALL_VOID @foo ...
EH_LABEL <mcsymbol .Ltmp1>
```
`EH_LABEL` is placed also in the beginning of EH pads:
```
bb.1 (landing-pad):
EH_LABEL <mcsymbol .Ltmp2>
...
```
And we'd like to maintian this relationship, so when we place a `try`,
```
TRY ...
EH_LABEL <mcsymbol .Ltmp0>
CALL_VOID @foo ...
EH_LABEL <mcsymbol .Ltmp1>
```
When we place a `catch`,
```
bb.1 (landing-pad):
EH_LABEL <mcsymbol .Ltmp2>
%0:except_ref = CATCH ...
...
```
Previously we didn't treat EH_LABELs specially, so `try` was placed
right before a call, and `catch` was placed in the beginning of an EH
pad.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58914
llvm-svn: 355996
Hubert Tong [Wed, 13 Mar 2019 00:12:43 +0000 (00:12 +0000)]
Use AIX version detection at LLVM run-time
Summary:
AIX compilers define macros based on the version of the operating
system.
This patch implements updating of versionless AIX triples to include the
host AIX version. Also, the host triple detection in the build system is
adjusted to strip the AIX version information so that the run-time
detection is preferred.
Reviewers: xingxue, stefanp, nemanjai, jasonliu
Reviewed By: xingxue
Subscribers: mgorny, kristina, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58798
llvm-svn: 355995
Adrian Prantl [Tue, 12 Mar 2019 23:59:02 +0000 (23:59 +0000)]
Update the macOS implementation of ComputeClangResourceDirectory to
comply with the more pedantic TestPaths.py
llvm-svn: 355994
Craig Topper [Tue, 12 Mar 2019 23:48:07 +0000 (23:48 +0000)]
[X86] Add ImmArg markings to intrinsics.
Remove test cases that checked for not crashing when immediate operands were passed not an immediate. These are now considered ill-formed in IR.
This was done by manually scanning the intrinsic file for llvm_i32_ty and llvm_i8_ty which are the predominant types we use for immediates. Most of them are on vector intrinsics. I might have missed some other intrinsics.
Differential Revision: https://reviews.llvm.org/D58302
llvm-svn: 355993
Jim Ingham [Tue, 12 Mar 2019 23:15:48 +0000 (23:15 +0000)]
This test is failing on and off on the bots.
Disable it for now till I can figure out what's going wrong.
llvm-svn: 355992
Adrian Prantl [Tue, 12 Mar 2019 22:20:29 +0000 (22:20 +0000)]
Fix the broken Batch test by passing a custom module cache to the inferior lldb.
llvm-svn: 355991
Adrian Prantl [Tue, 12 Mar 2019 22:20:26 +0000 (22:20 +0000)]
Revert "Temporarily add more logging to TestBatchMode"
llvm-svn: 355990
Jason Liu [Tue, 12 Mar 2019 22:01:10 +0000 (22:01 +0000)]
Add XCOFF triple object format type for AIX
This patch adds an XCOFF triple object format type into LLVM.
This XCOFF triple object file type will be used later by object file and assembly generation for the AIX platform.
Differential Revision: https://reviews.llvm.org/D58930
llvm-svn: 355989
Sam Clegg [Tue, 12 Mar 2019 21:53:23 +0000 (21:53 +0000)]
[WebAssembly] Handle undefined data symbols in shared libraries
When linking shared libraries, we import a mutable wasm global
to represent the address of each undefined data symbol.
This is a step towards supporting dynamic linking and shared
libraries.
Differential Revision: https://reviews.llvm.org/D59270
llvm-svn: 355988
Roman Lebedev [Tue, 12 Mar 2019 21:31:00 +0000 (21:31 +0000)]
[NFC][clang][PCH][ObjC] Add some missing `VisitStmt(S);`
Summary:
These ObjC AST classes inherit from Stmt, but don't call `VisitStmt(S);`.
Some were founded with help of existing tests (with `NumStmtFields` bumped to `1`),
but some of them don't even have PCH test coverage. :/
Reviewers: arphaman, sammccall, smeenai, aprantl, rsmith, jordan_rose
Reviewed By: jordan_rose
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59197
llvm-svn: 355987
Adrian Prantl [Tue, 12 Mar 2019 21:30:50 +0000 (21:30 +0000)]
Temporarily add more logging to TestBatchMode
llvm-svn: 355986
Adrian Prantl [Tue, 12 Mar 2019 21:30:47 +0000 (21:30 +0000)]
Add more logging to ClangModulesDeclVendor.cpp
llvm-svn: 355985
Francis Visoiu Mistrih [Tue, 12 Mar 2019 21:22:27 +0000 (21:22 +0000)]
Reland "[Remarks] Add -foptimization-record-passes to filter remark emission"
Currently we have -Rpass for filtering the remarks that are displayed as
diagnostics, but when using -fsave-optimization-record, there is no way
to filter the remarks while generating them.
This adds support for filtering remarks by passes using a regex.
Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline`
will only emit the remarks coming from the pass `inline`.
This adds:
* `-fsave-optimization-record` to the driver
* `-opt-record-passes` to cc1
* `-lto-pass-remarks-filter` to the LTOCodeGenerator
* `--opt-remarks-passes` to lld
* `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2
* `-opt-remarks-passes` to gold-plugin
Differential Revision: https://reviews.llvm.org/D59268
Original llvm-svn: 355964
llvm-svn: 355984
Philip Reames [Tue, 12 Mar 2019 21:09:58 +0000 (21:09 +0000)]
[Test] Add tests for implicit null checks on atomic/volatile instructions
llvm-svn: 355983
Philip Reames [Tue, 12 Mar 2019 21:05:31 +0000 (21:05 +0000)]
For faulting ops, include a comment w/the fault destination
A faulting_op is one that has specified behavior when a fault occurs, generally redirecting control flow to another location. This change just adds a comment to the assembly output which makes it both human readable, and machine checkable w/o having to parse the FaultMap section. This is used to split a test file into two parts, so that I can (in a near future commit) easily extend the test file to demonstrate another case.
llvm-svn: 355982
Matt Arsenault [Tue, 12 Mar 2019 21:02:54 +0000 (21:02 +0000)]
IR: Add immarg attribute
This indicates an intrinsic parameter is required to be a constant,
and should not be replaced with a non-constant value.
Add the attribute to all AMDGPU and generic intrinsics that comments
indicate it should apply to. I scanned other target intrinsics, but I
don't see any obvious comments indicating which arguments are intended
to be only immediates.
This breaks one questionable testcase for the autoupgrade. I'm unclear
on whether the autoupgrade is supposed to really handle declarations
which were never valid. The verifier fails because the attributes now
refer to a parameter past the end of the argument list.
llvm-svn: 355981
Vitaly Buka [Tue, 12 Mar 2019 21:02:24 +0000 (21:02 +0000)]
AddressSanitizer: 64-bit SPARC/Linux port
Summary:
This patch contains the bits required to make the AddressSanitizer work on SPARC64/Linux (SPARC-T4 and later).
Patch by Eric Botcazou.
Reviewers: #sanitizers, vitalybuka, krytarowski
Reviewed By: #sanitizers, vitalybuka
Subscribers: brad, vitalybuka, ro, jyknight, kubamracek, fedor.sergeev, jdoerfert, llvm-commits, #sanitizers
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58434
llvm-svn: 355980
Vitaly Buka [Tue, 12 Mar 2019 21:02:15 +0000 (21:02 +0000)]
AddressSanitizer: fix for SPARC with GCC
Summary:
This patch contains a fixlet for the AddressSanitizer on the SPARC with GCC, which would otherwise generate a problematic call to the intercepted memcpy routine. It was tested with GCC on SPARC/Solaris and SPARC/Linux.
Patch by Eric Botcazou.
Reviewers: #sanitizers, vitalybuka
Reviewed By: #sanitizers, vitalybuka
Subscribers: vitalybuka, ro, jyknight, kubamracek, fedor.sergeev, jdoerfert, llvm-commits, #sanitizers
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58433
llvm-svn: 355979
Vitaly Buka [Tue, 12 Mar 2019 21:02:04 +0000 (21:02 +0000)]
SanitizerCommon: 64-bit SPARC/Linux port
Summary:
This patch contains the bits required to make the common 32-bit allocator work on SPARC64/Linux.
Patch by Eric Botcazou.
Reviewers: #sanitizers, vitalybuka
Reviewed By: #sanitizers, vitalybuka
Subscribers: krytarowski, vitalybuka, ro, jyknight, kubamracek, fedor.sergeev, jdoerfert, llvm-commits, #sanitizers
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58432
llvm-svn: 355978
Peter Collingbourne [Tue, 12 Mar 2019 20:58:34 +0000 (20:58 +0000)]
ELF: Don't add .dynamic strings to .dynstr early.
This does not appear to be necessary because StringTableSection does not
need to be finalized, which also means that we can remove the call to
finalizeSynthetic on .dynstr.
Differential Revision: https://reviews.llvm.org/D59240
llvm-svn: 355977
Francis Visoiu Mistrih [Tue, 12 Mar 2019 20:54:18 +0000 (20:54 +0000)]
Revert "[Remarks] Add -foptimization-record-passes to filter remark emission"
This reverts commit
20fff32b7d1f1a1bd417b22aa9f26ededd97a3e5.
llvm-svn: 355976
Zachary Turner [Tue, 12 Mar 2019 20:51:05 +0000 (20:51 +0000)]
Remove support for DWARF64.
LLVM doesn't produce DWARF64, and neither does GCC. LLDB's support
for DWARF64 is only partial, and if enabled appears to also not work.
Finally, it's untested. Removing this makes merging LLVM and
LLDB's DWARF parsing implementations simpler.
Differential Revision: https://reviews.llvm.org/D59235
llvm-svn: 355975
Zachary Turner [Tue, 12 Mar 2019 20:50:46 +0000 (20:50 +0000)]
Remove DWARFDIECollection.
This is a very thin wrapper over a std::vector<DWARFDIE> and does
not seem to provide any real value over just using a container
directly.
Differential Revision: https://reviews.llvm.org/D59165
llvm-svn: 355974
Zachary Turner [Tue, 12 Mar 2019 20:50:29 +0000 (20:50 +0000)]
Move ElaboratingDIEIterator into implementation file.
This is not used outside of the private implementation of the class,
so hiding in the implementation file is a nice way of simplifying
the external interface.
Differential Revision: https://reviews.llvm.org/D59164
llvm-svn: 355973
Mircea Trofin [Tue, 12 Mar 2019 20:48:45 +0000 (20:48 +0000)]
[llvm] Skip over empty line table entries.
Summary:
This is similar to how addr2line handles consecutive entries with the
same address - pick the last one.
Reviewers: dblaikie, friss, JDevlieghere
Reviewed By: dblaikie
Subscribers: ormris, echristo, JDevlieghere, probinson, aprantl, hiraditya, rupprecht, jdoerfert, llvm-commits
Tags: #llvm, #debug-info
Differential Revision: https://reviews.llvm.org/D58952
llvm-svn: 355972
Matt Arsenault [Tue, 12 Mar 2019 20:42:14 +0000 (20:42 +0000)]
Fix missing C++ mode comments
llvm-svn: 355971
Matt Arsenault [Tue, 12 Mar 2019 20:42:12 +0000 (20:42 +0000)]
MIR: Stop reinitializing target information for every use
Every time a physical register reference was parsed, this would
initialize a string map for every register in in target, and discard
it for the next. The same applies for the other fields initialized
from target information.
Follow along with how the function state is tracked, and add a new
tracking class for target information.
The string->register class/register bank for some reason were kept
separately, so track them in the same place.
llvm-svn: 355970
Davide Italiano [Tue, 12 Mar 2019 20:41:36 +0000 (20:41 +0000)]
[lldb/thirdparty] Remove unneeded files, asked by Jonas.
llvm-svn: 355969
Davide Italiano [Tue, 12 Mar 2019 20:41:29 +0000 (20:41 +0000)]
[lldb-mi] Make this test more reliable. NFC.
Except that it will probably stop failing on and off on my machine.
llvm-svn: 355968
Davide Italiano [Tue, 12 Mar 2019 20:41:24 +0000 (20:41 +0000)]
[third-party] Update pexpect to 4.6.
Reviewers: labath, jdevlieghere
Subscribers: lldb-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59159
llvm-svn: 355967
Peter Collingbourne [Tue, 12 Mar 2019 20:32:30 +0000 (20:32 +0000)]
ELF: Use bump pointer allocator for uncompressed section buffers. NFCI.
This shaves another word off SectionBase and makes it possible to clone a
section using the implicit copy constructor.
This basically reverts r311056, which removed the mutex in order to
make the code easier to understand. On balance I think it's probably more
straightforward to have a mutex here than to have an unusual copy constructor
in SectionBase.
Differential Revision: https://reviews.llvm.org/D59269
llvm-svn: 355966
Vitaly Buka [Tue, 12 Mar 2019 20:31:53 +0000 (20:31 +0000)]
SanitizerCommon: fixes for unwinding & backtrace on SPARC
Summary:
This patch contains various fixes for the unwinding and backtrace machinery on the SPARC, which doesn't work correctly in various cases. It was tested with GCC on SPARC/Solaris and SPARC/Linux.
Patch by Eric Botcazou.
Reviewers: #sanitizers, vitalybuka
Reviewed By: #sanitizers, vitalybuka
Subscribers: jrtc27, delcypher, vitalybuka, ro, jyknight, kubamracek, fedor.sergeev, jdoerfert, llvm-commits, #sanitizers
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58431
llvm-svn: 355965
Francis Visoiu Mistrih [Tue, 12 Mar 2019 20:28:50 +0000 (20:28 +0000)]
[Remarks] Add -foptimization-record-passes to filter remark emission
Currently we have -Rpass for filtering the remarks that are displayed as
diagnostics, but when using -fsave-optimization-record, there is no way
to filter the remarks while generating them.
This adds support for filtering remarks by passes using a regex.
Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline`
will only emit the remarks coming from the pass `inline`.
This adds:
* `-fsave-optimization-record` to the driver
* `-opt-record-passes` to cc1
* `-lto-pass-remarks-filter` to the LTOCodeGenerator
* `--opt-remarks-passes` to lld
* `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2
* `-opt-remarks-passes` to gold-plugin
Differential Revision: https://reviews.llvm.org/D59268
llvm-svn: 355964
Jonas Devlieghere [Tue, 12 Mar 2019 20:24:13 +0000 (20:24 +0000)]
Fix compiler warning
Fixes warning: comparison of integers of different signs.
llvm-svn: 355963
Philip Reames [Tue, 12 Mar 2019 20:15:05 +0000 (20:15 +0000)]
[SROA] Fix a crash when trying to convert a memset to an non-integral pointer type
The included test case currently crashes on tip of tree. Rather than adding a bailout, I chose to restructure the code so that the existing helper function could be used. Given that, the majority of the diff is NFC-ish, but the key difference is that canConvertValue returns false when only one side is a non-integral pointer.
Thanks to Cherry Zhang for the test case.
Differential Revision: https://reviews.llvm.org/D59000
llvm-svn: 355962
Louis Dionne [Tue, 12 Mar 2019 20:10:06 +0000 (20:10 +0000)]
[libc++] Enable deprecation warnings by default
Summary:
In r342843, I added deprecation warnings to some facilities that were
deprectated in C++14 and C++17. However, those deprecation warnings
were not enabled by default.
After discussing this on IRC, we had finally gotten consensus to enable
those warnings by default, and I'm getting around to doing that only
now.
Reviewers: mclow.lists, EricWF
Subscribers: christof, jkorous, dexonsmith, jdoerfert, libcxx-commits
Differential Revision: https://reviews.llvm.org/D58140
llvm-svn: 355961
Alexey Bataev [Tue, 12 Mar 2019 20:05:17 +0000 (20:05 +0000)]
[OPENMP]Allow to redefine entry for the variables definitions.
If the variable was declared and marked as declare target, a new offload
entry with size 0 is created. But if later a definition is created and
marked as declare target, this definition is not added to the entry set
and the definition remains not mapped to the target. Patch fixes this
problem allowing to redefine the size and linkage for
previously registered declaration.
llvm-svn: 355960
Douglas Yung [Tue, 12 Mar 2019 20:04:03 +0000 (20:04 +0000)]
Fixup test to work after changes in r355878.
This should fix the PS4 Windows build bot.
llvm-svn: 355959
Jason Molenda [Tue, 12 Mar 2019 19:42:34 +0000 (19:42 +0000)]
Rework how lldb warngs about kexts that failed to load in a
darwin kernel debug session.
Originally, the kext name & uuid were emitted in the middle of the
kext-loading period's. Last week I decided to try not printing
any details about kexts that failed to load, only printing a summary
of how many failed to load.
This time I'm print different progress characters depending on whether
the kext loaded or not ("-" for not), then at the end I will print a
summary of how many kexts failed to load and a sorted list of the
kexts with the bundle ID and the uuid. It's a lot more readable.
<rdar://problem/
48654569>
llvm-svn: 355958
Jim Ingham [Tue, 12 Mar 2019 19:27:39 +0000 (19:27 +0000)]
Check the result of creating a node from __next_ in the std::list formatter.
There's a single report of a crash coming from this current_sp being NULL. I don't
have a repro case, and I couldn't get it to happen by hand-corrupting a list. We
always get an error instead. So I don't have a test case. But checking for null
is clearly right here.
<rdar://problem/
48503320>
llvm-svn: 355957
Jim Ingham [Tue, 12 Mar 2019 19:25:29 +0000 (19:25 +0000)]
Re-enable this test, the underlying bug was fixed and the test now passes.
llvm-svn: 355956
Sanjay Patel [Tue, 12 Mar 2019 19:20:45 +0000 (19:20 +0000)]
[x86] scalarize extractelement 0 of FP vselect
llvm-svn: 355955
Peter Collingbourne [Tue, 12 Mar 2019 19:19:23 +0000 (19:19 +0000)]
ELF: Simplify. NFCI.
We don't need to take a slice of SectionCommands in addOrphanSections()
because it is not modified until the end of the function.
Differential Revision: https://reviews.llvm.org/D59239
llvm-svn: 355954
Philip Reames [Tue, 12 Mar 2019 19:12:33 +0000 (19:12 +0000)]
[CodeGen] Add MMOs to statepoint nodes during SelectionDAG
The existing statepoint lowering code does something odd; it adds machine memory operands post instruction selection. This was copied from the stackmap/patchpoint implementation, but appears to be non-idiomatic.
This change is largely NFC. It moves the MMO creation logic into SelectionDAG building. It ends up not quite being NFC because the size of the stack slot is reflected in the MMO. The old code blindly used pointer size for the MMO size, which appears to have always been incorrect for larger values. It just happened nothing actually relied on the MMOs, so it worked out okay.
For context, I'm planning on removing the MOVolatile flag from these in a future commit, and then removing the MOStore flag from deopt spill slots in a separate one. Doing so is motivated by a small test case where we should be able to better schedule spill slots, but don't do so due to a memory use/def implied by the statepoint.
Differential Revision: https://reviews.llvm.org/D59106
llvm-svn: 355953
Alexey Bataev [Tue, 12 Mar 2019 18:52:33 +0000 (18:52 +0000)]
[OPENMP 5.0]Initial support for 'allocator' clause.
Added parsing/sema analysis/serialization/deserialization for the
'allocator' clause of the 'allocate' directive.
llvm-svn: 355952
Jim Ingham [Tue, 12 Mar 2019 18:48:58 +0000 (18:48 +0000)]
Fix the project for r355939 (ASTUtils.{h,c})
llvm-svn: 355951
Duncan P. N. Exon Smith [Tue, 12 Mar 2019 18:38:04 +0000 (18:38 +0000)]
Modules: Add LangOptions::CacheGeneratedPCH
Add an option to cache the generated PCH in the ModuleCache when
emitting it. This protects clients that build PCHs and read them in the
same process, allowing them to avoid race conditions between parallel
jobs the same way that Clang's implicit module build system does.
rdar://problem/
48740787
llvm-svn: 355950
Teresa Johnson [Tue, 12 Mar 2019 18:28:05 +0000 (18:28 +0000)]
[SCEV] Use depth limit for trunc analysis
Summary:
This fixes an extremely long compile time caused by recursive analysis
of truncs, which were not previously subject to any depth limits unlike
some of the other ops. I decided to use the same control used for
sext/zext, since the routines analyzing these are sometimes mutually
recursive with the trunc analysis.
Reviewers: mkazantsev, sanjoy
Subscribers: sanjoy, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58994
llvm-svn: 355949
Jinsong Ji [Tue, 12 Mar 2019 18:27:09 +0000 (18:27 +0000)]
Set useful flags for vector imm setting instructions
Vector imm setting instructions like XXLXORz/XXLXORspz/XXLXORdpz
Should behave like LI8.
We should set corresponding flags to allow rematerialization and other
opts in LICM, RA, Scheduling etc.
Differential Revision: https://reviews.llvm.org/D58645
llvm-svn: 355948
Craig Topper [Tue, 12 Mar 2019 18:20:25 +0000 (18:20 +0000)]
[SanitizerCoverage] Avoid splitting critical edges when destination is a basic block containing unreachable
This patch adds a new option to SplitAllCriticalEdges and uses it to avoid splitting critical edges when the destination basic block ends with unreachable. Otherwise if we split the critical edge, sanitizer coverage will instrument the new block that gets inserted for the split. But since this block itself shouldn't be reachable this is pointless. These basic blocks will stick around and generate assembly, but they don't end in sane control flow and might get placed at the end of the function. This makes it look like one function has code that flows into the next function.
This showed up while compiling the linux kernel with clang. The kernel has a tool called objtool that detected the code that appeared to flow from one function to the next. https://github.com/ClangBuiltLinux/linux/issues/351#issuecomment-
461698884
Differential Revision: https://reviews.llvm.org/D57982
llvm-svn: 355947
Eli Friedman [Tue, 12 Mar 2019 18:14:16 +0000 (18:14 +0000)]
[RISCV][MC] Find matching pcrel_hi fixup in more cases.
If a symbol points to the end of a fragment, instead of searching for
fixups in that fragment, search in the next fragment.
Fixes spurious assembler error with subtarget change next to "la"
pseudo-instruction, or expanded equivalent.
Alternate proposal to fix the problem discussed in
https://reviews.llvm.org/D58759.
Testcase by Ana Pazos.
Differential Revision: https://reviews.llvm.org/D58943
llvm-svn: 355946
Jinsong Ji [Tue, 12 Mar 2019 17:55:32 +0000 (17:55 +0000)]
[NFC][PowerPC] Update testcases using utils/update_llc_test_checks.py
llvm-svn: 355945
George Burgess IV [Tue, 12 Mar 2019 17:48:53 +0000 (17:48 +0000)]
Add a creduce script for clang crashes
This CL adds a script that calls C-Reduce on an input file and given the
clang crash script, which is used to generate an interestingness test
for C-Reduce.
Patch by Amy Huang!
Differential Revision: https://reviews.llvm.org/D59118
llvm-svn: 355944
Adrian McCarthy [Tue, 12 Mar 2019 17:40:51 +0000 (17:40 +0000)]
Correcting some comments in PdbIndex.cpp [NFC]
ICF can cause multiple symbols to start at the same virtual address.
I plan to handle this shortly, but I wanted to correct the comment for
now.
Deleted an obsolete comment about adjusting the offset for the magic
number at the beginning of the debug info stream. This adjustment is
handled at a lower level now.
llvm-svn: 355943
Jason Liu [Tue, 12 Mar 2019 17:33:07 +0000 (17:33 +0000)]
Test commit: add a blank line in test case ppc64-dq-expr.s
llvm-svn: 355942
Jonas Devlieghere [Tue, 12 Mar 2019 17:31:04 +0000 (17:31 +0000)]
[Reproducers] Add a test to ensure we can reuse the reproducer dir.
Yesterday I noticed a reproducer test failing after making a local
change. Removing the reproducer directory solved the issue. Add a test
case that detects this.
llvm-svn: 355941
Jonas Devlieghere [Tue, 12 Mar 2019 17:10:28 +0000 (17:10 +0000)]
[Reproducers] Stop recording instead of deallocating
The command interpreter holds a pointer to a DataRecorder. After
generating the reproducer, we deallocated all the DataRecorders, causing
the command interpreter to hold a non-null reference to an invalid
object.
This patch changes the behavior of the command provider to stop the
DataRecorders when a reproducer is generated, rather than deallocating
them.
llvm-svn: 355940
Raphael Isemann [Tue, 12 Mar 2019 17:09:33 +0000 (17:09 +0000)]
Add ability to import std module into expression parser to improve C++ debugging
Summary:
This patch is the MVP version of importing the std module into the expression parser to improve C++ debugging.
What happens in this patch is that we inject a `@import std` into our expression source code. We also
modify our internal Clang instance for parsing this expression to work with modules and debug info
at the same time (which is the main change in terms of LOC). We implicitly build the `std` module on the first use. The
C++ include paths for building are extracted from the debug info, which means that this currently only
works if the program is compiled with `-glldb -fmodules` and uses the std module. The C include paths
are currently specified by LLDB.
I enabled the tests currently only for libc++ and Linux because I could test this locally. I'll enable the tests
for other platforms once this has landed and doesn't break any bots (and I implemented the platform-specific
C include paths for them).
With this patch we can now:
* Build a libc++ as a module and import it into the expression parser.
* Read from the module while also referencing declarations from the debug info. E.g. `std::abs(local_variable)`.
What doesn't work (yet):
* Merging debug info and C++ module declarations. E.g. `std::vector<CustomClass>` doesn't work.
* Pretty much anything that involves the ASTImporter and templated code. As the ASTImporter is used for saving the result declaration, this means that we can't
call yet any function that returns a non-trivial type.
* Use libstdc++ for this, as it requires multiple include paths and Clang only emits one include path per module. Also libstdc++ doesn't support Clang modules without patches.
Reviewers: aprantl, jingham, shafik, friss, davide, serge-sans-paille
Reviewed By: aprantl
Subscribers: labath, mgorny, abidh, jdoerfert, lldb-commits
Tags: #c_modules_in_lldb, #lldb
Differential Revision: https://reviews.llvm.org/D58125
llvm-svn: 355939
James Henderson [Tue, 12 Mar 2019 17:00:25 +0000 (17:00 +0000)]
[yaml2obj]Allow explicit symbol indexes in relocations and emit error for bad names
Prior to this change, the "Symbol" field of a relocation would always be
assumed to be a symbol name, and if no such symbol existed, the
relocation would reference index 0. This confused me when I tried to use
a literal symbol index in the field: since "0x1" was not a known symbol
name, the symbol index was set as 0. This change falls back to treating
unknown symbol names as integers, and emits an error if the name is not
found and the string is not an integer.
Note that the Symbol field is optional, so if a relocation doesn't
reference a symbol, it shouldn't be specified. The new error required a
number of test updates.
Reviewed by: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D58510
llvm-svn: 355938
Nikita Popov [Tue, 12 Mar 2019 16:57:25 +0000 (16:57 +0000)]
[SDAG] Expand pow2 mulo using shifts
Expand MULO with constant power of two operand into a shift. The
overflow is checked with (x << shift) >> shift == x, where the right
shift will be logical for umulo and arithmetic for smulo (with
exception for multiplications by signed_min).
Differential Revision: https://reviews.llvm.org/D59041
llvm-svn: 355937
Jonas Devlieghere [Tue, 12 Mar 2019 16:44:18 +0000 (16:44 +0000)]
[Reproducers] Support capturing a reproducer without an explicit path.
Tablegen doesn't support options that are both flags and take values as
an argument. I noticed this when doing the tablegen rewrite, but forgot
that that affected the reproducer --capture flag.
This patch makes --capture a flag and adds --capture-path to specify a
path for the reproducer. In reality I expect this to be mostly used for
testing, but it could be useful nonetheless.
Differential revision: https://reviews.llvm.org/D59238
llvm-svn: 355936
Craig Topper [Tue, 12 Mar 2019 16:35:30 +0000 (16:35 +0000)]
[X86] Arrange more CPU features to inherit from earlier CPUs. NFCI
This makes SandyBridge inherit back to Westmere/Nehalem.
Make bdver1-4 inherit from each other and btver2 inherit from btver1.
llvm-svn: 355935
Haojian Wu [Tue, 12 Mar 2019 16:11:46 +0000 (16:11 +0000)]
[clang-tidy] NOLINT support for "clang-diagnostic-*".
Reviewers: alexfh, aaron.ballman
Reviewed By: alexfh
Subscribers: xazax.hun, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59255
llvm-svn: 355934
Simon Pilgrim [Tue, 12 Mar 2019 16:00:59 +0000 (16:00 +0000)]
Regenerate sign_extend.ll test.
This will change as part of the fix for the regressions in D58017.
llvm-svn: 355933
Simon Pilgrim [Tue, 12 Mar 2019 15:58:28 +0000 (15:58 +0000)]
[DAGCombine] Pull out repeated demanded bitmask generation. NFCI.
llvm-svn: 355932
Stefan Granitz [Tue, 12 Mar 2019 15:54:35 +0000 (15:54 +0000)]
Revert "[CMake] Avoid clang-tablegen-targets dependency when building sphinx docs (experimental)"
This reverts commit
511066858d44101703d61eded9abf8caff0f9fe0.
This turned out unnecessary to fix the bot.
llvm-svn: 355931