Richard Smith [Wed, 24 Apr 2019 02:22:38 +0000 (02:22 +0000)]
Revert r350917 "[Sema] If CheckPlaceholderExpr rewrites the initializer
of an auto"
This commit changed the initializer expression passed into
initialization (stripping off an enclosing pair of parentheses or
braces) and subtly changing the meaning of programs, typically by
inserting bogus calls to copy constructors.
See the added testcase in test/SemaCXX/cxx1y-init-captures.cpp for an
example of the breakage.
llvm-svn: 359066
Eric Fiselier [Wed, 24 Apr 2019 02:21:13 +0000 (02:21 +0000)]
Work around GCC test failure.
llvm-svn: 359065
Nico Weber [Wed, 24 Apr 2019 02:11:24 +0000 (02:11 +0000)]
llvm-cvtres: Accept /? as help flag, like cvtres.exe
llvm-svn: 359064
Jonas Devlieghere [Wed, 24 Apr 2019 01:58:17 +0000 (01:58 +0000)]
[Docs] Add more redirects
Found two more broken links.
llvm-svn: 359063
Jonas Devlieghere [Wed, 24 Apr 2019 01:48:43 +0000 (01:48 +0000)]
[Docs] Update the CI page
- Add the Sphinx bot
- Add a little more info
llvm-svn: 359062
Jonas Devlieghere [Wed, 24 Apr 2019 01:48:40 +0000 (01:48 +0000)]
[Docs] Move external links up
With a duplicate link removed and the API reference moved up, the page
didn't make much sense anymore.
llvm-svn: 359061
Eric Fiselier [Wed, 24 Apr 2019 01:47:30 +0000 (01:47 +0000)]
Rewrite cxa guard implementation.
This patch does three main things:
(1) It re-writes the cxa guard implementation to make it testable.
(2) Adds support for recursive init detection on non-apple platforms.
(3) It adds a futex based implementation.
The futex based implementation locks and notifies on a per-object basis, unlike the
current implementation which uses a global lock for all objects. Once this patch settles
I'll turn it on by default when supported.
llvm-svn: 359060
Richard Smith [Wed, 24 Apr 2019 01:29:28 +0000 (01:29 +0000)]
Fix interactions between __builtin_constant_p and constexpr to match
current trunk GCC.
GCC permits information from outside the operand of
__builtin_constant_p (but in the same constant evaluation context) to be
used within that operand; clang now does so too. A few other minor
deviations from GCC's behavior showed up in my testing and are also
fixed (matching GCC):
* Clang now supports nullptr_t as the argument type for
__builtin_constant_p
* Clang now returns true from __builtin_constant_p if called with a
null pointer
* Clang now returns true from __builtin_constant_p if called with an
integer cast to pointer type
llvm-svn: 359059
Nico Weber [Wed, 24 Apr 2019 00:59:24 +0000 (00:59 +0000)]
gn build: Merge r359050 more
llvm-svn: 359058
Nico Weber [Wed, 24 Apr 2019 00:48:04 +0000 (00:48 +0000)]
Fix test after r359009 on platforms where %ms_abi_triple is 32-bit
llvm-svn: 359057
Nico Weber [Wed, 24 Apr 2019 00:44:14 +0000 (00:44 +0000)]
gn build: Merge r359050
llvm-svn: 359056
Alina Sbirlea [Wed, 24 Apr 2019 00:28:29 +0000 (00:28 +0000)]
Revert [AliasAnalysis] AAResults preserves AAManager.
Triggers use-after-free.
llvm-svn: 359055
Amy Huang [Wed, 24 Apr 2019 00:28:23 +0000 (00:28 +0000)]
Fixes in creduce-clang-crash.py for clang crash message parsing and reading the command from the repro script.
llvm-svn: 359054
Francis Visoiu Mistrih [Wed, 24 Apr 2019 00:27:59 +0000 (00:27 +0000)]
[Remarks] Fix documentation indentation
Fix the documentation bot:
http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/30450/steps/docs-llvm-html/logs/stdio
llvm-svn: 359053
Jonas Devlieghere [Wed, 24 Apr 2019 00:10:23 +0000 (00:10 +0000)]
[Docs] Fix link to C++ docs
... and add a redirect for the old URL.
llvm-svn: 359052
Richard Smith [Wed, 24 Apr 2019 00:08:02 +0000 (00:08 +0000)]
Add missing diagnostic for anonymous struct/union definitions that don't
introduce any names.
llvm-svn: 359051
Francis Visoiu Mistrih [Wed, 24 Apr 2019 00:06:24 +0000 (00:06 +0000)]
[Remarks] Add string deduplication using a string table
* Add support for uniquing strings in the remark streamer and emitting the string table in the remarks section.
* Add parsing support for the string table in the RemarkParser.
From this remark:
```
--- !Missed
Pass: inline
Name: NoDefinition
DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
Line: 7, Column: 3 }
Function: printArgsNoRet
Args:
- Callee: printf
- String: ' will not be inlined into '
- Caller: printArgsNoRet
DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
Line: 6, Column: 0 }
- String: ' because its definition is unavailable'
...
```
to:
```
--- !Missed
Pass: 0
Name: 1
DebugLoc: { File: 3, Line: 7, Column: 3 }
Function: 2
Args:
- Callee: 4
- String: 5
- Caller: 2
DebugLoc: { File: 3, Line: 6, Column: 0 }
- String: 6
...
```
And the string table in the .remarks/__remarks section containing:
```
inline\0NoDefinition\0printArgsNoRet\0
test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c\0printf\0
will not be inlined into \0 because its definition is unavailable\0
```
This is mostly supposed to be used for testing purposes, but it gives us
a 2x reduction in the remark size, and is an incremental change for the
updates to the remarks file format.
Differential Revision: https://reviews.llvm.org/D60227
llvm-svn: 359050
Akira Hatanaka [Tue, 23 Apr 2019 23:52:02 +0000 (23:52 +0000)]
Improve -Wuninitialized warning under ARC for block variables that are
recursively captured.
Under ARC, a block variable is zero-initialized when it is recursively
captured by the block literal initializer.
rdar://problem/
11022762
llvm-svn: 359049
Richard Smith [Tue, 23 Apr 2019 23:48:00 +0000 (23:48 +0000)]
C++ DR2387: a variable template declared wtih (or instantiated with) a
const-qualified type is not implicitly given internal linkage. But a
variable template declared 'static' is.
llvm-svn: 359048
Josh Stone [Tue, 23 Apr 2019 23:43:47 +0000 (23:43 +0000)]
[Lint] Permit aliasing noalias readonly arguments
Summary:
If two arguments are both readonly, then they have no memory dependency
that would violate noalias, even if they do actually overlap.
Reviewers: hfinkel, efriedma
Reviewed By: efriedma
Subscribers: efriedma, hiraditya, llvm-commits, tstellar
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60239
llvm-svn: 359047
Jessica Paquette [Tue, 23 Apr 2019 23:03:03 +0000 (23:03 +0000)]
[AArch64][GlobalISel] Select G_INTRINSIC_ROUND
Add selection support for G_INTRINSIC_ROUND, add a selection test, and add
check lines to arm64-vfloatintrinsics.ll and f16-instructions.ll.
llvm-svn: 359046
Petr Hosek [Tue, 23 Apr 2019 22:55:28 +0000 (22:55 +0000)]
[libcxx] Use relative path for libc++ library when generating script
This addresses the issue introduced in D60309 which leads to linker
scripts being generated with absolute paths.
Differential Revision: https://reviews.llvm.org/D61039
llvm-svn: 359045
Jessica Paquette [Tue, 23 Apr 2019 22:47:00 +0000 (22:47 +0000)]
[AArch64][GlobalISel] Mark G_INTRINSIC_ROUND as a pre-isel floating point opcode
Add G_INTRINSIC_ROUND to isPreISelGenericFloatingPointOpcode to ensure that its
input and output are assigned the correct register bank.
Add a regbankselect test to verify that we get what we expect here.
llvm-svn: 359044
Dmitry Mikulin [Tue, 23 Apr 2019 22:26:55 +0000 (22:26 +0000)]
The error message for mismatched value sites is very cryptic.
Make it more readable for an average user.
Differential Revision: https://reviews.llvm.org/D60896
llvm-svn: 359043
Alex Langford [Tue, 23 Apr 2019 21:59:07 +0000 (21:59 +0000)]
[CMake] Use add_dependencies in add_llvm_install_targets
Summary:
The CMake documentation says that the `DEPENDS` field of
add_custom_target is for files and output of custom commands. Adding a
dependency on a target should be done with `add_dependency`.
Differential Revision: https://reviews.llvm.org/D60879
llvm-svn: 359042
Francis Visoiu Mistrih [Tue, 23 Apr 2019 21:57:46 +0000 (21:57 +0000)]
[CGP] Look through bitcasts when duplicating returns for tail calls
The simple case of:
```
int *callee();
void *caller(void *a) {
if (a == NULL)
return callee();
return a;
}
```
would generate a regular call instead of a tail call because we don't
look through the bitcast of the call to `callee` when duplicating the
return blocks.
Differential Revision: https://reviews.llvm.org/D60837
llvm-svn: 359041
Francis Visoiu Mistrih [Tue, 23 Apr 2019 21:57:43 +0000 (21:57 +0000)]
[X86] Add codegen prepare test exercising a bitcast + tail call
In preparation of https://reviews.llvm.org/D60837, add this test where
we don't perform a tail call because we don't look through a bitcast.
llvm-svn: 359040
Scott Linder [Tue, 23 Apr 2019 21:50:11 +0000 (21:50 +0000)]
Move setTargetAttributes after setGVProperties in SetFunctionAttributes
AMDGPU currently relies on global properties being set before
setTargetProperties is called. Existing targets like MIPS which rely on
setTargetProperties do not rely on the current behavior, so this patch
moves the call later in SetFunctionAttributes.
Differential Revision: https://reviews.llvm.org/D60967
llvm-svn: 359039
Heejin Ahn [Tue, 23 Apr 2019 21:30:30 +0000 (21:30 +0000)]
[WebAssembly] Emit br_table for most switch instructions
Summary:
Always convert switches to br_tables unless there is only one case,
which is equivalent to a simple branch. This reduces code size for wasm,
and we defer possible jump table optimizations to the VM.
Addresses PR41502.
Reviewers: kripken, sunfish
Subscribers: dschuff, sbc100, jgravelle-google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60966
llvm-svn: 359038
Artem Dergachev [Tue, 23 Apr 2019 21:30:30 +0000 (21:30 +0000)]
[analyzer] Fix macro names in diagnostics within bigger macros.
If macro "CHECK_X(x)" expands to something like "if (x != NULL) ...",
the "Assuming..." note no longer says "Assuming 'x' is equal to CHECK_X".
Differential Revision: https://reviews.llvm.org/D59121
llvm-svn: 359037
Heejin Ahn [Tue, 23 Apr 2019 21:17:03 +0000 (21:17 +0000)]
[WebAssembly] Make LBB markers not affected by test order
Summary:
This way we can change the order of tests or delete some of them without
affecting tests for other functions.
Reviewers: tlively
Subscribers: sunfish, dschuff, sbc100, jgravelle-google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60929
llvm-svn: 359036
Artem Dergachev [Tue, 23 Apr 2019 21:15:26 +0000 (21:15 +0000)]
Re-apply r357823 "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."
It now comes with a follow-up fix for the clients of this API
in clangd and clang-tidy.
Differential Revision: https://reviews.llvm.org/D59977
llvm-svn: 359035
Amy Huang [Tue, 23 Apr 2019 21:12:58 +0000 (21:12 +0000)]
Revert "[MS] Emit S_HEAPALLOCSITE debug info" because of ToTWin64(db)
buildbot failure.
This reverts commit
d07d6d617713bececf57f3547434dd52f0f13f9e and
c774f687b6880484a126ed3e3d737e74c926f0ae.
llvm-svn: 359034
Jessica Paquette [Tue, 23 Apr 2019 21:11:57 +0000 (21:11 +0000)]
[AArch64][GlobalISel] Legalize G_INTRINSIC_ROUND
Add it to the same rule as G_FCEIL etc. Add a legalizer test, and add a missing
switch case to AArch64LegalizerInfo.cpp.
llvm-svn: 359033
Alina Sbirlea [Tue, 23 Apr 2019 20:59:44 +0000 (20:59 +0000)]
[MemorySSA] LCSSA preserves MemorySSA.
Summary:
Enabling MemorySSA in the old pass manager leads to MemorySSA being run
twice due to the fact that LCSSA and LoopSimplify do not preserve
MemorySSA. This is the first step to address that: target LCSSA.
LCSSA does not make any changes that invalidate MemorySSA, so it
preserves it by design. It must preserve AA as well, for this to hold.
After this patch, MemorySSA is still run twice in the old pass manager.
Step two follows: target LoopSimplify.
Subscribers: mehdi_amini, jlebar, Prazek, llvm-commits, george.burgess.iv, chandlerc
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60832
llvm-svn: 359032
Craig Topper [Tue, 23 Apr 2019 20:52:00 +0000 (20:52 +0000)]
[X86] Autogenerate complete checks. NFC
Prep for D60993
llvm-svn: 359031
Jessica Paquette [Tue, 23 Apr 2019 20:46:19 +0000 (20:46 +0000)]
[AArch64][GlobalISel] Actually select G_INTRINSIC_TRUNC
Apparently FileCheck wasn't actually matching the fallback check lines in
arm64-vfloatintrinsics.ll properly. So, there were selection fallbacks for
G_INTRINSIC_TRUNC there.
Actually hook it up into AArch64InstructionSelector.cpp and write a proper
selection test.
I guess I'll figure out the FileCheck magic to make the fallback checks work
properly in arm64-vfloatintrinsics.ll.
llvm-svn: 359030
Owen Pan [Tue, 23 Apr 2019 20:29:46 +0000 (20:29 +0000)]
[clang-format] Fix bug in reflow of block comments containing CR/LF
Fix PR36119
Differential Revision: https://reviews.llvm.org/D60996
llvm-svn: 359029
Frederic Riss [Tue, 23 Apr 2019 20:17:04 +0000 (20:17 +0000)]
Lock accesses to OptionValueFileSpecList objects
Before a Debugger gets a Target, target settings are routed to a global set
of settings. Even without this, some part of the LLDB which exist independently
of the Debugger object (the Module cache, the Symbol vendors, ...) access
directly the global default store for those settings.
Of course, if you modify one of those global settings while they are being read,
bad things happen. We see this quite a bit with FileSpecList settings. In
particular, we see many cases where one debug session changes
target.exec-search-paths while another session starts up and it crashes when
one of those accesses invalid FileSpecs.
This patch addresses the specific FileSpecList issue by adding locking to
OptionValueFileSpecList and never returning by reference.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D60468
llvm-svn: 359028
Akira Hatanaka [Tue, 23 Apr 2019 19:49:03 +0000 (19:49 +0000)]
[ObjC][ARC] Check the basic block size before calling
DominatorTree::dominate.
ARC contract pass has an optimization that replaces the uses of the
argument of an ObjC runtime function call with the call result.
For example:
; Before optimization
%1 = tail call i8* @foo1()
%2 = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %1)
store i8* %1, i8** @g0, align 8
; After optimization
%1 = tail call i8* @foo1()
%2 = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %1)
store i8* %2, i8** @g0, align 8 // %1 is replaced with %2
Before replacing the argument use, DominatorTree::dominate is called to
determine whether the user instruction is dominated by the ObjC runtime
function call instruction. The call to DominatorTree::dominate can be
expensive if the two instructions belong to the same basic block and the
size of the basic block is large. This patch checks the basic block size
and just bails out if the size exceeds the limit set by command line
option "arc-contract-max-bb-size".
rdar://problem/
49477063
Differential Revision: https://reviews.llvm.org/D60900
llvm-svn: 359027
David Blaikie [Tue, 23 Apr 2019 19:00:45 +0000 (19:00 +0000)]
Reapply: "DebugInfo: Emit only one kind of accelerated access/name table""
Originally committed in r358931
Reverted in r358997
Seems this change made Apple accelerator tables miss names (because
names started respecting the CU NameTableKind GNU & assuming that
shouldn't produce accelerated names too), which is never correct (apple
accelerator tables don't have separators or CU lists - if present, they
must describe all names in all CUs).
Original Description:
Currently to opt in to debug_names in DWARFv5, the IR must contain
'nameTableKind: Default' which also enables debug_pubnames.
Instead, only allow one of {debug_names, apple_names, debug_pubnames,
debug_gnu_pubnames}.
nameTableKind: Default gives debug_names in DWARFv5 and greater,
debug_pubnames in v4 and earlier - and apple_names when tuning for lldb
on MachO.
nameTableKind: GNU always gives gnu_pubnames
llvm-svn: 359026
Teresa Johnson [Tue, 23 Apr 2019 18:56:19 +0000 (18:56 +0000)]
[ThinLTO] Pass down opt level to LTO backend and handle -O0 LTO in new PM
Summary:
The opt level was not being passed down to the ThinLTO backend when
invoked via clang (for distributed ThinLTO).
This exposed an issue where the new PM was asserting if the Thin or
regular LTO backend pipelines were invoked with -O0 (not a new issue,
could be provoked by invoking in-process *LTO backends via linker using
new PM and -O0). Fix this similar to the old PM where -O0 only does the
necessary lowering of type metadata (WPD and LowerTypeTest passes) and
then quits, rather than asserting.
Reviewers: xur
Subscribers: mehdi_amini, inglorion, eraman, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits, pcc
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D61022
llvm-svn: 359025
Nico Weber [Tue, 23 Apr 2019 18:46:53 +0000 (18:46 +0000)]
llvm-cvtres: Split addChild(ID) into two functions
Before, there was an IsData parameter. Now, there are two different
functions for data nodes and ID nodes. No behavior change, needed for a
follow-up change to make two data nodes (but not two ID nodes) with the
same ID an error.
For consistency, rename another addChild() overload to addNameChild().
llvm-svn: 359024
Eric Fiselier [Tue, 23 Apr 2019 18:23:33 +0000 (18:23 +0000)]
Fix namespace name conflict with GCC
llvm-svn: 359023
Jessica Paquette [Tue, 23 Apr 2019 18:20:47 +0000 (18:20 +0000)]
[AArch64][GlobalISel] Teach regbankselect about G_INTRINSIC_TRUNC
Add it to isPreISelGenericFloatingPointOpcode, and add a regbankselect test.
Update arm64-vfloatintrinsics.ll now that we can select it.
llvm-svn: 359022
Jessica Paquette [Tue, 23 Apr 2019 18:20:44 +0000 (18:20 +0000)]
[AArch64][GlobalISel] Legalize G_INTRINSIC_TRUNC
Same patch as G_FCEIL etc.
Add the missing switch case in widenScalar, add G_INTRINSIC_TRUNC to the correct
rule in AArch64LegalizerInfo.cpp, and add a test.
llvm-svn: 359021
Eric Fiselier [Tue, 23 Apr 2019 18:01:58 +0000 (18:01 +0000)]
Fix implementation of ::abs and std::abs LWG 2192.
Summary:
All overloads of `::abs` and `std::abs` must be present in both `<cmath>` and `<cstdlib>`. This is problematic to implement because C defines `fabs` in `math.h` and `labs` in `stdlib.h`. This introduces a circular dependency between the two headers.
This patch implements that requirement by moving `abs` into `math.h` and making `stdlib.h` include `math.h`. In order to get the underlying C declarations from the "real" `stdlib.h` inside our `math.h` we need some trickery. Specifically we need to make `stdlib.h` include next itself.
Suggestions for a cleaner implementation are welcome.
Reviewers: mclow.lists, ldionne
Reviewed By: ldionne
Subscribers: krytarowski, fedor.sergeev, dexonsmith, jdoerfert, jsji, libcxx-commits
Differential Revision: https://reviews.llvm.org/D60097
llvm-svn: 359020
Nikita Popov [Tue, 23 Apr 2019 18:00:17 +0000 (18:00 +0000)]
[ConstantRange] Add urem support
Add urem support to ConstantRange, so we can handle in in LVI. This
is an approximate implementation that tries to capture the most useful
conditions: If the LHS is always strictly smaller than the RHS, then
the urem is a no-op and the result is the same as the LHS range.
Otherwise the lower bound is zero and the upper bound is
min(LHSMax, RHSMax - 1).
Differential Revision: https://reviews.llvm.org/D60952
llvm-svn: 359019
Nikita Popov [Tue, 23 Apr 2019 18:00:02 +0000 (18:00 +0000)]
[ConstantRangeTest] Move helper methods; NFC
Move Test(Unsigned|Signed)BinOpExhaustive() towards the top of the
file, so they're easier to reuse.
llvm-svn: 359018
Stanislav Mekhanoshin [Tue, 23 Apr 2019 17:59:26 +0000 (17:59 +0000)]
[AMDGPU] Fixed addReg() in SIOptimizeExecMaskingPreRA.cpp
The second argument is flags, not subreg.
Differential Revision: https://reviews.llvm.org/D61031
llvm-svn: 359017
Jonas Devlieghere [Tue, 23 Apr 2019 17:44:40 +0000 (17:44 +0000)]
[Reproducers] Limit logging to calls that cross the API boundary.
We recently moved API logging into the instrumentation macros. This made
that logging is now consistent and abstracted behind a macro for every
API functions, independent of the reproducers. It also means we have a
lot more output. While this is a good thing, it also meant a lot more
noise in the log, from things that aren't always equally interesting,
such as the copy constructor for example.
To improve usability, we should increase the signal-to-noise ratio. I
propose to achieve this by only logging API functions that cross the API
boundary. This is a divergence of what we had before, where a select
number of functions were logged, irregardless of the API boundary, a
concept that was introduced for the reproducers. However, I believe this
is in line with the purpose of the API log.
Differential revision: https://reviews.llvm.org/D60984
llvm-svn: 359016
Jessica Paquette [Tue, 23 Apr 2019 17:37:56 +0000 (17:37 +0000)]
[AArch64][GlobalISel] Legalize G_FMA for more vector types
Same as G_FCEIL, G_FABS, etc. Just move it into that rule.
Add a legalizer test for G_FMA, which we didn't have before and update
arm64-vfloatintrinsics.ll.
llvm-svn: 359015
Alina Sbirlea [Tue, 23 Apr 2019 17:21:18 +0000 (17:21 +0000)]
[AliasAnalysis] AAResults preserves AAManager.
Summary:
AAResults should not invalidate AAManager.
Update tests.
Reviewers: chandlerc
Subscribers: mehdi_amini, jlebar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60914
llvm-svn: 359014
Jessica Paquette [Tue, 23 Apr 2019 17:17:06 +0000 (17:17 +0000)]
[AArch64][GlobalISel] Add G_FMA to isPreISelGenericFloatingPointOpcode
Noticed an unnecessary fallback in arm64-vmul caused by this.
Also add a regbankselect test for G_FMA.
llvm-svn: 359013
Joel E. Denny [Tue, 23 Apr 2019 17:04:15 +0000 (17:04 +0000)]
[APSInt][OpenMP] Fix isNegative, etc. for unsigned types
Without this patch, APSInt inherits APInt::isNegative, which merely
checks the sign bit without regard to whether the type is actually
signed. isNonNegative and isStrictlyPositive call isNegative and so
are also affected.
This patch adjusts APSInt to override isNegative, isNonNegative, and
isStrictlyPositive with implementations that consider whether the type
is signed.
A large set of Clang OpenMP tests are affected. Without this patch,
these tests assume that `true` is not a valid argument for clauses
like `collapse`. Indeed, `true` fails APInt::isStrictlyPositive but
not APSInt::isStrictlyPositive. This patch adjusts those tests to
assume `true` should be accepted.
This patch also adds tests revealing various other similar fixes due
to APSInt::isNegative calls in Clang's ExprConstant.cpp and
SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object
size based on `alloc_size`, `<<` and `>>` shift count validation, and
OpenMP array section validation.
Reviewed By: lebedev.ri, ABataev, hfinkel
Differential Revision: https://reviews.llvm.org/D59712
llvm-svn: 359012
Davide Italiano [Tue, 23 Apr 2019 16:51:20 +0000 (16:51 +0000)]
Revert "[EditLineTest] Not always TERM is available, e.g. on some bots."
This was a speculative fix trying to placate some bots, but it's
ultimately just a bot configuration problem and not a code problem.
llvm-svn: 359011
Adrian Prantl [Tue, 23 Apr 2019 16:42:35 +0000 (16:42 +0000)]
[dsymutil] Put Swift interface files into a per-arch subdirectory.
This was meant to be part of the original commit r358921, but somehow
got lost.
<rdar://problem/
49751748>
llvm-svn: 359010
Nico Weber [Tue, 23 Apr 2019 16:37:42 +0000 (16:37 +0000)]
MS ABI: Support mangling op<=> now that MSVC 2019 has a mangling
llvm-svn: 359009
Sanjay Patel [Tue, 23 Apr 2019 16:31:30 +0000 (16:31 +0000)]
[x86] fix test checks for fdiv combine; NFC
Must have picked up some transient code changes when originally generating this.
llvm-svn: 359008
Nico Weber [Tue, 23 Apr 2019 16:20:27 +0000 (16:20 +0000)]
llvm-undname: Support demangling the spaceship operator
Also add a test for demanling the co_await operator.
llvm-svn: 359007
Sanjay Patel [Tue, 23 Apr 2019 16:16:16 +0000 (16:16 +0000)]
[x86] add tests for vector fdiv with splat divisor; NFC
llvm-svn: 359006
Jonas Devlieghere [Tue, 23 Apr 2019 16:00:43 +0000 (16:00 +0000)]
[Docs] Add missing leading slash
llvm-svn: 359005
Jonas Devlieghere [Tue, 23 Apr 2019 15:57:47 +0000 (15:57 +0000)]
[Docs] Add 301 redirects for old URLs
llvm-svn: 359004
Adrian Prantl [Tue, 23 Apr 2019 15:44:22 +0000 (15:44 +0000)]
[dsymutil] Fix use-after-free when sys::path::append grows the buffer.
<rdar://problem/
50117620>
llvm-svn: 359003
Adrian Prantl [Tue, 23 Apr 2019 15:44:19 +0000 (15:44 +0000)]
Revert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer."
llvm-svn: 359002
Adrian Prantl [Tue, 23 Apr 2019 15:39:13 +0000 (15:39 +0000)]
[dsymutil] Fix use-after-free when sys::path::append grows the buffer.
<rdar://problem/
50117620>
llvm-svn: 359001
Philip Reames [Tue, 23 Apr 2019 15:25:14 +0000 (15:25 +0000)]
[InstCombine] Convert a masked.load of a dereferenceable address to an unconditional load
If we have a masked.load from a location we know to be dereferenceable, we can simply issue a speculative unconditional load against that address. The key advantage is that it produces IR which is well understood by the optimizer. The select (cnd, load, passthrough) form produced should be pattern matchable back to hardware predication if profitable.
Differential Revision: https://reviews.llvm.org/D59703
llvm-svn: 359000
Sanjay Patel [Tue, 23 Apr 2019 15:20:17 +0000 (15:20 +0000)]
[x86] use psubus for more vsetcc lowering (PR39859)
Circling back to a leftover bit from PR39859:
https://bugs.llvm.org/show_bug.cgi?id=39859#c1
...we have this counter-intuitive (based on the test diffs) opportunity to use 'psubus'.
This appears to be the better perf option for both Haswell and Jaguar based on llvm-mca.
We already do this transform for the SETULT predicate, so this makes the code more
symmetrical too. If we have pminub/pminuw, we prefer those, so this should not affect
anything but pre-SSE4.1 subtargets.
$ cat before.s
movdqa -16(%rip), %xmm2 ## xmm2 = [32768,32768,32768,32768,32768,32768,32768,32768]
pxor %xmm0, %xmm2
pcmpgtw -32(%rip), %xmm2 ## xmm2 = [255,255,255,255,255,255,255,255]
pand %xmm2, %xmm0
pandn %xmm1, %xmm2
por %xmm2, %xmm0
$ cat after.s
movdqa -16(%rip), %xmm2 ## xmm2 = [256,256,256,256,256,256,256,256]
psubusw %xmm0, %xmm2
pxor %xmm3, %xmm3
pcmpeqw %xmm2, %xmm3
pand %xmm3, %xmm0
pandn %xmm1, %xmm3
por %xmm3, %xmm0
$ llvm-mca before.s -mcpu=haswell
Iterations: 100
Instructions: 600
Total Cycles: 909
Total uOps: 700
Dispatch Width: 4
uOps Per Cycle: 0.77
IPC: 0.66
Block RThroughput: 1.8
$ llvm-mca after.s -mcpu=haswell
Iterations: 100
Instructions: 700
Total Cycles: 409
Total uOps: 700
Dispatch Width: 4
uOps Per Cycle: 1.71
IPC: 1.71
Block RThroughput: 1.8
Differential Revision: https://reviews.llvm.org/D60838
llvm-svn: 358999
Joerg Sonnenberger [Tue, 23 Apr 2019 15:15:33 +0000 (15:15 +0000)]
[SPARC] Use the correct register set for the "r" asm constraint.
64bit mode must use 64bit registers, otherwise assumptions about the top
half of the registers are made. Problem found by Takeshi Nakayama in
NetBSD.
llvm-svn: 358998
David Blaikie [Tue, 23 Apr 2019 15:03:24 +0000 (15:03 +0000)]
Revert "DebugInfo: Emit only one kind of accelerated access/name table"
Regresses some apple_names situations - still investigating.
This reverts commit r358931.
llvm-svn: 358997
Fangrui Song [Tue, 23 Apr 2019 14:51:27 +0000 (14:51 +0000)]
Use llvm::stable_sort
While touching the code, simplify if feasible.
llvm-svn: 358996
Sam Clegg [Tue, 23 Apr 2019 14:49:38 +0000 (14:49 +0000)]
[WebAssembly] Fix typo in relocation checking
Runtime relocation are generated for relocations of type
R_WASM_MEMORY_ADDR_I32 when in PIC mode (either -shared or -pie).
Followup on https://reviews.llvm.org/D60882.
Differential Revision: https://reviews.llvm.org/D60992
llvm-svn: 358995
Lewis Revill [Tue, 23 Apr 2019 14:46:13 +0000 (14:46 +0000)]
[RISCV] Support assembling %tls_{ie,gd}_pcrel_hi modifiers
This patch adds support for parsing and assembling the %tls_ie_pcrel_hi
and %tls_gd_pcrel_hi modifiers.
Differential Revision: https://reviews.llvm.org/D55342
llvm-svn: 358994
Nico Weber [Tue, 23 Apr 2019 14:32:18 +0000 (14:32 +0000)]
gn build: Merge r358944
llvm-svn: 358993
Scott Linder [Tue, 23 Apr 2019 14:31:17 +0000 (14:31 +0000)]
[AMDGPU] Fix hidden argument metadata duplication for V3
Essentially complete a proper rebase of the V3 metadata change over
https://reviews.llvm.org/D49096.
Minimize the diff between the V2 and V3 variants of the relevant lit
tests, and clean up some trailing whitespace.
llvm-svn: 358992
Nico Weber [Tue, 23 Apr 2019 14:31:15 +0000 (14:31 +0000)]
gn build: Merge r358949
llvm-svn: 358991
George Rimar [Tue, 23 Apr 2019 14:21:31 +0000 (14:21 +0000)]
[LLD][ELF] - Remove dynamic-section-sh_size.elf binary, convert test to yaml. NFCI.
dynamic-section-sh_size.elf was introduced in D25090.
Now it is possible to use yaml2obj instead.
That is what this patch does.
Also I added one more case of a possibly broken .dynamic
section just in case.
llvm-svn: 358990
Simon Pilgrim [Tue, 23 Apr 2019 14:07:49 +0000 (14:07 +0000)]
[X86] Pull out collectConcatOps helper. NFCI.
Create collectConcatOps helper that returns all the subvector ops for CONCAT_VECTORS or a INSERT_SUBVECTOR series.
llvm-svn: 358989
Louis Dionne [Tue, 23 Apr 2019 14:05:04 +0000 (14:05 +0000)]
[libc++] Remove redundant conditionals for Apple platforms
Summary:
In a bunch of places, we used to check whether LIBCXX_BUILDING_LIBCXXABI
is defined OR we're building for an Apple platform. This used to
be necessary in a time when Apple's build script did NOT define
LIBCXX_BUILDING_LIBCXXABI. However this is not relevant anymore
since Apple's build does define LIBCXX_BUILDING_LIBCXXABI.
Reviewers: EricWF
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D60842
llvm-svn: 358988
Tim Northover [Tue, 23 Apr 2019 13:50:13 +0000 (13:50 +0000)]
ARM: disallow add/sub to sp unless Rn is also sp.
The manual says that Thumb2 add/sub instructions are only allowed to modify sp
if the first source is also sp. This is slightly different from the usual rGPR
restriction since it's context-sensitive, so implement it in C++.
llvm-svn: 358987
Roman Lebedev [Tue, 23 Apr 2019 13:46:18 +0000 (13:46 +0000)]
[Docs] ReleaseNotes: fixup markup in memcmp()->bcmp() entry
llvm-svn: 358986
George Rimar [Tue, 23 Apr 2019 13:27:54 +0000 (13:27 +0000)]
[LLD][ELF] - Remove file-class.a binary from inputs and improve the test case.
file-class.a was used to diagnose the "corrupted ELF file: invalid file class"
error when the object was fetched from the archive.
file-class.a contained an object of 16 bytes size. I replaced it with
an echo call (because it is impossible to use yaml2obj for that, and I am
not sure it is worth to support), and also increased its size to 18 bytes.
That allowed to also test a case when such object is a regular input and not an
archive member (we have a bit different logic for these cases).
llvm-svn: 358985
Sanjay Patel [Tue, 23 Apr 2019 13:16:41 +0000 (13:16 +0000)]
[DAGCombiner] generalize binop-of-splats scalarization
If we only match build vectors, we can miss some patterns
that use shuffles as seen in the affected tests.
Note that the underlying calls within getSplatSourceVector()
have the potential for compile-time explosion because of
exponential recursion looking through binop opcodes, but
currently the list of supported opcodes is very limited.
Both of those problems should be addressed in follow-up
patches.
llvm-svn: 358984
Nicolai Haehnle [Tue, 23 Apr 2019 13:12:52 +0000 (13:12 +0000)]
AMDGPU: Fix LCSSA phi lowering in SILowerI1Copies
Summary:
When an LCSSA phi survives through instruction selection, the pass
ends up removing that phi entirely because it is dominated by the
logic that does the lanemask merging.
This then used to trigger an assertion when processing a dependent
phi instruction.
Change-Id: Id4949719f8298062fe476a25718acccc109113b6
Reviewers: llvm-commits
Subscribers: kzhuravl, jvesely, wdng, yaxunl, t-tye, tpr, dstuttard, rtaylor, arsenm
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60999
llvm-svn: 358983
Fedor Sergeev [Tue, 23 Apr 2019 12:43:27 +0000 (12:43 +0000)]
[CallSite removal] move InlineCost to CallBase usage
Converting InlineCost interface and its internals into CallBase usage.
Inliners themselves are still not converted.
Reviewed By: reames
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60636
llvm-svn: 358982
Andrew Ng [Tue, 23 Apr 2019 12:38:52 +0000 (12:38 +0000)]
[ELF] Change default output section type to SHT_PROGBITS
This fixes an issue where a symbol only section at the start of a
PT_LOAD segment, causes incorrect alignment of the file offset for the
start of the segment which results in the output of an invalid ELF.
SHT_PROGBITS was the default output section type in the past.
Differential Revision: https://reviews.llvm.org/D60131
llvm-svn: 358981
Alexandre Ganea [Tue, 23 Apr 2019 12:30:49 +0000 (12:30 +0000)]
[LLD][COFF] Fix /linkrepro with output options that take a filename or path
The following options: /pdb, /out or /implib now emit in the repro.tar/response.txt only a filename stripped from its path, to avoid non-existent paths on the reproducer's machine.
Differential Revision: https://reviews.llvm.org/D59530
llvm-svn: 358980
Andrew Ng [Tue, 23 Apr 2019 12:17:15 +0000 (12:17 +0000)]
[ELF] Change findOrphanPos to only consider live sections
This patch changes the behaviour of findOrphanPos to only consider live
sections when placing orphan sections. This used to be how it behaved in
the past.
Differential Revision: https://reviews.llvm.org/D60273
llvm-svn: 358979
Aaron Ballman [Tue, 23 Apr 2019 12:16:28 +0000 (12:16 +0000)]
Removing the explicit specifier from some default constructors; NFC.
llvm-svn: 358978
David Green [Tue, 23 Apr 2019 12:11:26 +0000 (12:11 +0000)]
[ARM] Update check for CBZ in Ifcvt
The check for creating CBZ in constant island pass recently obtained the
ability to search backwards to find a Cmp instruction. The code in IfCvt should
mirror this to allow more conversions to the smaller form. The common code has
been pulled out into a separate function to be shared between the two places.
Differential Revision: https://reviews.llvm.org/D60090
llvm-svn: 358977
Pavel Labath [Tue, 23 Apr 2019 11:50:07 +0000 (11:50 +0000)]
Move postfix expression code out of the NativePDB plugin
Summary:
The NativePDB plugin contains code to convert "programs" describing the
layout of function frames into dwarf (for easier interaction with the
rest of lldb). This functionality is useful for the Breakpad plugin too,
as it contains the same kind of expressions (because breakpad info is
generated from pdb files).
In this patch, I move the core classes of this code into a common place,
where it can be used from both files. Previously, these were the details
of the implementation, but here I am exposing them (instead of just a
single "string->string" conversion function), as breakpad will need to
use these in a slightly different way. The reason for that is that
breakpad files generated from dwarf expressions use a slightly different
syntax, although most of the core code can be reused with a bit of
thought.
This is also the reason why I am not moving the parsing or dwarf
generation bits, as they will need to be generalized a bit before
they're usable for both scenarios.
This patch should be NFC, modulo renaming the moved entities to more
neutral names.
The reason I am moving this to the "Symbol" library, is because both
customers will be "Symbol"Files, and also the unwinding code lives in
the Symbol library. From a purely dependency standpoint this code will
probably be standalone, and so it could be moved all the way to Utility,
but that seems too low for this kind of functionality.
Reviewers: jasonmolenda, amccarth, clayborg, JDevlieghere, aleksandr.urakov
Subscribers: aprantl, markmentovai, lldb-commits
Differential Revision: https://reviews.llvm.org/D60599
llvm-svn: 358976
Fangrui Song [Tue, 23 Apr 2019 11:47:28 +0000 (11:47 +0000)]
[PPC][PPC64] Improve some llvm-objdump -d -D tests
Various improvement:
Some offsets in disassembly are incorrect after several layout adjustment. Fix them.
llvm-objdump -D should not be used. -D dumps unrelated non-text sections. Replace them with llvm-objdump -d, llvm-readelf -x, etc
Many llvm-objdump -d tests use {{.*}} . Add the option --no-show-raw-insn to avoid check hex bytes.
ppc64-long-branch.s does not need a shared object. Delete it.
Make ppc64-ifunc.s check 2 ifuncs.
Reviewers: ruiu, espindola
Subscribers: emaste, nemanjai, arichardson, kbarton, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60998
llvm-svn: 358975
David Green [Tue, 23 Apr 2019 11:46:58 +0000 (11:46 +0000)]
[ARM] Don't replicate instructions in Ifcvt at minsize
Ifcvt can replicate instructions as it converts them to be predicated. This
stops that from happening on thumb2 targets at minsize where an extra IT
instruction is likely needed.
Differential Revision: https://reviews.llvm.org/D60089
llvm-svn: 358974
Simon Pilgrim [Tue, 23 Apr 2019 11:45:28 +0000 (11:45 +0000)]
Fix "-Wimplicit-fallthrough" warning. NFCI.
llvm-svn: 358973
George Rimar [Tue, 23 Apr 2019 11:19:51 +0000 (11:19 +0000)]
[LLD][ELF] - Fix mips-invalid-options-descriptor.s test case and convert to YAML.
It was initially introduced in D25229 to report the "zero option descriptor size"
error message. In following commits it was broken and did not report this
error anymore. I think that happened because elf object was a result of fuzzing
and it was broken in many ways.
This patch converts this test to a YAML, removes a binary and hence fixes the
original intention.
llvm-svn: 358972
Adam Balogh [Tue, 23 Apr 2019 11:18:50 +0000 (11:18 +0000)]
[Analyzer] Second fix for last commit for IteratorChecker
A variable was redeclared instead of assigned in an internal
block, leaving the original uninitialized. This is fixed now.
llvm-svn: 358971
Simon Pilgrim [Tue, 23 Apr 2019 11:16:16 +0000 (11:16 +0000)]
Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI.
llvm-svn: 358970
Simon Pilgrim [Tue, 23 Apr 2019 11:11:34 +0000 (11:11 +0000)]
Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFCI.
llvm-svn: 358969
Rafael Stahl [Tue, 23 Apr 2019 11:04:41 +0000 (11:04 +0000)]
[analyzer][CrossTU] Extend CTU to VarDecls with initializer
Summary:
The existing CTU mechanism imports `FunctionDecl`s where the definition is available in another TU. This patch extends that to VarDecls, to bind more constants.
- Add VarDecl importing functionality to CrossTranslationUnitContext
- Import Decls while traversing them in AnalysisConsumer
- Add VarDecls to CTU external mappings generator
- Name changes from "external function map" to "external definition map"
Reviewers: NoQ, dcoughlin, xazax.hun, george.karpenkov, martong
Reviewed By: xazax.hun
Subscribers: Charusso, baloghadamsoftware, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, george.karpenkov, mgorny, whisperity, szepet, rnkovacs, a.sidorin, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D46421
llvm-svn: 358968
Pavel Labath [Tue, 23 Apr 2019 10:04:22 +0000 (10:04 +0000)]
modify-python-lldb: Remove \a-removing code
instead, remove \a directly from the interface files.
llvm-svn: 358967