OSDN Git Service
Florian Hahn [Thu, 9 Jul 2020 17:31:23 +0000 (18:31 +0100)]
[ValueLattice] Simplify canTrackGlobalVariableInterprocedurally (NFC).
using all_of and checking for valid users in the lambda seems more
straight forward. Also adds a comment explaining what we are checking.
Daniel Grumberg [Thu, 25 Jun 2020 12:34:22 +0000 (13:34 +0100)]
Merge TableGen files used for clang options
Summary:
Putting all the options in the same file is needed so they can be
ordered based on the dependencies between them.
Reviewers: Bigcheese, jdoerfert
Subscribers: dexonsmith, sstefan1, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82574
Louis Dionne [Thu, 9 Jul 2020 17:25:27 +0000 (13:25 -0400)]
[libc++] Move the long_tests Lit feature to the DSL
Louis Dionne [Thu, 9 Jul 2020 17:18:24 +0000 (13:18 -0400)]
[libc++] Move the stdlib Lit parameter to the DSL
Louis Dionne [Thu, 9 Jul 2020 17:03:00 +0000 (13:03 -0400)]
[libc++] Fix test failure in C++03 mode
Hiroshi Yamauchi [Wed, 8 Jul 2020 21:00:15 +0000 (14:00 -0700)]
[PGO][PGSO] Add profile guided size optimization tests to X86 ISel Lowering.
Sergej Jaskiewicz [Thu, 9 Jul 2020 16:46:20 +0000 (19:46 +0300)]
[compiler-rt] [test] Allow expanding lit substitutions recursively
Summary:
This allows using lit substitutions in the `COMPILER_RT_EMULATOR` variable.
(For reference, the ability to expand substitutions recursively has been introduced in https://reviews.llvm.org/D76178.)
Reviewers: phosek, compnerd
Reviewed By: compnerd
Subscribers: dberris, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D83489
Louis Dionne [Thu, 9 Jul 2020 15:54:09 +0000 (11:54 -0400)]
[runtimes] Allow passing Lit parameters through CMake
This allows passing parameters to the test suites without using
LLVM_LIT_ARGS. The problem is that we sometimes want to set some
Lit arguments on the CMake command line, but the Lit parameters in
a CMake cache file. If the only knob to do that is LLVM_LIT_ARGS,
the command-line entry overrides the cache one, and the parameters
set by the cache are ignored.
This fixes a current issue with the build bots that they completely
ignore the 'std' param set by Lit, because other Lit arguments are
provided via LLVM_LIT_ARGS on the CMake command-line.
Sergej Jaskiewicz [Thu, 9 Jul 2020 16:42:08 +0000 (19:42 +0300)]
[compiler-rt] [test] Use the parent process env as base env in tests
Summary:
Right now the lit config builds up an environment that the tests will be run in. However, it does it from scratch instead of adding new variables to the parent process environment. This may (and does) result in strange behavior when running tests with an executor (i. e. with the `COMPILER_RT_EMULATOR` CMake variable set to something), since the executor may need some of the parent process's environment variables.
Here this is fixed.
Reviewers: compnerd, phosek
Reviewed By: compnerd
Subscribers: dberris, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D83486
Fred Riss [Thu, 9 Jul 2020 16:43:02 +0000 (09:43 -0700)]
[lldb] Use enum constant instead of raw value
Sergej Jaskiewicz [Thu, 9 Jul 2020 16:36:15 +0000 (19:36 +0300)]
[compiler-rt] Better Windows support for running tests in external shell
Summary:
These changes are necessary to support remote running compiler-rt tests
that were compiled on Windows.
Most of the code here has been copy-pasted from other lit configs.
Why do we remove the conversions to ASCII in the crt config?
We set the `universal_newlines` argument to `True` in `Popen` instead.
This is supported in both Python 2.7 and 3, is easier
(no need to do the `str(dir.decode('ascii'))` dance) and less
error prone.
Also, this is necessary because if the config is executed on Windows,
and `execute_external` is `True`, we take the branch
`if sys.platform in ['win32'] and execute_external`,
and if we use Python 3, then the `dir` variable is a byte-like object,
not str, but the ``replace method on byte-like objects requires its
arguments to also be byte-like objects, which is incompatible with
Python 2 etc etc.
It is a lot simpler to just work with strings in the first place, which
is achieved by setting `universal_newlines` to `True`. As far as
I understand, this way wasn't taken because of the need to support
Python <2.7, but this is not the case now.
Reviewers: compnerd, phosek, weimingz
Reviewed By: compnerd
Subscribers: dberris, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D83485
Nikita Popov [Wed, 8 Jul 2020 20:28:29 +0000 (22:28 +0200)]
[AliasSetTracker] More precise AAInfo intersection check
The code currently checks whether the intersection has one of TBAA,
Scope or NoAlias unset -- however, those might have already been
unset in the first place, in which case we will unnecessarily
report a change. Instead, compare the intersection result to the
original AAInfo.
This makes for a 0.5% geomean compile-time saving on CTMark.
Differential Revision: https://reviews.llvm.org/D83430
Stefan Pintilie [Thu, 9 Jul 2020 16:28:32 +0000 (11:28 -0500)]
[PowerPC] Split s34imm into two types
Currently the instruction paddi always takes s34imm as the type for the
34 bit immediate. However, the PC Relative form of the instruction should
not produce the same fixup as the non PC Relative form.
This patch splits the s34imm type into s34imm and s34imm_pcrel so that two
different fixups can be emitted.
Reviewed By: kamaub, nemanjai
Differential Revision: https://reviews.llvm.org/D83255
Florian Hahn [Thu, 9 Jul 2020 16:12:17 +0000 (17:12 +0100)]
[SCCP] Move tests using only ipsccp from IPConstantProp to SCCP (NFC).
Some of the tests in the llvm/test/Transforms/IPConstantProp directory
actually only use -ipsccp. Those tests belong to the other (IP)SCCP
tests in llvm/test/Transforms/SCCP/ and this commits moves them there to
avoid confusion with IPConstantProp.
Hans Wennborg [Thu, 9 Jul 2020 15:47:35 +0000 (17:47 +0200)]
Revert
51b0da73 "Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def.""
It gets miscompiled with GCC 5.3, causing Clang to crash with
"error: unknown target CPU 'x86-64'"
See the llvm-commits thread for reproduction steps.
This reverts commit
51b0da731af75c68dd521e04cc576d5a611b1612.
Dmitri Gribenko [Thu, 9 Jul 2020 15:09:57 +0000 (17:09 +0200)]
Refactored NumericLiteralParser to not require a Preprocessor
Summary:
We would like to use NumericLiteralParser in the implementation of the
syntax tree builder, and plumbing a preprocessor there seems
inconvenient and superfluous.
Reviewers: eduucaldas
Reviewed By: eduucaldas
Subscribers: gribozavr2, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83480
Anatoly Trosinenko [Thu, 9 Jul 2020 14:25:32 +0000 (17:25 +0300)]
[MSP430] Align the _Complex ABI with current msp430-gcc
Assembler output is checked against msp430-gcc 9.2.0.50 from TI.
Reviewed By: asl
Differential Revision: https://reviews.llvm.org/D82646
George Mitenkov [Thu, 9 Jul 2020 14:48:50 +0000 (17:48 +0300)]
[MLIR][SPIRVToLLVM] Conversion of SPIR-V array, runtime array, and pointer types
This patch adds type conversion for 4 SPIR-V types: array, runtime array, pointer
and struct. This conversion is integrated using a separate function
`populateSPIRVToLLVMTypeConversion()` that adds new type conversions. At the moment,
this is a basic skeleton that allows to perfom conversion from SPIR-V array,
runtime array and pointer types to LLVM typesystem. There is no support of array
strides or storage classes. These will be supported on the case by case basis.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D83399
Zhi Zhuang [Thu, 9 Jul 2020 14:10:14 +0000 (07:10 -0700)]
Fix warning caused by __builtin_expect_with_probability was not handled
in places such as constant folding
Previously some places that should have handled
__builtin_expect_with_probability is missing, so in some case it acts
differently than __builtin_expect.
For example it was not handled in constant folding, thus in the
following program, the "if" condition should be constantly true and
folded, but previously it was not handled and cause warning "control may
reach end of non-void function" (while __builtin_expect does not):
__attribute__((noreturn)) extern void bar();
int foo(int x, int y) {
if (y) {
if (__builtin_expect_with_probability(1, 1, 1))
bar();
}
else
return 0;
}
Now it's fixed.
Differential Revisions: https://reviews.llvm.org/D83362
Stefan Pintilie [Thu, 9 Jul 2020 14:50:19 +0000 (09:50 -0500)]
[PowerPC] Support PCRelative Callees for R_PPC64_REL24 Relocation
The R_PPC64_REL24 is used in function calls when the caller requires a
valid TOC pointer. If the callee shares the same TOC or does not clobber
the TOC pointer then a direct call can be made. If the callee does not
share the TOC a thunk must be added to save the TOC pointer for the caller.
Up until PC Relative was introduced all local calls on medium and large code
models were assumed to share a TOC. This is no longer the case because
if the caller requires a TOC and the callee is PC Relative then the callee
can clobber the TOC even if it is in the same DSO.
This patch is to add support for a TOC caller calling a PC Relative callee that
clobbers the TOC.
Reviewed By: sfertile, MaskRay
Differential Revision: https://reviews.llvm.org/D82950
George Mitenkov [Thu, 9 Jul 2020 14:20:38 +0000 (17:20 +0300)]
[MLIR][SPIRVToLLVM] SPIR-V types size in bytes function
Added `getSizeInBytes()` function as a class member to several SPIR-V types:
`ScalarType`, `ArrayType` and `VectorType`. This function aims at exposing
the functionality of `getTypeNumBytes()` from `SPIRVLowering.cpp`. Support
of more types will be added on demand.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D83285
Eric Schweitz [Thu, 9 Jul 2020 14:39:44 +0000 (07:39 -0700)]
[flang] partially revert upstreamed code to support complex values in runtime support to avoid warnings.
Diogo Sampaio [Thu, 9 Jul 2020 14:30:24 +0000 (15:30 +0100)]
[NFC] Add SExt multiuses test
Matt Arsenault [Thu, 9 Jul 2020 14:22:22 +0000 (10:22 -0400)]
AMDGPU/GlobalISel: Work around verifier error in test
The unfortunate split between finalizeLowering and the selector pass
means there's a point where the verifier fails. The DAG selector pass
skips the verifier, but this seems to not work when using the
GlobalISel fallback.
Simon Pilgrim [Thu, 9 Jul 2020 14:00:57 +0000 (15:00 +0100)]
Fix MSVC "not all control paths return a value" warning. NFC.
David Green [Thu, 9 Jul 2020 12:06:51 +0000 (13:06 +0100)]
[BasicAA] Enable -basic-aa-recphi by default
This option was added a while back, to help improve AA around pointer
phi loops. It looks for phi(gep(phi, const), x) loops, checking if x can
then prove more precise aliasing info.
Differential Revision: https://reviews.llvm.org/D82998
Matt Arsenault [Fri, 26 Jun 2020 15:36:22 +0000 (11:36 -0400)]
OpaquePtr: Don't check pointee type for byval/preallocated
Since none of these users really care about the actual type, hide the
type under a new size-getting attribute to go along with
hasPassPointeeByValueAttr. This will work better for the future byref
attribute, which may end up only tracking the byte size and not the IR
type.
We currently have 3 parameter attributes that should carry the type
(technically inalloca does not yet). The APIs are somewhat awkward
since preallocated/inalloca piggyback on byval in some places, but in
others are treated as distinct attributes. Since these are all
mutually exclusive, we should probably just merge all the attribute
infrastructure treating these as totally distinct attributes.
Gabor Marton [Thu, 9 Jul 2020 12:26:23 +0000 (14:26 +0200)]
[analyzer] Add CTUImportCppThreshold for C++ files
Summary:
The default CTUImportThreshold (8) seems to be too conservative with C projects.
We increase this value to 24 and we introduce another threshold for C++ source
files (defaulted to 8) because their AST is way more compilcated than C source
files.
Differential Revision: https://reviews.llvm.org/D83475
Luboš Luňák [Sun, 3 Nov 2019 20:15:03 +0000 (21:15 +0100)]
make -fmodules-codegen and -fmodules-debuginfo work also with PCHs
Allow to build PCH's (with -building-pch-with-obj and the extra .o file)
with -fmodules-codegen -fmodules-debuginfo to allow emitting shared code
into the extra .o file, similarly to how it works with modules. A bit of
a misnomer, but the underlying functionality is the same. This saves up
to 20% of build time here. The patch is fairly simple, it basically just
duplicates -fmodules checks to also alternatively check
-building-pch-with-obj.
This already got committed as
cbc9d22e49b434b6ceb2eb94b67079d02e0a7b74,
but then got reverted in
7ea9a6e0220da36ff2fd1fbc29c2755be23e5166
because of PR44953, as discussed in D74846. This is a corrected version
which does not include two places for the PCH case that aren't included
in the modules -fmodules-codegen path either.
Differential Revision: https://reviews.llvm.org/D69778
Simon Pilgrim [Thu, 9 Jul 2020 12:25:12 +0000 (13:25 +0100)]
[X86][AVX] Attempt to fold extract_subvector(shuffle(X)) -> extract_subvector(X)
If we're extracting a subvector from a shuffle that is shuffling entire subvectors we can peek through and extract the subvector from the shuffle source instead.
This helps remove some cases where concat_vectors(extract_subvector(),extract_subvector()) legalizations has resulted in BLEND/VPERM2F128 shuffles of the subvectors.
Simon Pilgrim [Thu, 9 Jul 2020 10:51:24 +0000 (11:51 +0100)]
BasicAAResult::constantOffsetHeuristic - pass APInt arg as const reference. NFCI.
Avoids unnecessary APInt copies and silences clang tidy warning.
Sam Elliott [Thu, 9 Jul 2020 12:41:28 +0000 (13:41 +0100)]
[RISCV] Avoid Splitting MBB in RISCVExpandPseudo
Since the `RISCVExpandPseudo` pass has been split from
`RISCVExpandAtomicPseudo` pass, it would be nice to run the former as
early as possible (The latter has to be run as late as possible to
ensure correctness). Running earlier means we can reschedule these pairs
as we see fit.
Running earlier in the machine pass pipeline is good, but would mean
teaching many more passes about `hasLabelMustBeEmitted`. Splitting the
basic blocks also pessimises possible optimisations because some
optimisations are MBB-local, and others are disabled if the block has
its address taken (which is notionally what `hasLabelMustBeEmitted`
means).
This patch uses a new approach of setting the pre-instruction symbol on
the AUIPC instruction to a temporary symbol and referencing that. This
avoids splitting the basic block, but allows us to reference exactly the
instruction that we need to. Notionally, this approach seems more
correct because we do actually want to address a specific instruction.
This then allows the pass to be moved much earlier in the pass pipeline,
before both scheduling and register allocation. However, to do so we
must leave the MIR in SSA form (by not redefining registers), and so use
a virtual register for the intermediate value. By using this virtual
register, this pass now has to come before register allocation.
Reviewed By: luismarques, asb
Differential Revision: https://reviews.llvm.org/D82988
dfukalov [Mon, 29 Jun 2020 12:41:40 +0000 (15:41 +0300)]
SpeculativeExecution: Fix for logic change introduced in D81730.
Summary:
The test case started to hoist bitcasts to upper BB after D81730.
Reverted unintentional logic change. Some instructions may have zero cost but
will not be hoisted by different limitation so should be counted for threshold.
Reviewers: aprantl, arsenm, nhaehnle
Reviewed By: aprantl
Subscribers: wdng, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82761
Benjamin Kramer [Thu, 9 Jul 2020 12:23:46 +0000 (14:23 +0200)]
[DebugInfo] Fix pessimizing move. NFC.
DWARFDebugPubTable.cpp:80:31: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
Igor Kudrin [Thu, 9 Jul 2020 12:15:31 +0000 (19:15 +0700)]
[DebugInfo] Add more checks to parsing .debug_pub* sections.
The patch adds checking for various potential issues in parsing name
lookup tables and reporting them as recoverable errors, similarly as we
do for other tables.
Differential Revision: https://reviews.llvm.org/D83050
Igor Kudrin [Thu, 9 Jul 2020 12:15:11 +0000 (19:15 +0700)]
[DebugInfo] Do not hang when parsing a malformed .debug_pub* section.
The parsing method did not check reading errors and might easily fall
into an infinite loop on an invalid input because of that.
Differential Revision: https://reviews.llvm.org/D83049
Florian Hahn [Thu, 9 Jul 2020 11:59:24 +0000 (12:59 +0100)]
[SCCP] Use conditional info with AND/OR branch conditions.
Currently SCCP does not combine the information of conditions joined by
AND in the true branch or OR in the false branch.
For branches on AND, 2 copies will be inserted for the true branch, with
one being the operand of the other as in the code below. We can combine
the information using intersection. Note that for the OR case, the
copies are inserted in the false branch, where using intersection is
safe as well.
define void @foo(i32 %a) {
entry:
%lt = icmp ult i32 %a, 100
%gt = icmp ugt i32 %a, 20
%and = and i1 %lt, %gt
; Has predicate info
; branch predicate info { TrueEdge: 1 Comparison: %lt = icmp ult i32 %a, 100 Edge: [label %entry,label %true] }
%a.0 = call i32 @llvm.ssa.copy.
140247425954880(i32 %a)
; Has predicate info
; branch predicate info { TrueEdge: 1 Comparison: %gt = icmp ugt i32 %a, 20 Edge: [label %entry,label %false] }
%a.1 = call i32 @llvm.ssa.copy.
140247425954880(i32 %a.0)
br i1 %and, label %true, label %false
true: ; preds = %entry
call void @use(i32 %a.1)
%true.1 = icmp ne i32 %a.1, 20
call void @use.i1(i1 %true.1)
ret void
false: ; preds = %entry
call void @use(i32 %a.1)
ret void
}
Reviewers: efriedma, davide, mssimpso, nikic
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D77808
Benjamin Kramer [Thu, 9 Jul 2020 11:48:56 +0000 (13:48 +0200)]
Make helpers static. NFC.
Kirill Bobyrev [Thu, 9 Jul 2020 10:52:42 +0000 (12:52 +0200)]
[clangd] Implement path and URI translation for remote index
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ormris, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82938
Xing GUO [Thu, 9 Jul 2020 10:52:28 +0000 (18:52 +0800)]
[DWARFYAML] Use override instead of virtual for better safety.
Functions in DWARFYML::FixupVisitor are declared as
virtual functions in its base class DWARFYAML::Visitor.
We should use the mordern "override" keyword instead
of "virtual" for virtual functions in subclasses for
better safety.
Besides, the visibility is changed from private to
protected to make it consistent with
DWARFYAML::FixupVisitor class and DWARFYAML::Visitor
class.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D83452
Paul Walker [Thu, 9 Jul 2020 10:02:20 +0000 (10:02 +0000)]
[SVE] Scalarize fixed length masked loads and stores.
When adding support for scalable vector masked loads and stores we
accidently opened up likewise for fixed length vectors. This patch
restricts support to scalable vectors only, thus ensuring fixed
length vectors are treated the same regardless of SVE support.
Differential Revision: https://reviews.llvm.org/D83341
Paul Walker [Thu, 9 Jul 2020 10:01:03 +0000 (10:01 +0000)]
[SVE] Disable some BUILD_VECTOR related code generator features.
Fixed length vector code generation for SVE does not yet custom
lower BUILD_VECTOR and instead relies on expansion. At the same
time custom lowering for VECTOR_SHUFFLE is also not available so
this patch updates isShuffleMaskLegal to reject vector types that
require SVE.
Related to this it also prevents the merging of stores after
legalisation because this only works when BUILD_VECTOR is either
legal or can be elminated. When this is not the case the code
generator enters an infinite legalisation loop.
Differential Revision: https://reviews.llvm.org/D83408
Georgii Rymar [Wed, 8 Jul 2020 13:27:29 +0000 (16:27 +0300)]
[llvm-readelf] - Stop using 'unwrapOrError()' in 'ELFDumper<ELFT>::getSymbolVersion'.
This allows to propagate an error and report a warning properly.
Differential revision: https://reviews.llvm.org/D83393
Simon Pilgrim [Thu, 9 Jul 2020 10:26:08 +0000 (11:26 +0100)]
DebugCounterList::printOptionInfo - use const auto& iterator in for-range-loop.
Avoids unnecessary copies and silences clang tidy warning.
Nathan James [Thu, 9 Jul 2020 10:29:49 +0000 (11:29 +0100)]
[change-namespace][NFC] Clean up joinNamespaces
Jun Ma [Wed, 8 Jul 2020 07:12:04 +0000 (15:12 +0800)]
[Coroutines] Refactor sinkLifetimeStartMarkers
Differential Revision: https://reviews.llvm.org/D83379
Simon Pilgrim [Thu, 9 Jul 2020 10:16:47 +0000 (11:16 +0100)]
ConstantFoldScalarCall3 - use const APInt& returned by getValue()
Avoids unnecessary APInt copies and silences clang tidy warning.
Simon Pilgrim [Thu, 9 Jul 2020 10:06:39 +0000 (11:06 +0100)]
Fix MSVC "not all control paths return a value" warning. NFC.
Simon Pilgrim [Thu, 9 Jul 2020 09:55:50 +0000 (10:55 +0100)]
VersionPrinter - use const auto& iterator in for-range-loop.
Avoids unnecessary copies and silences clang tidy warning.
Dmitry Polukhin [Wed, 20 May 2020 15:06:41 +0000 (08:06 -0700)]
[yaml][clang-tidy] Fix multiline YAML serialization
Summary:
New line duplication logic introduced in https://reviews.llvm.org/D63482
has two issues: (1) there is no logic that removes duplicate newlines
when clang-apply-replacment reads YAML and (2) in general such logic
should be applied to all strings and should happen on string
serialization level instead in YAML parser.
This diff changes multiline strings quotation from single quote `'` to
double `"`. It solves problems with internal newlines because now they are
escaped. Also double quotation solves the problem with leading whitespace after
newline. In case of single quotation YAML parsers should remove leading
whitespace according to specification. In case of double quotation these
leading are internal space and they are preserved. There is no way to
instruct YAML parsers to preserve leading whitespaces after newline so
double quotation is the only viable option that solves all problems at
once.
Test Plan: check-all
Reviewers: gribozavr, mgehre, yvvan
Subscribers: xazax.hun, hiraditya, cfe-commits, llvm-commits
Tags: #clang-tools-extra, #clang, #llvm
Differential Revision: https://reviews.llvm.org/D80301
Tres Popp [Thu, 2 Jul 2020 09:18:08 +0000 (11:18 +0200)]
[mlir] Add additional Canonicalization of shape.cstr_broadcastable.
Summary:
Added canonicalization and folding was:
- Folding when either input is an attribute indicating a scalar input
which can always be broadcasted.
- Canonicalization where it can be determined that either input shape is
a scalar.
- Canonicalization where the partially specified input shapes can be
proven to be broadcastable always.
Differential Revision: https://reviews.llvm.org/D83194
serge-sans-paille [Thu, 9 Jul 2020 07:46:16 +0000 (09:46 +0200)]
Correctly update return status for MVEGatherScatterLowering
`Changed` should reflect all possible changes.
Differential Revision: https://reviews.llvm.org/D83459
Oliver Stannard [Tue, 17 Mar 2020 14:21:42 +0000 (14:21 +0000)]
[llvm-objdump] Display locations of variables alongside disassembly
This adds the --debug-vars option to llvm-objdump, which prints
locations (registers/memory) of source-level variables alongside the
disassembly based on DWARF info. A vertical line is printed for each
live-range, with a label at the top giving the variable name and
location, and the position and length of the line indicating the program
counter range in which it is valid.
Differential revision: https://reviews.llvm.org/D70720
Kadir Cetinkaya [Tue, 7 Jul 2020 10:30:58 +0000 (12:30 +0200)]
[clangd] Enable async preambles by default
Summary:
We've been testing this internally for a couple weeks now and it seems
to be stable enough. Let's flip the flag before branch cut to increase testing
coverage and have enough time to revert if need be.
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83290
Florian Hahn [Thu, 9 Jul 2020 08:43:16 +0000 (09:43 +0100)]
[PredicateInfo] Add additional RenamedOp field to PB.
OriginalOp of a predicate always refers to the original IR
value that was renamed. So for nested predicates of the same value, it
will always refer to the original IR value.
For the use in SCCP however, we need to find the renamed value that is
currently used in the condition associated with the predicate. This
patch adds a new RenamedOp field to do exactly that.
NewGVN currently relies on the existing behavior to merge instruction
metadata. A test case to check for exactly that has been added in
195fa4bfae10.
Reviewers: efriedma, davide, nikic
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D78133
Lucas Prates [Thu, 25 Jun 2020 14:01:02 +0000 (15:01 +0100)]
[CodeGen] Matching promoted type for 16-bit integer bitcasts from fp16 operand
Summary:
When legalizing a biscast operation from an fp16 operand to an i16 on a
target that requires both input and output types to be promoted to
32-bits, an assertion can fail when building the new node due to a
mismatch between the the operation's result size and the type specified to
the node.
This patches fix the issue by making sure the bit width of the types
match for the FP_TO_FP16 node, covering the difference with an extra
ANYEXTEND operation.
Reviewers: ostannard, efriedma, pirama, jmolloy, plotfi
Reviewed By: efriedma
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82552
Shengchen Kan [Thu, 9 Jul 2020 07:06:27 +0000 (15:06 +0800)]
[MC] Simplify the logic of applying fixup for fragments, NFCI
Replace mutiple `if else` clauses with a `switch` clause and remove redundant checks. Before this patch, we need to add a statement like `if(!isa<MCxxxFragment>(Frag)) ` here each time we add a new kind of `MCEncodedFragment` even if it has no fixups. After this patch, we don't need to do that.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D83366
serge-sans-paille [Thu, 9 Jul 2020 07:36:41 +0000 (09:36 +0200)]
Fix return status of AtomicExpandPass
Correctly reflect change in the return status.
Differential Revision: https://reviews.llvm.org/D83457
Sam McCall [Wed, 8 Jul 2020 22:13:54 +0000 (00:13 +0200)]
[clangd] Fix error handling in config.yaml parsing.
Summary:
A few things were broken:
- use of Document::parseBlockNode() is incorrect and prevents moving to the
next doc in error cases. Use getRoot() instead.
- bailing out in the middle of iterating over a list/dict isn't allowed,
unless you are going to throw away the parser: the next skip() asserts.
Always consume all items.
- There were two concepts of fatal errors: error-diagnostics and drop-fragment.
(The latter is the "return false" case in the parser). They didn't coincide.
Now, parser errors and explicitly emitted error diagnostics are fatal.
Fixes https://github.com/clangd/clangd/issues/452
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83436
Kai Luo [Thu, 9 Jul 2020 06:51:49 +0000 (06:51 +0000)]
[PowerPC] Only make copies of registers on stack in variadic function when va_start is called
On PPC64, for a variadic function, if va_start is not called, it won't
access any variadic argument on stack, thus we can save stores of
registers used to pass arguments.
Differential Revision: https://reviews.llvm.org/D82361
Vitaly Buka [Thu, 9 Jul 2020 06:57:13 +0000 (23:57 -0700)]
[StackSafety,NFC] Update documentation
It's follow up for D80908
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D82941
Craig Topper [Thu, 9 Jul 2020 06:40:37 +0000 (23:40 -0700)]
[X86] Remove unnecessary union from getHostCPUFeatures. NFC
This seems to be leftover copied from an older implementation
of getHostCPUName where we needed this to check the name of
CPU vendor. We don't check the CPU vendor at all in
getHostCPUFeatures so this union and the variable are unneeded.
Douglas Yung [Thu, 9 Jul 2020 06:29:47 +0000 (23:29 -0700)]
Increase DIAG_SIZE_AST as we have hit it.
Johannes Doerfert [Thu, 9 Jul 2020 06:04:16 +0000 (01:04 -0500)]
[OpenMP] Make complex soft-float functions on the GPU weak definitions
To avoid linkage errors we have to ensure the linkage allows multiple
definitions of these compiler inserted functions. Since they are on the
cold path of complex computations, we want to avoid `inline`. Instead,
we opt for `weak` and `noinline` for now.
Louis Dionne [Thu, 9 Jul 2020 05:13:32 +0000 (01:13 -0400)]
[libc++] Fix test failures in C++14 mode
Lang Hames [Wed, 8 Jul 2020 04:32:28 +0000 (21:32 -0700)]
[ORC] Modify LazyCallThroughManager to support asynchronous resolution.
Asynchronous resolution is a better fit for handling reentry over
IPC/RPC where we want to avoid blocking a communication handler/thread.
Xing GUO [Thu, 9 Jul 2020 03:59:15 +0000 (11:59 +0800)]
[DWARFYAML][unittest] Refactor parseDWARFYAML().
In this change, `parseDWARFYAML()` is refactored to be able to parse
YAML decription into different data structures. We don't have to craft
the whole DWARF structure for a small test in the future.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D83220
Eric Christopher [Thu, 9 Jul 2020 03:42:22 +0000 (20:42 -0700)]
Fix a typo in an error message.
Stella Laurenzo [Thu, 9 Jul 2020 00:54:56 +0000 (17:54 -0700)]
Add missing CMake bool canonicalizations.
Summary:
* This allows these flags to be passed on the command line with normal CMake bool-interpreted values like ON/OFF instead of requiring 0/1.
* As-is, if passing ON/OFF, these will cause a parse error in lit.site.cfg.py because Python tries to interpret the string literally.
Reviewers: stephenneuendorffer
Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, Kayjukh, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D83451
Qiu Chaofan [Wed, 8 Jul 2020 15:57:44 +0000 (23:57 +0800)]
[Legalizer] Fix wrong operand in split vector helper
This should be a typo introduced in D69275, which may cause an unknown
segment fault in getNode.
Reviewed By: uweigand
Differential Revision: https://reviews.llvm.org/D83376
River Riddle [Thu, 9 Jul 2020 00:44:27 +0000 (17:44 -0700)]
[mlir] Print 0 element DenseElementsAttr as dense<> to fix parser bugs with expected shape.
Depending on where the 0 dimension is within the shape, the parser will currently reject .mlir generated by the printer.
Differential Revision: https://reviews.llvm.org/D83445
Richard Smith [Wed, 8 Jul 2020 23:26:01 +0000 (16:26 -0700)]
Improve diagnostics for constant evaluation that fails because a
variable's initializer is not known.
The hope is that a better diagnostic for this case will reduce the rate
at which duplicates of non-bug PR41093 are reported.
peter klausler [Wed, 8 Jul 2020 20:09:53 +0000 (13:09 -0700)]
[flang] Fix negative unit number hashing
Ensure that external unit number hashing produces a valid
index for a negative unit number, viz. a NEWUNIT=.
Reviewed By: sscalpone
Differential Revision: https://reviews.llvm.org/D83428
Adrian Prantl [Thu, 9 Jul 2020 00:06:27 +0000 (17:06 -0700)]
Fix debugserver reporting of deployment target
This patch fixes debugserver incorrectly returning the SDK version
instead of the minimum deployment target version.
rdar://problem/
65001691
Differential Revision: https://reviews.llvm.org/D83443
Julian Lettner [Fri, 19 Jun 2020 20:32:18 +0000 (13:32 -0700)]
[lit] Add --show-xxx command line options
Provide `--show-xxx` flags for all non-failure result codes, just as we
already do for `--show-xfail` and `--show-unsupported`.
Reviewed By: jdenny
Differential Revision: https://reviews.llvm.org/D82233
Valentin Clement [Wed, 8 Jul 2020 23:54:34 +0000 (19:54 -0400)]
[openmp] Use switch in isAllowedClauseForDirective instead of multiple if
Summary:
Change the test in isAllowedClauseForDirective from if with multiple conditions
to a main switch on directive and then switches on clause for each directive. Version
check is still done with a condition in the return statment.
Reviewers: jdoerfert, jdenny
Reviewed By: jdenny
Subscribers: yaxunl, guansong, sstefan1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83363
Mitch Phillips [Wed, 8 Jul 2020 23:29:29 +0000 (16:29 -0700)]
[NFC] Fix some docs warnings
Summary:
Fixes two minor issues in the docs present under `ninja docs-llvm-html`:
1 - A header is too small:
```
Warning, treated as error:
llvm/llvm/docs/Passes.rst:70:Title underline too short.
``-basic-aa``: Basic Alias Analysis (stateless AA impl)
------------------------------------------------------
```
2 - Multiple definitions on a non-anonymous target (llvm-dev mailing list):
```
Warning, treated as error:
llvm/llvm/docs/DeveloperPolicy.rst:3:Duplicate explicit target name: "llvm-dev mailing list".
```
Reviewers: lattner
Reviewed By: lattner
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83416
Gui Andrade [Wed, 8 Jul 2020 23:07:46 +0000 (23:07 +0000)]
[Sanitizer]: Require !android for protoent test
Matt Arsenault [Wed, 8 Jul 2020 22:38:40 +0000 (18:38 -0400)]
DAG: Remove redundant finalizeLowering call
9cac4e6d1403554b06ec2fc9d834087b1234b695/D32628 intended to eliminate
this, and move all isel pseudo expansion to FinalizeISel. This was a
bad rebase or something, and failed to actually delete this call.
GlobalISel also has a redundant call of finalizeLowering. However, it
requires more work to remove it since it currently triggers a lot of
verifier errors in tests.
LLVM GN Syncbot [Wed, 8 Jul 2020 22:37:03 +0000 (22:37 +0000)]
[gn build] Port
d999cbc9883
Johannes Doerfert [Sun, 12 Apr 2020 07:10:28 +0000 (02:10 -0500)]
[OpenMP] Initial support for std::complex in target regions
This simply follows the scheme we have for other wrappers. It resolves
the current link problem, e.g., `__muldc3 not found`, when std::complex
operations are used on a device.
This will not allow complex make math function calls to work properly,
e.g., sin, but that is more complex (pan intended) anyway.
Reviewed By: tra, JonChesterfield
Differential Revision: https://reviews.llvm.org/D80897
Adrian Prantl [Wed, 8 Jul 2020 22:30:21 +0000 (15:30 -0700)]
Updated the list of supported platforms in LLDB to include Apple silicon.
Matt Arsenault [Wed, 8 Jul 2020 22:19:23 +0000 (18:19 -0400)]
DAG: Remove redundant handling of reg fixups
It looks like
9cac4e6d1403554b06ec2fc9d834087b1234b695 accidentally
added a second copy of this from a bad rebase or something. This
second copy was added, and the finalizeLowering call was not deleted
as intended.
Craig Topper [Wed, 8 Jul 2020 22:19:49 +0000 (15:19 -0700)]
[InstSimplify] Add test cases for opportunities to fold select ?, X, undef -> X when we can prove X isn't poison
Part of addressing post-commit feedback from D83360
Adrian Prantl [Wed, 8 Jul 2020 21:35:02 +0000 (14:35 -0700)]
Unify the ExecutionContextScope computation in Materializer.
This is an NFC cleanup for Clang, and a bugfix for the Swift
branch. In swift-lldb one target may have multiple scratch
TypeSystems, so it is important to pick the one that belongs to the
current frame, rather than the one for the current target.
<rdar://problem/
65001402>
aartbik [Wed, 8 Jul 2020 21:58:04 +0000 (14:58 -0700)]
[mlir] [VectorOps] Expose lowering pass options programmatically
The ConvertVectorToLLVM pass defines options that can be passed
on the command line (currently only reassociation of FP reductions
through -convert-vector-to-llvm='reassociate-fp-reductions). This
CL enables setting these options programmatically (forward looking
to more options than just reassociation, as well as setting the
values from code rather than command line).
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D83420
Gui Andrade [Tue, 7 Jul 2020 17:05:41 +0000 (17:05 +0000)]
sanitizers: Add interceptors for getproto{ent,byname,bynumber}_r
This also allows intercepting these getprotoent functions on Linux as
well, since Linux exposes them.
Differential Revision: https://reviews.llvm.org/D82424
Richard Smith [Wed, 8 Jul 2020 21:26:18 +0000 (14:26 -0700)]
PR46640: Permit the first parameter of a destroying 'operator delete' to
be dependent if it names the right type.
This matches the GCC behavior, but no longer matches the standard
wording. However, the standard wording in this case is not in line with
the intent, which was to require the enclosing class type to be named
directly. I've reported this wording oversight to the committee.
Matt Arsenault [Tue, 9 Jun 2020 01:32:39 +0000 (21:32 -0400)]
GlobalISel: Verify G_BITCAST changes the type
Updated the AArch64 tests the best I could with my vague, inferred
understanding of AArch64 register banks. As far as I can tell, there
is only one 32-bit/64-bit type which will use the gpr register bank,
so we have to use the fpr bank for the other operand.
Louis Dionne [Wed, 8 Jul 2020 20:27:33 +0000 (16:27 -0400)]
[libc++] Make sure the ENABLE_FILESYSTEM variable is always bound
The script always fails otherwise, since we run with 'set -u'
Arthur Eubanks [Wed, 8 Jul 2020 20:20:34 +0000 (13:20 -0700)]
[opt] Remove obsolete --quiet option
git blame shows these were last touched in 2004?
Obsoleted in r13844.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D83409
Christian Kandeler [Wed, 8 Jul 2020 19:19:49 +0000 (12:19 -0700)]
[libclang] Fix crash when visiting a captured VLA
Array returned by LambdaExpr::capture_inits() can contain nullptrs.
Differential Revision: https://reviews.llvm.org/D82629
Davide Italiano [Wed, 8 Jul 2020 20:00:29 +0000 (13:00 -0700)]
Revert "[lldb/API] Overwrite variables with SBLaunchInfo::SetEnvironment(append=true)"
This reverts commit
695b33a56919af8873eecb47cb83fa17a271e99f beacuse
it broke the macOS bot.
Richard Smith [Wed, 8 Jul 2020 20:04:37 +0000 (13:04 -0700)]
Recover more gracefully from stack exhaustion during template argument
deduction.
Template argument deduction can trigger substitution, both with
explicitly-specified template arguments and with deduced template
arguments in various ways. We previously had no check for stack
exhaustion along some of those codepaths, making it fairly easy to crash
clang with a template resulting in a substitution that referred back to
that same template. We should now produce a proper diagnostic for such
cases rather than crashing.
Craig Topper [Wed, 8 Jul 2020 18:56:01 +0000 (11:56 -0700)]
[InstSimplify] Remove select ?, undef, X -> X and select ?, X, undef -> X transforms
As noted here https://lists.llvm.org/pipermail/llvm-dev/2016-October/106182.html and by alive2, this transform isn't valid. If X is poison this potentially propagates poison when it shouldn't.
This same transform still exists in DAGCombiner.
Differential Revision: https://reviews.llvm.org/D83360
Nikita Popov [Wed, 8 Jul 2020 19:43:06 +0000 (21:43 +0200)]
Revert "[NFC] Separate Peeling Properties into its own struct"
This reverts commit
0369dc98f958a1ca2ec05f1897f091129bb16e8a.
Many failing tests.
Nikita Popov [Wed, 8 Jul 2020 19:29:43 +0000 (21:29 +0200)]
[InstSimplify] Handle not inserted instruction gracefully (PR46638)
When simplifying comparisons using a dominating assume, bail out
if the context instruction is not inserted.
Cameron McInally [Wed, 8 Jul 2020 19:38:52 +0000 (14:38 -0500)]
Reword description of ISD::BUILD_VECTOR
Move operand type restriction to the end of the description. This
hopefully makes the intention more clear.
Differential Revision: https://reviews.llvm.org/D83413
Christopher Tetreault [Wed, 8 Jul 2020 19:11:42 +0000 (12:11 -0700)]
[Solaris] Fix Solaris build bots
Reviewers: ro
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83415
Cameron McInally [Wed, 8 Jul 2020 19:03:50 +0000 (14:03 -0500)]
Tighten description of ISD::BUILD_VECTOR
VerifySDNode(...) in SelectionDAG.cpp shows that the operands of a BUILD_VECTOR must all be the same type. This patch cleans up the comment in ISDOpcodes.h to make that more obvious. Also, remove the requirement that the number of elements must be a power-of-2. That's not true.
Differential Revision: https://reviews.llvm.org/D83413