Isuru Fernando [Mon, 8 Jun 2020 19:13:58 +0000 (14:13 -0500)]
[flang] Fix issue of flang/runtime/config.h not being found in out of tree builds
Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=46078
Reviewers: DavidTruby, jdoerfert, PeteSteinfeld, sscalpone, tskeith
Reviewed By: PeteSteinfeld, sscalpone, tskeith
Subscribers: mgorny, llvm-commits, tskeith
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D81266
Hans Wennborg [Mon, 8 Jun 2020 16:36:56 +0000 (18:36 +0200)]
[PGO] CallPromotion: Don't try to pass sret args to varargs functions
It's not allowed by the verifier.
Differential revision: https://reviews.llvm.org/D81409
Arthur Eubanks [Thu, 28 May 2020 22:00:17 +0000 (15:00 -0700)]
Move *San module passes later in the NPM pipeline
Summary:
This fixes pr33372.cpp under the new pass manager.
ASan adds padding to globals. For example, it will change a {i32, i32, i32} to a {{i32, i32, i32}, [52 x i8]}. However, when loading from the {i32, i32, i32}, InstCombine may (after various optimizations) end up loading 16 bytes instead of 12, likely because it thinks the [52 x i8] padding is ok to load from. But ASan checks that padding should not be loaded from.
Ultimately this is an issue of *San passes wanting to be run after all optimizations. This change moves the module passes right next to the corresponding function passes.
Also remove comment that's no longer relevant, this is the last ASan/MSan/TSan failure under the NPM (hopefully...).
As mentioned in https://reviews.llvm.org/rG1285e8bcac2c54ddd924ffb813b2b187467ac2a6, NPM doesn't support LTO + sanitizers, so modified some tests that test for that.
Reviewers: leonardchan, vitalybuka
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81323
Louis Dionne [Mon, 8 Jun 2020 18:58:46 +0000 (14:58 -0400)]
[libc++] Improve tests for iterators.operations
Reduce duplication between the constexpr and the non-constexpr test cases,
and add tests for the return type of the various operations.
Craig Topper [Mon, 8 Jun 2020 18:26:11 +0000 (11:26 -0700)]
[X86] Prevent LowerSELECT from causing suboptimal codegen for __builtin_ffs(X) - 1.
LowerSELECT sees the CMP with 0 and wants to use a trick with SUB
and SBB. But we can use the flags from the BSF/TZCNT.
Fixes PR46203.
Differential Revision: https://reviews.llvm.org/D81312
Hendrik Greving [Fri, 5 Jun 2020 18:34:34 +0000 (11:34 -0700)]
[ModuloSchedule] Support instructions with > 1 destination when walking canonical use.
Fixes a minor bug that led to finding the wrong register if the definition had more
than one register destination.
Sanjay Patel [Mon, 8 Jun 2020 18:09:04 +0000 (14:09 -0400)]
[InstCombine] improve matching for sext-lshr-trunc patterns, part 2
Similar to rG42f488b63a04
This is intended to preserve the logic of the existing transform,
but remove unnecessary restrictions on uses and types.
https://rise4fun.com/Alive/oS0
Name: narrow input
Pre: C1 <= width(C1) - 24
%B = sext i8 %A
%C = lshr %B, C1
%r = trunc %C to i24
=>
%s = ashr i8 %A, trunc(umin(C1, 7))
%r = sext i8 %s to i24
Name: wide input
Pre: C1 <= width(C1) - 24
%B = sext i24 %A
%C = lshr %B, C1
%r = trunc %C to i8
=>
%s = ashr i24 %A, trunc(umin(C1, 23))
%r = trunc i24 %s to i8
Sanjay Patel [Mon, 8 Jun 2020 17:08:40 +0000 (13:08 -0400)]
[InstCombine] add tests for sext+lshr+trunc; NFC
Shows missing transforms with extra uses and vectors.
Christopher Tetreault [Mon, 8 Jun 2020 18:07:25 +0000 (11:07 -0700)]
[SVE] Eliminate calls to default-false VectorType::get() from llvm-stress
Reviewers: efriedma, kmclaughlin, sdesmalen, MaskRay, JDevlieghere
Reviewed By: sdesmalen
Subscribers: tschuett, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81201
Chris Jackson [Mon, 8 Jun 2020 17:44:11 +0000 (18:44 +0100)]
[DebugInfo] Reduce SalvageDebugInfo() functions
- Now all SalvageDebugInfo() calls will mark undef if the salvage
attempt fails.
Reviewed by: vsk, Orlando
Differential Revision: https://reviews.llvm.org/D78369
Yaxun (Sam) Liu [Mon, 8 Jun 2020 17:42:52 +0000 (13:42 -0400)]
Rename arg name in __clang_hip_math.h
__sptr is a keyword for ms-extension. Change it from __sptr to __sinptr.
Saleem Abdulrasool [Sat, 6 Jun 2020 02:54:58 +0000 (19:54 -0700)]
lld: improve the `-arch` handling for MachO
Use the default target triple configured by the user to determine the
default architecture for `ld64.lld`. Stash the architecture in the
configuration as when linking against TBDs, we will need to filter out
the symbols based upon the architecture. Treat the Haswell slice as it
is equivalent to `x86_64` but with the extra Haswell extensions (e.g.
AVX2, FMA3, BMI1, etc). This will make it easier to add new
architectures in the future.
This change also changes the failure mode where an invalid `-arch`
parameter will result in the linker exiting without further processing.
Florian Hahn [Mon, 8 Jun 2020 17:29:17 +0000 (18:29 +0100)]
[AArch64] Add a ldst-opt test with undef operands (NFC).
This patch adds a test to check that we do not use an undef renamable
register for renaming the other operand in a LDP instruction, as
suggested in D81108.
Jan-Willem Maessen [Mon, 8 Jun 2020 17:38:16 +0000 (18:38 +0100)]
[NFC] Fix quadratic LexicalScopes::constructScopeNest
We sometimes have functions with large numbers of sibling basic
blocks (usually with an error path exit from each one). This was
triggering the qudratic behavior in this function - after visiting
each child llvm would re-scan the parent from the beginning again. We
modify the work stack to record the next index to be worked on
alongside the pointer. This avoids the need to linearly search for
the next unfinished child.
Differential Revision: https://reviews.llvm.org/D80029
Christopher Tetreault [Mon, 8 Jun 2020 17:12:08 +0000 (10:12 -0700)]
[SVE] Eliminate calls to default-false VectorType::get() from CodeGen
Reviewers: efriedma, c-rhodes, david-arm, spatel, craig.topper, aqjune, paquette, arsenm, gchatelet
Reviewed By: spatel, gchatelet
Subscribers: wdng, tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80313
Hiroshi Yamauchi [Tue, 2 Jun 2020 17:50:59 +0000 (10:50 -0700)]
[PGO][PGSO] Enable non-cold code size opts under non-partial-profile sample PGO.
Summary: Following up D78949.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81020
LLVM GN Syncbot [Mon, 8 Jun 2020 16:55:22 +0000 (16:55 +0000)]
[gn build] Port
550b5995233
zoecarver [Mon, 8 Jun 2020 16:47:48 +0000 (09:47 -0700)]
[NFC] [libcxx] Remove shared_ptr's no-rvalue unique_ptr converting constructor.
All compilers supported by libc++ have rvalues in C++03 mode so, there is no need for this non-rvalue overload.
Differential Revision: https://reviews.llvm.org/D80881
Jonas Devlieghere [Mon, 8 Jun 2020 16:46:34 +0000 (09:46 -0700)]
[Support] Replace 'DisableColors' boolean with 'ColorMode' enum
Replace the DisableColors with a ColorMode which can be set to Auto,
Enabled and Disabled. The purpose of this change is to make it possible
to ignore the command line option not only for disabling colors, but
also for enabling them.
Differential revision: https://reviews.llvm.org/D81056
Matt Arsenault [Mon, 8 Jun 2020 16:46:55 +0000 (12:46 -0400)]
AMDGPU/GlobalISel: Precommit regenerated check lines
The update_*test_checks scripts miss new stuff added at the end of
lines. Regenerate checks so the new mode register operands don't show
up in the diff of a future patch.
David Goldman [Fri, 5 Jun 2020 14:57:33 +0000 (10:57 -0400)]
[Sema][CodeComplete][ObjC] Don't include arrow/dot fixits
Summary:
Exempt ObjC from arrow/dot fixits since this has limited value for
Objective-C, where properties (referenced by dot syntax) are normally
backed by ivars (referenced by arrow syntax).
In addition, the current implementation doesn't properly mark
the fix it condition for Objective-C.
This was initially added in https://reviews.llvm.org/D41537
for C++ and then later C, don't believe the Objective-C changes
were intentional.
Reviewers: sammccall, yvvan
Subscribers: jfb, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81263
Kadir Cetinkaya [Mon, 8 Jun 2020 16:17:42 +0000 (18:17 +0200)]
[clangd] Drop unnecessary FS modifications in FindSymbolsTests
Fangrui Song [Mon, 8 Jun 2020 16:32:30 +0000 (09:32 -0700)]
Reland D80979 [clang] Implement VectorType logic not operator
With a fix to use -triple %itanium_abi_triple
Differential Revision: https://reviews.llvm.org/D80979
Ilya Biryukov [Mon, 8 Jun 2020 16:20:10 +0000 (19:20 +0300)]
Updates to the 'CLion Integration' section in ClangFormat docs
This commit updates the 'CLion Integration' section in ClangFormat docs.
Key changes:
- clang-format is enabled automatically when there is a config file;
- formatting now works for indentations;
- if clang-format is enabled without a config file, CLion suggests creating it based on the IDE settings or uses the LLVM style by default.
Patch by Marina Kalashina!
Reviewers: sylvestre.ledru, ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: ilya-biryukov, klimek, MyDeveloperDay, sammccall, gribozavr2
Differential Revision: https://reviews.llvm.org/D80721
Jonas Devlieghere [Mon, 8 Jun 2020 15:47:55 +0000 (08:47 -0700)]
[Support] Move color handling from raw_fd_ostream to raw_ostream
Move the color handling code from raw_fd_ostream to raw_ostream. This
makes it possible to use colors with any ostream when enabled. The
existing behavior where only raw_fd_ostream supports colors by default
remains unchanged.
Differential revision: https://reviews.llvm.org/D81110
Sanjay Patel [Mon, 8 Jun 2020 15:37:43 +0000 (11:37 -0400)]
[InstCombine] improve matching for sext-lshr-trunc patterns
This is intended to preserve the logic of the existing transform,
but remove unnecessary restrictions on uses and types.
https://rise4fun.com/Alive/pYfR
Pre: C1 <= width(C1) - 8
%B = sext i8 %A
%C = lshr %B, C1
%r = trunc %C to i8
=>
%r = ashr i8 %A, trunc(umin(C1, 7))
David Goldman [Fri, 5 Jun 2020 18:00:13 +0000 (14:00 -0400)]
[ObjC] Fix AST serialization for pseudo-strong parameters
This bit was assumed to be always false for ParmVarDecls, but attribute
objc_externally_retained now can produce it.
Differential revision: https://reviews.llvm.org/D74417
Alexander Belyaev [Mon, 8 Jun 2020 15:48:01 +0000 (17:48 +0200)]
[mlir] Lower Shape binary ops (AddOp, MulOp) to Standard.
Differential Revision: https://reviews.llvm.org/D81344
Haojian Wu [Mon, 8 Jun 2020 12:52:20 +0000 (14:52 +0200)]
[AST] Fix a clang crash on an invalid for-range statement.
Summary:
crash stack:
```
llvm-project/clang/lib/AST/ASTContext.cpp:2248: clang::TypeInfo clang::ASTContext::getTypeInfoImpl(const clang::Type *) const: Assertion `!A->getDeducedType().isNull() && "cannot request the size of an undeduced or dependent auto type"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
#0 0x00000000025bb0bf llvm::sys::PrintStackTrace(llvm::raw_ostream&) llvm-project/llvm/lib/Support/Unix/Signals.inc:564:13
#1 0x00000000025b92b0 llvm::sys::RunSignalHandlers() llvm-project/llvm/lib/Support/Signals.cpp:69:18
#2 0x00000000025bb535 SignalHandler(int) llvm-project/llvm/lib/Support/Unix/Signals.inc:396:3
#3 0x00007f9ef9298110 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14110)
#4 0x00007f9ef8d72761 raise /build/glibc-M65Gwz/glibc-2.30/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f9ef8d5c55b abort /build/glibc-M65Gwz/glibc-2.30/stdlib/abort.c:81:7
#6 0x00007f9ef8d5c42f get_sysdep_segment_value /build/glibc-M65Gwz/glibc-2.30/intl/loadmsgcat.c:509:8
#7 0x00007f9ef8d5c42f _nl_load_domain /build/glibc-M65Gwz/glibc-2.30/intl/loadmsgcat.c:970:34
#8 0x00007f9ef8d6b092 (/lib/x86_64-linux-gnu/libc.so.6+0x34092)
#9 0x000000000458abe0 clang::ASTContext::getTypeInfoImpl(clang::Type const*) const llvm-project/clang/lib/AST/ASTContext.cpp:0:5
```
Reviewers: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81384
Sam McCall [Thu, 28 May 2020 12:24:30 +0000 (14:24 +0200)]
[clangd] Resolve driver symlinks, and look up unknown relative drivers in PATH.
Summary:
This fixes a reported bug: if clang and libc++ are installed under
/usr/lib/llvm-11/... but there'- a symlink /usr/bin/clang++-11, then a
compile_commands.json with "/usr/bin/clang++-11 -stdlib=libc++" would previously
look for libc++ under /usr/include instead of /usr/lib/llvm-11/include.
The PATH change makes this work if the compiler is just "clang++-11" too.
As this is now doing IO potentially on every getCompileCommand(), we cache
the results for each distinct driver.
While here:
- Added a Memoize helper for this as multithreaded caching is a bit noisy.
- Used this helper to simplify QueryDriverDatabase and reduce blocking there.
(This makes use of the fact that llvm::Regex is now threadsafe)
Reviewers: kadircet
Subscribers: jyknight, ormris, ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75414
Sanjay Patel [Mon, 8 Jun 2020 15:15:13 +0000 (11:15 -0400)]
[InstCombine] reduce code duplication in visitTrunc(); NFC
Sanjay Patel [Mon, 8 Jun 2020 13:33:00 +0000 (09:33 -0400)]
[InstCombine] add tests for sext+lshr+trunc; NFC
Shows missing transforms with extra uses and vectors.
Shengchen Kan [Mon, 8 Jun 2020 13:43:24 +0000 (21:43 +0800)]
[TEST] TreeTest.cpp - Add a comma to avoid build error with -werror
Summary:
The macro `INSTANTIATE_TEST_CASE_P` is defined as
```
\# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
...
```
If we build the test case with -werror, we will get an error like
```
error: ISO C++11 requires at least one argument for the "..." in a
variadic macro
testing::ValuesIn(TestClangConfig::allConfigs()));
^
```
This patch fixes that.
Reviewers: gribozavr, hlopko, eduucaldas, gribozavr2
Reviewed By: gribozavr2
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81388
Aaron Puchert [Mon, 8 Jun 2020 14:30:06 +0000 (16:30 +0200)]
Thread safety analysis: Add note for double unlock
Summary:
When getting a warning that we release a capability that isn't held it's
sometimes not clear why. So just like we do for double locking, we add a
note on the previous release operation, which marks the point since when
the capability isn't held any longer.
We can find this previous release operation by looking up the
corresponding negative capability.
Reviewers: aaron.ballman, delesley
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D81352
Aaron Puchert [Mon, 8 Jun 2020 14:29:53 +0000 (16:29 +0200)]
Thread safety analysis: Support deferring locks
Summary:
The standard std::unique_lock can be constructed to manage a lock without
initially acquiring it by passing std::defer_lock as second parameter.
It can be acquired later by calling lock().
To support this, we use the locks_excluded attribute. This might seem
like an odd choice at first, but its consistent with the other
annotations we support on scoped capability constructors. By excluding
the lock we state that it is currently not in use and the function
doesn't change that, which is exactly what the constructor does.
Along the way we slightly simplify handling of scoped capabilities.
Reviewers: aaron.ballman, delesley
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D81332
Aaron Puchert [Mon, 8 Jun 2020 14:58:12 +0000 (16:58 +0200)]
Fix build after removing llvm/CodeGen/GlobalISel/Types.h
Removing the include was probably just forgotten after
f13ba22227ea221af55bdad43c94e9cc43ef0926.
Guillaume Chatelet [Mon, 8 Jun 2020 07:25:57 +0000 (07:25 +0000)]
[Alignment][NFC] Deprecate dead code from CallingConvLower.h
Summary: This is a followup on D81196.
Reviewers: courbet
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81362
Dmitry Vyukov [Mon, 8 Jun 2020 14:45:39 +0000 (16:45 +0200)]
tsan: add OpenBSD support for Go
With the race_debug_openbsd_amd64.syso file created via this diff,
Go's race detector is able to detect a race in the example code
link: https://golang.org/doc/articles/race_detector.html
Reviewed-in: https://reviews.llvm.org/D80469
Author: qbit (Aaron Bieber)
Xing GUO [Mon, 8 Jun 2020 14:48:32 +0000 (22:48 +0800)]
[ObjectYAML] Add support for error handling in DWARFYAML. NFC.
This patch intends to be an NFC-patch. Test cases will be added in a follow-up patch.
Reviewed By: jhenderson, grimar
Differential Revision: https://reviews.llvm.org/D81356
Isuru Fernando [Mon, 8 Jun 2020 14:08:35 +0000 (15:08 +0100)]
[flang] Use LLVM's flags
Summary:
The only difference is that LLVM_ENABLE_WERROR is set to OFF
by default, but we enable this in a standalone flang build
This commit fixes some windows issues with the flags
Reviewers: DavidTruby, jdoerfert, sscalpone
Reviewed By: DavidTruby, sscalpone
Subscribers: ormris, richard.barton.arm, mehdi_amini, Meinersbur, ChinouneMehdi, tskeith, mgorny, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D78306
Matt Arsenault [Mon, 8 Jun 2020 14:25:57 +0000 (10:25 -0400)]
GlobalISel: Remove dead include
Sam Parker [Mon, 8 Jun 2020 14:25:03 +0000 (15:25 +0100)]
[CostModel] Follow-up to buildbot fix
Adding type checks into the other backends that call
getTypeLegalizationCost.
Differential Revision: https://reviews.llvm.org/D80984
Matt Arsenault [Mon, 8 Jun 2020 14:18:33 +0000 (10:18 -0400)]
GlobalISel: Remove deprecated methods
These have very few users to begin with, and have been marked
deprecated for 2 months which should be long enough for out of tree
targets.
David Sherwood [Thu, 4 Jun 2020 14:53:06 +0000 (15:53 +0100)]
[CodeGen] Fix nullptr crash in tryConvertSVEWideCompare
When the input to a wide compare instruction is a DUP or SPLAT_VECTOR
node we should deal with cases where the DUP/SPLAT_VECTOR input
operand is not an immediate value. I've fixed the code to return
SDValue() in such cases and added a couple of tests - one each to
represent the signed and unsigned cases.
Differential Revision: https://reviews.llvm.org/D81167
Matt Arsenault [Mon, 8 Jun 2020 14:04:19 +0000 (10:04 -0400)]
GlobalISel: Use Register
Matt Arsenault [Mon, 8 Jun 2020 14:05:56 +0000 (10:05 -0400)]
GlobalISel: Remove unused header
Matt Arsenault [Sat, 6 Jun 2020 18:19:45 +0000 (14:19 -0400)]
GlobalISel: Add dump method to LLT
Matt Arsenault [Mon, 8 Jun 2020 13:49:34 +0000 (09:49 -0400)]
GlobalISel: Make it clearer that regbank/class are mutually exclusive
Matt Arsenault [Mon, 8 Jun 2020 01:56:42 +0000 (21:56 -0400)]
GlobalISel: Simplify debug printing
Kazushi (Jam) Marukawa [Mon, 8 Jun 2020 13:58:31 +0000 (15:58 +0200)]
[VE] Support floating-point arithmetic instructions in MC layer
Summary:
Add regression tests of asmparser, mccodeemitter, and disassembler for
floating-point arithmetic instructions. Add FADDQ, FSUBQ, FMULQ, and
FCMPQ instructions and F128 register class too.
Differential Revision: https://reviews.llvm.org/D81386
Pavel Labath [Mon, 8 Jun 2020 13:19:31 +0000 (15:19 +0200)]
[lldb] Fail evaluation of DWARF expressions with unknown opcodes
Previously, we were simply ignoring them and continuing the evaluation.
This behavior does not seem useful, because the resulting value will
most likely be completely bogus.
Haojian Wu [Thu, 4 Jun 2020 11:22:19 +0000 (13:22 +0200)]
[AST][RecoveryExpr] Populate the dependence bits from CompoundStmt result expr to StmtExpr.
Summary:
We lost errorBit for StmtExpr if a recoveryExpr is the result
expr of a CompoundStmt, which will lead to crashes.
```
// `-StmtExpr
// `-CompoundStmt
// `-RecoveryExp
({ invalid(); });
```
Reviewers: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81154
Pavel Labath [Mon, 8 Jun 2020 13:24:17 +0000 (15:24 +0200)]
[BinaryFormat] Add formatv support for DW_OP constants
The functionality will be used from lldb.
Jay Foad [Wed, 5 Feb 2020 09:52:32 +0000 (09:52 +0000)]
[AMDGPU] Cluster MIMG instructions
Differential Revision: https://reviews.llvm.org/D74035
Simon Pilgrim [Mon, 8 Jun 2020 12:58:11 +0000 (13:58 +0100)]
DbgEntityHistoryCalculator.h - reduce DebugInfoMetadata.h include to forward declarations. NFC.
Simon Pilgrim [Mon, 8 Jun 2020 12:07:27 +0000 (13:07 +0100)]
YAMLRemarkParser.cpp - remove duplicate RemarkParser.h include. NFC.
This is already defined in the YAMLRemarkParser.h module header
Pavel Labath [Tue, 2 Jun 2020 14:01:11 +0000 (16:01 +0200)]
[lldb/DWARF] Fix PC value for artificial tail call frames for the "GNU" case
Summary:
The way that the support for the GNU dialect of tail call frames was
implemented in D80519 meant that the were reporting very bogus PC values
which pointed into the middle of an instruction: the -1 trick is
necessary for the address to resolve to the right function, but we
should still be reporting a more realistic PC value -- I say "realistic"
and not "real", because it's very debatable what should be the correct
PC value for frames like this.
This patch achieves that my moving the -1 from SymbolFileDWARF into the
stack frame computation code. The idea is that SymbolFileDWARF will
merely report whether it has provided an address of the instruction
after the tail call, or the address of the call instruction itself. The
StackFrameList machinery uses this information to set the "behaves like
frame zero" property of the artificial frames (the main thing this flag
does is it controls the -1 subtraction when looking up the function
address).
This required a moderate refactor of the CallEdge class, because it was
implicitly assuming that edges pointing after the call were real calls
and those pointing the the call insn were tail calls. The class now
carries this information explicitly -- it carries three mostly
independent pieces of information:
- an address of interest in the caller
- a bit saying whether this address points to the call insn or after it
- whether this is a tail call
Reviewers: vsk, dblaikie
Subscribers: aprantl, mgrang, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D81010
Wen-Heng (Jack) Chung [Mon, 1 Jun 2020 15:48:23 +0000 (10:48 -0500)]
[mlir][gpu] Fix logic error in D79508 computing number of private attributions.
Fix logic error in D79508. The old logic would make the first check in
`GPUFuncOp::verifyBody` always pass.
Jonathan Coe [Fri, 5 Jun 2020 12:23:34 +0000 (13:23 +0100)]
[clang-format] treat 'lock' as a keyword for C# code
Summary: This will put a space in `lock (process)` when spaces are required after keywords.
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: cfe-commits
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D81255
Sam McCall [Sat, 11 Apr 2020 09:02:46 +0000 (11:02 +0200)]
[Preamble] Invalidate preamble when missing headers become present.
Summary:
To avoid excessive extra stat()s, only check the possible locations of
headers that weren't found at all (leading to a compile error).
For headers that *were* found, we don't check for files earlier on the
search path that could override them.
Reviewers: kadircet
Subscribers: javed.absar, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77942
David Sherwood [Mon, 8 Jun 2020 10:20:13 +0000 (11:20 +0100)]
[SVE] Remove getNumElements() calls in Verifier::visitIntrinsicCall
Replace getNumElements() with getElementCount() when asserting that
two types have the same element counts.
Differential Revision: https://reviews.llvm.org/D81371
Pavel Labath [Mon, 8 Jun 2020 11:33:22 +0000 (13:33 +0200)]
[lldb] Fix YAMLModuleTester for the rename in
67b4afc4
Kadir Cetinkaya [Thu, 4 Jun 2020 16:26:52 +0000 (18:26 +0200)]
[clangd] Change ParseInputs to store FSProvider rather than VFS
Summary: This ensures ParseInputs provides a read-only access to FS.
Reviewers: sammccall
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81173
Cullen Rhodes [Tue, 19 May 2020 12:55:53 +0000 (12:55 +0000)]
[AArch64][SVE] Implement vector tuple intrinsics
Summary:
This patch adds the following intrinsics for creating two-tuple,
three-tuple and four-tuple scalable vectors:
* llvm.aarch64.sve.tuple.create2
* llvm.aarch64.sve.tuple.create3
* llvm.aarch64.sve.tuple.create4
As well as:
* llvm.aarch64.sve.tuple.get
* llvm.aarch64.sve.tuple.set
For extracting and inserting scalable vectors from vector tuples. These
intrinsics are intended to be used by the ACLE functions svcreate<n>,
svget and svset.
This patch also includes calling convention support for passing and
returning tuples of scalable vectors to/from functions.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D75674
Guillaume Chatelet [Mon, 8 Jun 2020 08:48:49 +0000 (08:48 +0000)]
[Alignment][NFC] Migrate HandleByVal to Align
Summary: Note to downstream target maintainers: this might silently change the semantics of your code if you override `TargetLowering::HandleByVal` without marking it `override`.
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: sdardis, hiraditya, jrtc27, atanasyan, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81365
Nico Weber [Mon, 8 Jun 2020 10:48:14 +0000 (06:48 -0400)]
Reverte AArch64 changes to popcount test, they break most bots.
See http://lab.llvm.org:8011/console.
This reverts commit
0fa3a03327909a27c0ed372b46e3ef3cccd1d827.
This reverts commit
5787ad6c918a240301ba5881c939c8a565da174e.
Nico Weber [Mon, 8 Jun 2020 10:45:21 +0000 (06:45 -0400)]
Revert "[clang] Implement VectorType logic not operator."
This reverts commit
a0de3335edcf19305dad592d21ebe402825184f6.
Breaks check-clang on Windows, see e.g.
https://reviews.llvm.org/D80979#2078750 (but fails on all
other Windows bots too).
Frederik Gossen [Mon, 8 Jun 2020 10:24:50 +0000 (10:24 +0000)]
[MLIR][Shape] Add support for `OpAsmInterface` in `shape.const_size`
The SSA values created with `shape.const_size` are now named depending on the
value.
A constant size of 3, e.g., is now automatically named `%c3`.
Differential Revision: https://reviews.llvm.org/D81249
Shawn Landden [Mon, 8 Jun 2020 10:23:20 +0000 (14:23 +0400)]
[AArch64] Add combine-load test; NFC
Problem discovered in https://reviews.llvm.org/D81343
Alexander Belyaev [Mon, 8 Jun 2020 10:14:19 +0000 (12:14 +0200)]
Revert "Revert "[MLIR] Lower shape.num_elements -> shape.reduce.""
This reverts commit
a25f5cd70cef6f74eed45a61c14abca98cd416e4.
Now the build with `-DBUILD_SHARED_LIBS=ON` is fixed.
Simon Pilgrim [Mon, 8 Jun 2020 09:56:26 +0000 (10:56 +0100)]
VersionTuple.h - reduce includes to forward declarations. NFC.
Sam McCall [Mon, 8 Jun 2020 08:55:10 +0000 (10:55 +0200)]
Recognize *.hxx as a C++ header extension, like *.hpp.
Reviewers: kadircet
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81366
Dineshkumar Bhaskaran [Mon, 8 Jun 2020 09:42:02 +0000 (09:42 +0000)]
[ELF] Adding accessor method for getting Note Desc as StringRef
Summary: One more way to access note desc.
Reviewers: arsenm, scott.linder, saiislam
Reviewed By: scott.linder
Subscribers: wdng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81185
Kazushi (Jam) Marukawa [Mon, 8 Jun 2020 09:41:41 +0000 (11:41 +0200)]
[VE] Support control instructions in MC layer
Summary:
Add regression tests of asmparser, mccodeemitter, and disassembler for
control instructions. Add not defined LPM/SPM/LFR/SFR/SMIR/NOP/LCR/
SCR/TSCR/FIDCR control isntructions newly. Define MISC registers which
SMIR instruction reads and IC register which SIC instruction reads.
Change asmparser to support Zero, UImm3, and UImm6 operands and MISC
registers. Change instprinter to support MISC registers also.
Change to use auto to receive dyn_cast also.
Differential Revision: https://reviews.llvm.org/D81370
Sander de Smalen [Fri, 5 Jun 2020 17:29:43 +0000 (18:29 +0100)]
[CodeGen][SVE] CopyToReg: Split scalable EVTs that are not powers of 2
Scalable vectors cannot use 'BUILD_VECTOR', so it is necessary to
properly split and widen scalable vectors when passing them
to CopyToReg/CopyFromReg.
This functionality is added to TargetLoweringBase::getVectorTypeBreakdown().
This patch only adds support for 'splitting' scalable vectors that
are a multiple of some legal type, e.g.
<vscale x 6 x i64> -> 3 x <vscale x 2 x i64>
Reviewers: efriedma, c-rhodes
Reviewed By: efriedma
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80139
Frederik Gossen [Mon, 8 Jun 2020 09:37:43 +0000 (09:37 +0000)]
[MLIR] Add `to/from_extent_tensor` lowering to the standard dialect
The operations `to_extent_tensor` and `from_extent_tensor` become no-ops when
lowered to the standard dialect.
This is possible with a lowering from `shape.shape` to `tensor<?xindex>`.
Differential Revision: https://reviews.llvm.org/D81162
Frederik Gossen [Mon, 8 Jun 2020 09:33:24 +0000 (09:33 +0000)]
[MLIR] Add type conversion for `shape.shape`
Convert `shape.shape` to `tensor<?xindex>` when lowering the `shape` to the
`std` dialect.
Differential Revision: https://reviews.llvm.org/D81161
Xing GUO [Mon, 8 Jun 2020 09:30:23 +0000 (17:30 +0800)]
[DWARFYAML] Rename function names to match the coding style. NFC.
Shawn Landden [Mon, 8 Jun 2020 09:16:26 +0000 (13:16 +0400)]
[AArch64] update popcount pre-patch test, take 2; NFC
accidentally pushed the post-patch test results
The change from before is the use of -O0 to see better what changed
Shawn Landden [Mon, 8 Jun 2020 09:12:47 +0000 (13:12 +0400)]
[AArch64] update popcount pre-patch test; NFC
Frederik Gossen [Mon, 8 Jun 2020 08:58:06 +0000 (08:58 +0000)]
[MLIR] Clean up `shape` to `std` lowering
Apply post-commit suggestions to the new lowering.
Differential Revision: https://reviews.llvm.org/D81160
Kang Zhang [Mon, 8 Jun 2020 08:55:31 +0000 (08:55 +0000)]
[NFC][PowerPC] Modify the test case to test RM
Marco Elver [Mon, 8 Jun 2020 08:30:50 +0000 (10:30 +0200)]
Revert "[KernelAddressSanitizer] Make globals constructors compatible with kernel"
This reverts commit
866ee2353f7d0224644799d0d1faed53c7f3a06d.
Building the kernel results in modpost failures due to modpost relying
on debug info and inspecting kernel modules' globals:
https://github.com/ClangBuiltLinux/linux/issues/1045#issuecomment-
640381783
Jaroslav Sevcik [Mon, 8 Jun 2020 07:41:48 +0000 (07:41 +0000)]
[lldb] Disable remove-add module test on Windows
This disables the test introduced by
https://github.com/llvm/llvm-project/commit/
1beffc18886ae4cd72dfe1f9b6b79204cac51e5e
on Windows.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D81363
Kazushi (Jam) Marukawa [Mon, 8 Jun 2020 08:19:04 +0000 (10:19 +0200)]
[VE] Support shift operation instructions in MC layer
Summary:
Add regression tests of asmparser, mccodeemitter, and disassembler for
shift operation instructions. Also change asmparser to support UImm7
operand. And, add new SLD/SRD/SLA instructions also.
Differential Revision: https://reviews.llvm.org/D81324
Sam Parker [Mon, 8 Jun 2020 08:11:08 +0000 (09:11 +0100)]
[PPC] Try to fix builbots
Attempt to handle unsupported types, such as structs, in
getMemoryOpCost. The backend now checks for a supported type and
calls into BasicTTI as a fallback. BasicTTI will now also perform
the same check and will default to an expensive cost of 4 for 'Other'
MVTs.
Differential Revision: https://reviews.llvm.org/D80984
Tres Popp [Mon, 8 Jun 2020 08:03:15 +0000 (10:03 +0200)]
Revert "Revert "[mlir] Folding and canonicalization of shape.cstr_eq""
This reverts commit
12e31f6e407ff98ce431b19a492721d19711d0a0.
Tres Popp [Mon, 8 Jun 2020 08:03:05 +0000 (10:03 +0200)]
Revert "Revert "[mlir] Canonicalization and folding of shape.cstr_broadcastable""
This reverts commit
4261b026ad5b97231be25f28fe2b0f8a84d82d13.
Tres Popp [Sat, 6 Jun 2020 08:17:58 +0000 (10:17 +0200)]
[mlir] Restructure Shape dialect's CMakeLists.
Now targets are only built with files in the same directory.
Differential Revision: https://reviews.llvm.org/D81328
Ehsan Toosi [Tue, 2 Jun 2020 16:12:57 +0000 (18:12 +0200)]
[mlir] Introduce allowMemrefFunctionResults for the helper operation converters of buffer placement
This parameter gives the developers the freedom to choose their desired function
signature conversion for preparing their functions for buffer placement. It is
introduced for BufferAssignmentFuncOpConverter, and also for
BufferAssignmentReturnOpConverter, and BufferAssignmentCallOpConverter to adapt
the return and call operations with the selected function signature conversion.
If the parameter is set, buffer placement won't also deallocate the returned
buffers.
Differential Revision: https://reviews.llvm.org/D81137
Guillaume Chatelet [Fri, 5 Jun 2020 16:51:33 +0000 (16:51 +0000)]
[Alignment][NFC] Migrate the rest of backends
Summary: This is a followup on D81196
Reviewers: courbet
Subscribers: arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81278
Guillaume Chatelet [Fri, 5 Jun 2020 16:04:42 +0000 (16:04 +0000)]
[Alignment][NFC] Migrate part of Arm/AArch64 backend
Summary: Follow up on D81196
Reviewers: courbet
Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81274
Simon Wallis [Mon, 8 Jun 2020 07:10:42 +0000 (08:10 +0100)]
[ARM][XO] Execute-only miscompiles double literals for big-endian
Summary:
With -mbig-endian -mexecute-only and targeting an fpu,
an incorrect sequence of movw/movt was generated to construct a double literal.
The test suite was hardwired to check these wrong values.
The fault was caused by the explicit word swap in LowerConstantFP().
With -mbig-endian -mexecute-only -mfpu=none, a correct sequence of
movw/movt is generated to construct a double literal.
The test suite did not test this no fpu case.
The test suite expected values have been corrected.
The test file is updated to add testing of fpu=none case
Reviewers: christof, llvm-commits, dmgreen
Reviewed By: dmgreen
Subscribers: dmgreen, kristof.beyls, hiraditya, danielkiss
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81259
Change-Id: Ia3737df243218c89c82f02b7f9f4032ecd5a3917
Guillaume Chatelet [Fri, 5 Jun 2020 15:58:20 +0000 (15:58 +0000)]
[Alignment][NFC] Migrate CallingConv tablegen code
Summary: This is a follow up on D81196, fixing one more call site.
Reviewers: courbet
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81268
Max Kazantsev [Mon, 8 Jun 2020 06:17:54 +0000 (13:17 +0700)]
[Test] Add test showing InstCombine missing simplification opportunity
Craig Topper [Mon, 8 Jun 2020 03:14:40 +0000 (20:14 -0700)]
[X86] Support load shrinking for strict fp nodes in combineCVTPH2PS
QingShan Zhang [Mon, 8 Jun 2020 03:51:05 +0000 (03:51 +0000)]
[NFC] Remove the extra ; to avoid the warning of build compiler
Nemanja Ivanovic [Mon, 8 Jun 2020 03:16:35 +0000 (22:16 -0500)]
[PowerPC] Do not assume operand of ADDI is an immediate
After pseudo-expansion, we may end up with ADDI (add immediate)
instructions where the operand is not an immediate but a relocation.
For such instructions, attempts to get the immediate result in
assertion failures for obvious reasons.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=45432
Craig Topper [Mon, 8 Jun 2020 01:55:33 +0000 (18:55 -0700)]
[X86] Improve (vzmovl (insert_subvector)) combine to handle a bitcast between the vzmovl and insert
This combine tries shrink a vzmovl if its input is an
insert_subvector. This patch improves it to turn
(vzmovl (bitcast (insert_subvector))) into
(insert_subvector (vzmovl (bitcast))) potentially allowing the
bitcast to be folded with a load.
Craig Topper [Mon, 8 Jun 2020 01:28:31 +0000 (18:28 -0700)]
[X86] Teach combineCVTP2I_CVTTP2I to handle STRICT_CVTTP2SI/STRICT_CVTTP2UI
Allows us to shrink 128-bit simple load to enable folding for
v2f32->v2i64 vcvttps2qq/vcvttps2uqq.