Dmitry Antipov [Wed, 23 Sep 2020 17:21:18 +0000 (20:21 +0300)]
[Driver] Check whether Gentoo-specific configuration directory exists
Check whether /etc/env.d/gcc exists before trying to read from any
file from there. This saves a few OS calls on a non-Gentoo system.
Differential Revision: https://reviews.llvm.org/D87143
Krzysztof Parzyszek [Wed, 23 Sep 2020 17:23:54 +0000 (12:23 -0500)]
Break long line accidentally left in the previous commit
Fangrui Song [Wed, 23 Sep 2020 17:23:48 +0000 (10:23 -0700)]
Revert D87970 "[ThinLTO] Avoid temporaries when loading global decl attachment metadata"
This reverts commit
ab1b4810b55279bcf6fdd87be74a403440be3991.
It caused an issue in llvm::lto::thinBackend for a -fsanitize=cfi build.
```
AbbrevNo is 0 => "Invalid abbrev number"
0 llvm::BitstreamCursor::getAbbrev (this=0x9db4c8, AbbrevID=4) at llvm/include/llvm/Bitstream/BitstreamReader.h:528
1 0x00007f5f777a6eb4 in llvm::BitstreamCursor::readRecord (this=0x9db4c8, AbbrevID=4, Vals=llvm::SmallVector of Size 0, Capacity 64, Blob=0x7ffcd0e26558) at
usr/local/google/home/maskray/llvm/llvm/lib/Bitstream/Reader/BitstreamReader.cpp:228
2 0x00007f5f796bf633 in llvm::MetadataLoader::MetadataLoaderImpl::lazyLoadOneMetadata (this=0x9db3a0, ID=188, Placeholders=...) at /usr/local/google/home/mas
ray/llvm/llvm/lib/Bitcode/Reader/MetadataLoader.cpp:1091
3 0x00007f5f796c2527 in llvm::MetadataLoader::MetadataLoaderImpl::getMetadataFwdRefOrLoad (this=0x9db3a0, ID=188) at llvm
lib/Bitcode/Reader/MetadataLoader.cpp:668
4 0x00007f5f796bfff3 in llvm::MetadataLoader::getMetadataFwdRefOrLoad (this=0xd31580, Idx=188) at llvm/lib/Bitcode/Reader
MetadataLoader.cpp:2290
5 0x00007f5f79638265 in (anonymous namespace)::BitcodeReader::parseFunctionBody (this=0xd312e0, F=0x9de758) at llvm/lib/B
tcode/Reader/BitcodeReader.cpp:3938
6 0x00007f5f79635d32 in (anonymous namespace)::BitcodeReader::materialize (this=0xd312e0, GV=0x9de758) at llvm/lib/Bitcod
/Reader/BitcodeReader.cpp:5408
7 0x00007f5f7f8dbe3e in llvm::Module::materialize (this=0x9b92c0, GV=0x9de758) at llvm/lib/IR/Module.cpp:442
8 0x00007f5f7f7f8fbe in llvm::GlobalValue::materialize (this=0x9de758) at llvm/lib/IR/Globals.cpp:50
9 0x00007f5f83b9b5f5 in llvm::FunctionImporter::importFunctions (this=0x7ffcd0e2a730, DestModule=..., ImportList=...) at
llvm/lib/Transforms/IPO/FunctionImport.cpp:1182
```
Krzysztof Parzyszek [Wed, 23 Sep 2020 15:48:34 +0000 (10:48 -0500)]
[EarlyCSE] Fix crash with expensive checks after D87691
D87691 reordered some checks, which turned out to be unsafe. More
specifically, when examining a store instruction, the check against
getOrCreateResult should be done before attempting to call
isSameMemGeneration. Otherwise a crash in MSSA walker can occur.
This patch restores the order of these calls to what it was originally.
Mircea Trofin [Wed, 23 Sep 2020 17:12:16 +0000 (10:12 -0700)]
Add REQUIRES to embed-bitcode-noopt.ll
Vinicius Tinti [Wed, 23 Sep 2020 15:28:19 +0000 (16:28 +0100)]
[Support/Path] Add path::is_absolute_gnu
Implements IS_ABSOLUTE_PATH from GNU tools.
C++17 is_absolute behavior is different the from the behavior defined by GNU
tools.
According to cppreference.com, C++17 states: "An absolute path is a path
that unambiguously identifies the location of a file without reference
to an additional starting location."
In other words, the rules are:
1. POSIX style paths with nonempty root directory are absolute.
2. Windows style paths with nonempty root name and root directory are
absolute.
3. No other paths are absolute.
GNU rules are:
1. Paths starting with a path separator are absolute.
2. Windows style paths are also absolute if they start with a character
followed by ':'.
3. No other paths are absolute.
On Windows style the path "C:\Users\Default" has "C:" as root name and "\"
as root directory.
Hence "C:" on Windows is absolute under GNU rules and not absolute under
C++17 because it has no root directory. Likewise "/" and "\" on Windows are
absolute under GNU and are not absolute under C++17 due to empty root name.
Related to PR46368.
Differential Revision: https://reviews.llvm.org/D87667
Dmitry Antipov [Wed, 23 Sep 2020 16:37:50 +0000 (19:37 +0300)]
Add optimal thread strategy
Add an optimal thread strategy to execute specified amount of tasks.
This strategy should prevent us from creating too many threads if we
occasionaly have an unexpectedly small amount of tasks.
Differential Revision: https://reviews.llvm.org/D87765
Mircea Trofin [Tue, 22 Sep 2020 20:33:34 +0000 (13:33 -0700)]
[clang]Test ensuring -fembed-bitcode passed to cc1 captures pre-opt bitcode.
This is important to not regress because it allows us to capture pre-optimization
bitcode and options, and replay the full optimization pipeline.
Differential Revision: https://reviews.llvm.org/D88114
Guozhi Wei [Wed, 23 Sep 2020 16:27:34 +0000 (09:27 -0700)]
[MBFIWrapper] Add a new function getBlockProfileCount
MBFIWrapper keeps track of block frequencies of newly created blocks and
modified blocks, modified block frequencies should also impact block profile
count. This class doesn't provide interface getBlockProfileCount, users can only
use the underlying MBFI to query profile count, the underlying MBFI doesn't know
the modifications made in MBFIWrapper, so it either provides stale profile count
for modified block or simply crashes on new blocks.
So this patch add function getBlockProfileCount to class MBFIWrapper to handle
new blocks or modified blocks.
Differential Revision: https://reviews.llvm.org/D87802
Stella Laurenzo [Wed, 23 Sep 2020 16:30:13 +0000 (09:30 -0700)]
NFC: Remove dangling dep on MLIRStandardOps.
Was inadvertently left out of D88155.
David Greene [Wed, 23 Sep 2020 16:07:33 +0000 (11:07 -0500)]
[UpdateTestChecks] Remove bug-exposing test
Remove RISCV codegen tests for --include-generated-funcs because apparently
MachineOutliner has a bug on that target that is exposed by expensive-checks.
Stella Laurenzo [Wed, 23 Sep 2020 15:13:30 +0000 (08:13 -0700)]
Remove MLIR C-API explicit registration of standard ops.
* Added mlirRegisterAllDialects() to the python API until a more complete registration design emerges for it.
Differential Revision: https://reviews.llvm.org/D88155
Rahul Joshi [Wed, 23 Sep 2020 04:06:25 +0000 (21:06 -0700)]
[MLIR][NFC] Adopt use of BlockRange in place of ArrayRef<Block *>
- Use BlockRange in ODS generated builders as well as other places throughout the code
Differential Revision: https://reviews.llvm.org/D87955
Mehdi Amini [Wed, 23 Sep 2020 16:09:05 +0000 (16:09 +0000)]
Update the documentation for the MLIR Dialect class (NFC)
Aaron Ballman [Wed, 23 Sep 2020 16:11:07 +0000 (12:11 -0400)]
Improve dynamic AST matching diagnostics for conversion errors
Currently, when marshaling a dynamic AST matchers, we check for the type
and value validity of matcher arguments at the same time for some matchers.
For instance, when marshaling hasAttr("foo"), the argument is first type
checked to ensure it's a string and then checked to see if that string can
locate an attribute with that name. Similar happens for other enumeration
conversions like cast kinds or unary operator kinds. If the type is
correct but the value cannot be looked up, we make a best-effort attempt
to find a nearby name that the user might have meant, but if one cannot
be found, we throw our hands up and claim the types don't match.
This has an unfortunate behavior that when the user enters something of
the correct type but a best guess cannot be located, you get confusing
error messages like:
Incorrect type for arg 1. (Expected = string) != (Actual = String).
This patch splits the argument check into two parts: if the types don't
match, give a type diagnostic. If the type matches but the value cannot
be converted, give a best guess diagnostic or a value could not be
located diagnostic. This addresses PR47057.
Rahul Joshi [Wed, 23 Sep 2020 04:00:11 +0000 (21:00 -0700)]
[MLIR][NFC] Adopt use of TypeRange in build() methods.
- Use TypeRange instead of ArrayRef<Type> where possible.
- Change some of the custom builders to also use TypeRange
Differential Revision: https://reviews.llvm.org/D87944
Rahul Joshi [Wed, 23 Sep 2020 03:58:30 +0000 (20:58 -0700)]
[MLIR] Change default builders generated by TableGen to use TypeRange for result types
- Change the default builders to use TypeRange instead of ArrayRef<Type>
- Custom builders defined in LinalgStructuredOps now conflict with the default
separate param ones, but the default collective params one is still needed. Resolve
this by replicating the collective param builder as a custom builder and skipping
the generation of default builders for these ops.
Differential Revision: https://reviews.llvm.org/D87926
Yaxun (Sam) Liu [Wed, 23 Sep 2020 15:47:21 +0000 (11:47 -0400)]
Fix regressioin in test dwp-separate-debug-file.cpp
Alex Zinenko [Wed, 23 Sep 2020 13:02:47 +0000 (15:02 +0200)]
[mlir] Add insert before/after to list-like constructs in C API
Blocks in a region and operations in a block are organized in a linked list.
The C API only provides functions to append or to insert elements at the
specified numeric position in the list. The latter is expensive since it
requires to traverse the list. Add insert before/after functionality with low
cost that relies on the iplist elements being convertible to iterators.
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D88148
Dave Lee [Tue, 22 Sep 2020 23:08:48 +0000 (16:08 -0700)]
[lldb] Remove lldb-perf remenant
Delete a file remaining from the deletion of lldb-perf in D64362.
Differential Revision: https://reviews.llvm.org/D88119
Yaxun (Sam) Liu [Mon, 14 Sep 2020 18:21:30 +0000 (14:21 -0400)]
recommit [HIP] Fix -gsplit-dwarf option
recommit
e50465ecefc964e5700df26fc7e02a673eed085a with fix for
regression in lldb tests.
Two issues:
1. the directory part of original .dwo file was dropped
2. if the stem of the .dwo file contains '.', the last dot
and strings after that were removed
This recommit fixes those two issues.
Andrew Wei [Wed, 23 Sep 2020 14:44:30 +0000 (22:44 +0800)]
[AArch64] Fix ldst optimization of non-immediate store offset
When matching store instruction for ldst opt, we should make sure store instr is in 'reg+imm' form as load instr,
otherwise, it will have assertion in isLdOffsetInRangeOfSt since it will use getImm() directly.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D87905
Simon Pilgrim [Wed, 23 Sep 2020 14:54:50 +0000 (15:54 +0100)]
Add missing namespace closure comments. NFCI.
Fixes some clang-tidy llvm-namespace-comment warnings.
Simon Pilgrim [Wed, 23 Sep 2020 14:53:00 +0000 (15:53 +0100)]
Add missing namespace closure comment. NFCI.
Fixes clang-tidy llvm-namespace-comment warning.
Sebastian Neubauer [Wed, 23 Sep 2020 15:16:39 +0000 (17:16 +0200)]
Revert "[AMDGPU] Insert waitcnt after returning from call"
This reverts commit
ca907bfb57d8ad3ec3bcc2cff2abab7b1b933af6.
According to michel.daenzer,
> This completely broke the Mesa radeonsi driver on Navi 14. Xorg +
> xterm come up with major corruption & psychedelic colours.
Jacques Pienaar [Wed, 23 Sep 2020 15:10:16 +0000 (08:10 -0700)]
[mlir] Remove unneeded OpBuilder params. NFC.
These are now automatically prepended.
Jacques Pienaar [Wed, 23 Sep 2020 14:50:45 +0000 (07:50 -0700)]
[mlir][ods] Custom builder with no params
Incorrect generation of custom build method without any params.
Stella Laurenzo [Wed, 23 Sep 2020 15:00:31 +0000 (08:00 -0700)]
NFC: Remove unused variable.
Stella Laurenzo [Mon, 21 Sep 2020 04:25:46 +0000 (21:25 -0700)]
Add mlir python APIs for creating operations, regions and blocks.
* The API is a bit more verbose than I feel like it needs to be. In a follow-up I'd like to abbreviate some things and look in to creating aliases for common accessors.
* There is a lingering lifetime hazard between the module and newly added operations. We have the facilities now to solve for this but I will do that in a follow-up.
* We may need to craft a more limited API for safely referencing successors when creating operations. We need more facilities to really prove that out and should defer for now.
Differential Revision: https://reviews.llvm.org/D87996
Stella Laurenzo [Sun, 20 Sep 2020 05:02:32 +0000 (22:02 -0700)]
Implement python iteration over the operation/region/block hierarchy.
* Removes the half-completed prior attempt at region/block mutation in favor of new approach to ownership.
* Will re-add mutation more correctly in a follow-on.
* Eliminates the detached state on blocks and regions, simplifying the ownership hierarchy.
* Adds both iterator and index based access at each level.
Differential Revision: https://reviews.llvm.org/D87982
Stella Laurenzo [Sat, 19 Sep 2020 01:38:21 +0000 (18:38 -0700)]
Add Operation to python bindings.
* Fixes a rather egregious bug with respect to the inability to return arbitrary objects from py::init (was causing aliasing of multiple py::object -> native instance).
* Makes Modules and Operations referencable types so that they can be reliably depended on.
* Uniques python operation instances within a context. Opens the door for further accounting.
* Next I will retrofit region and block to be dependent on the operation, and I will attempt to model the API to avoid detached regions/blocks, which will simplify things a lot (in that world, only operations can be detached).
* Added quite a bit of test coverage to check for leaks and reference issues.
* Supercedes: https://reviews.llvm.org/D87213
Differential Revision: https://reviews.llvm.org/D87958
Valentin Clement [Wed, 23 Sep 2020 14:26:09 +0000 (10:26 -0400)]
[mlir][openacc] Use OptionalParseResult in loop op parser instead of bool variables
This patch switch from using bool variables to OptionalParseResult for the parsing
inside loop operation. This is already done for parallel operation and this patch unify this
in the dialect.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D88111
SuJunda (Junda Su) [Wed, 23 Sep 2020 14:16:05 +0000 (10:16 -0400)]
[docs][llvm] Fix typos
I don't have commit access.
Please help me commit it.
Thanks : )
Reviewed By: Paul-C-Anagnostopoulos
Differential Revision: https://reviews.llvm.org/D88139
Utkarsh Saxena [Wed, 23 Sep 2020 12:37:07 +0000 (14:37 +0200)]
[clangd] Refactor code completion signal's utility properties.
Current implementation of heuristic-based scoring function also contains
computation of derived signals (e.g. whether name contains a word from
context, computing file distances, scope distances.)
This is an attempt to separate out the logic for computation of derived
signals from the scoring function.
This will allow us to have a clean API for scoring functions that will
take only concrete code completion signals as input.
Differential Revision: https://reviews.llvm.org/D88146
Cameron McInally [Wed, 23 Sep 2020 14:06:20 +0000 (09:06 -0500)]
[SVE] Lower fixed length ISD::VECREDUCE_ADD to Scalable
Differential Revision: https://reviews.llvm.org/D87796
Florian Hahn [Wed, 23 Sep 2020 13:44:31 +0000 (14:44 +0100)]
[VPlan] Disconnect VPValue and VPUser.
This refactors VPuser to not inherit from VPValue to facilitate
introducing operations that introduce multiple VPValues (e.g.
VPInterleaveRecipe).
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D84679
Alex Zinenko [Wed, 23 Sep 2020 13:37:57 +0000 (15:37 +0200)]
[mlir] Fix typos in Dialect.h. NFC.
Jonas Paulsson [Tue, 22 Sep 2020 10:11:29 +0000 (12:11 +0200)]
[SystemZ] Make sure not to call getZExtValue on a >64 bit constant.
Better use isZero() and isIntN() in SystemZTargetTransformInfo rather than
calling getZExtValue() since the immediate operand may be wider than 64 bits,
which is not allowed with getZExtValue().
Fixes https://bugs.llvm.org/show_bug.cgi?id=47600
Review: Simon Pilgrim
Sam Parker [Wed, 23 Sep 2020 13:29:03 +0000 (14:29 +0100)]
[NFC][ARM] Pre-commit tail predication test
YangZhihui [Wed, 23 Sep 2020 13:08:14 +0000 (09:08 -0400)]
Fix typos in ASTMatchers.h; NFC
Matt Arsenault [Sat, 19 Sep 2020 12:26:38 +0000 (08:26 -0400)]
GlobalISel: Fix truncating shift amount in trunc (shl) combine
The shift amount type does not necessarily match the result type. This
was inserting a trunc from s32 to s32, which asserted. Just preserve
the original shift amount type which can be legalized later.
Matt Arsenault [Thu, 17 Sep 2020 22:18:46 +0000 (18:18 -0400)]
AMDGPU: Check global FP atomics match default FP mode
We would always select global FP atomics from atomicrmw fadd, although
they have a hardcoded FP mode.
Joseph Tremoulet [Wed, 23 Sep 2020 13:00:50 +0000 (06:00 -0700)]
[lldb] Fix GetRemoteSharedModule fallback logic
When the various methods of locating the module in GetRemoteSharedModule
fail, make sure we pass the original module spec to the bail-out call to
the provided resolver function.
Also make sure we consistently use the resolved module spec from the
various success paths.
Thanks to what appears to have been an accidentally inverted condition
(commit 85967fa applied the new condition to a path where GetModuleSpec
returns false, but should have applied it when GetModuleSpec returns
true), without this fix we only pass the original module spec in the
fallback if the original spec has no uuid (or has a uuid that somehow
matches the resolved module's uuid despite the call to GetModuleSpec
failing). This manifested as a bug when processing a minidump file with
a user-provided sysroot, since in that case the resolver call was being
applied to resolved_module_spec (despite resolution failing), which did
not have the path of its file_spec set.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D88099
Louis Dionne [Wed, 23 Sep 2020 12:49:00 +0000 (08:49 -0400)]
[libc++] Re-apply
fdc41e11f (LWG1203) without breaking the C++11 build
fdc41e11f was reverted in
e46c1def5 because it broke the C++11 build.
We shouldn't be using enable_if_t in C++11, instead we must use
enable_if<...>::type.
Sourabh Singh Tomar [Wed, 23 Sep 2020 12:51:05 +0000 (18:21 +0530)]
[NFCI][flang] Renamed a variable name to a more descriptive name
Sourabh Singh Tomar [Wed, 23 Sep 2020 12:32:49 +0000 (18:02 +0530)]
[flang] Removed OpenMP lowering unittests
These tests aren't adding much value and consensus has been reached for
there removal.
For more context, please refer to discussion in this revision:
https://reviews.llvm.org/D87846
Jakub Lichman [Wed, 23 Sep 2020 11:52:10 +0000 (11:52 +0000)]
[mlir] Added support for f64 memref printing in runner utils
Added print_memref_f64 function to runner utils.
Differential Revision: https://reviews.llvm.org/D88143
Sourabh Singh Tomar [Tue, 22 Sep 2020 07:53:24 +0000 (13:23 +0530)]
[OpenMP][flang]Lower NUM_THREADS clause for parallel construct
This patch reflects the work that can be upstreamed from PR(merged)
PR: https://github.com/flang-compiler/f18-llvm-project/pull/411
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D87846
Yaxun (Sam) Liu [Tue, 22 Sep 2020 16:52:07 +0000 (12:52 -0400)]
[CUDA][HIP] Fix static device var used by host code only
A static device variable may be accessed in host code through
cudaMemCpyFromSymbol etc. Currently clang does not
emit the static device variable if it is only referenced by
host code, which causes host code to fail at run time.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D88115
Jean Perier [Wed, 23 Sep 2020 11:38:10 +0000 (13:38 +0200)]
[flang] CHARACTER(*) return does not require explicit interface
Fortran 2018 15.4.2.2(4)(c) says nonassumed or explicit non-constant
length parameter require explicit interface. The "nonassumed" part was
missing in f18 characteristic analysis causing CanBeCalledViaImplicitInterface
to return false for `CHARACTER(*) function foo()` like interfaces.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D88075
Kerry McLaughlin [Wed, 23 Sep 2020 10:28:11 +0000 (11:28 +0100)]
[SVE][CodeGen] Lower legal integer -> floating point conversions
This patch adds new ISD nodes, SCVTZ_MERGE_PASSTHRU &
UCVTZ_MERGE_PASSTHRU, which are used to lower both legal
scalable vector [S|U]INT_TO_FP operations and the following intrinsics:
- llvm.aarch64.sve.scvtf
- llvm.aarch64.sve.ucvtf
Reviewed By: sdesmalen, efriedma
Differential Revision: https://reviews.llvm.org/D87913
Georgii Rymar [Tue, 22 Sep 2020 12:09:12 +0000 (15:09 +0300)]
[llvm-readelf/obj] - Fix extended section symbol indices printed in warnings for MIPS GOT/PLT entries.
Recent refactoring introduced a symbol index argument for `getFullSymbolName` method,
which is only used for reporting error messages about invalid extended symbol indexes.
There are few issues in the implementation and we don't report correct symbol indices
when dumping MIPS GOT/PLT entries currently.
This patch adds test cases and fixes the issue.
Differential revision: https://reviews.llvm.org/D88089
Georgii Rymar [Fri, 11 Sep 2020 13:26:59 +0000 (16:26 +0300)]
[llvm-readelf/obj] - Print section symbol names properly when dumping relocations.
Currently `--relocations` ignores section symbol names and always prints
section names for them. This is inconsistent with GNU readelf and with `--symbols`.
We have a code in `getFullSymbolName` (which is used for `--symbols`) which can be
reused for `getRelocationTarget` (used for `--relocations`).
With that the issue described is fixed and code becomes a bit shorter.
Also with this change we start to print more relocations (in situations when we just
showed warnings instead before) and also start to report more diagnostic warnings
(see reloc-zero-name-or-value.test).
Differential revision: https://reviews.llvm.org/D87613
Sebastian Neubauer [Fri, 4 Sep 2020 10:36:29 +0000 (12:36 +0200)]
[AMDGPU] Insert waitcnt after returning from call
When memory operations are outstanding on function calls, either the
caller or the callee can insert a waitcnt to ensure that all reads are
finished.
Calls need some time to be executed, so if the callee inserts the
waitcnt, filling the instruction buffer and waiting for memory will be
interleaved, hiding some latency. This comes at the cost of having a
waitcnt inside functions that may not be needed as no memory operations
are outstanding.
For function calls, this is already implemented. The same principal
applies to returns: If the caller inserts a waitcnt after the call, the
callee does not have to wait and the return and memory operation can be
run in parallel.
This commit implements waiting in the caller after returning from a
function call.
Differential Revision: https://reviews.llvm.org/D87674
Georgii Rymar [Sat, 19 Sep 2020 16:53:51 +0000 (19:53 +0300)]
[llvm-readelf/obj] - Cleanup the code. NFCI.
This:
1) Replaces pointers with references in many places.
2) Adds few TODOs about fixing possible unhandled errors (in ARMEHABIPrinter.h).
3) Replaces `auto`s with actual types.
4) Removes excessive arguments.
5) Adds `const ELFFile<ELFT> &Obj;` member to `ELFDumper` to simplify the code.
Differential revision: https://reviews.llvm.org/D88097
Gabor Marton [Tue, 22 Sep 2020 15:12:42 +0000 (17:12 +0200)]
[analyzer][StdLibraryFunctionsChecker] Separate the signature from the summaries
The signature should not be part of the summaries as many FIXME comments
suggests. By separating the signature, we open up the way to a generic
matching implementation which could be used later under the hoods of
CallDescriptionMap.
Differential Revision: https://reviews.llvm.org/D88100
Gabor Marton [Tue, 22 Sep 2020 13:02:00 +0000 (15:02 +0200)]
[analyzer][StdLibraryFunctionsChecker] Fix getline/getdelim signatures
It is no longer needed to add summaries of 'getline' for different
possible underlying types of ssize_t. We can just simply lookup the
type.
Differential Revision: https://reviews.llvm.org/D88092
David Sherwood [Fri, 18 Sep 2020 07:39:31 +0000 (08:39 +0100)]
[SVE] Make EVT::getScalarSizeInBits and others consistent with Type::getScalarSizeInBits
An existing function Type::getScalarSizeInBits returns a uint64_t
instead of a TypeSize class because the caller is requesting a
scalar size, which cannot be scalable. This patch makes other
similar functions requesting a scalar size consistent with that,
thereby eliminating more than 1000 implicit TypeSize -> uint64_t
casts.
Differential revision: https://reviews.llvm.org/D87889
Raphael Isemann [Wed, 23 Sep 2020 08:03:42 +0000 (10:03 +0200)]
Revert "[libc++] Implement LWG1203"
This reverts commit
fdc41e11f9687a50c97e2a59663bf2d541ff5489. It causes the
libcxx/modules/stds_include.sh.cpp test to fail with:
libcxx/include/ostream:1039:45: error: no template named 'enable_if_t'; did you mean 'enable_if'?
template <class _Stream, class _Tp, class = enable_if_t<
Still investigating what's causing this and reverting in the meantime to get
the bots green again.
David Sherwood [Wed, 9 Sep 2020 13:03:07 +0000 (14:03 +0100)]
[SVE] Fix InstCombinerImpl::PromoteCastOfAllocation for scalable vectors
In this patch I've fixed some warnings that arose from the implicit
cast of TypeSize -> uint64_t. I tried writing a variety of different
cases to show how this optimisation might work for scalable vectors
and found:
1. The optimisation does not work for cases where the cast type
is scalable and the allocated type is not. This because we need to
know how many times the cast type fits into the allocated type.
2. If we pass all the various checks for the case when the allocated
type is scalable and the cast type is not, then when creating the
new alloca we have to take vscale into account. This leads to
sub-optimal IR that is worse than the original IR.
3. For the remaining case when both the alloca and cast types are
scalable it is hard to find examples where the optimisation would
kick in, except for simple bitcasts, because we typically fail the
ABI alignment checks.
For now I've changed the code to bail out if only one of the alloca
and cast types is scalable. This means we continue to support the
existing cases where both types are fixed, and also the specific case
when both types are scalable with the same size and alignment, for
example a simple bitcast of an alloca to another type.
I've added tests that show we don't attempt to promote the alloca,
except for simple bitcasts:
Transforms/InstCombine/AArch64/sve-cast-of-alloc.ll
Differential revision: https://reviews.llvm.org/D87378
Piotr Sobczak [Thu, 17 Sep 2020 12:21:23 +0000 (14:21 +0200)]
[AMDGPU] Fix merging m0 inits
Fix incorrect merges of m0 inits in loops.
It was assumed that if a clobbering instruction appears in
the same block as an init and the clobbering instruction
does not dominate the init then it does not interfere with
init.
This does not work in the presence of loops, where in this
scenario, the clobbering instruction does interfere with
the init in another iteration.
To fix this, do not check for block equality and defer the
decision to the predecessor check.
Differential Revision: https://reviews.llvm.org/D87882
MaheshRavishankar [Tue, 22 Sep 2020 22:58:24 +0000 (15:58 -0700)]
[mlir][Linalg] Add pattern to fold linalg.tensor_reshape that add unit extent dims.
A sequence of two reshapes such that one of them is just adding unit
extent dims can be folded to a single reshape.
Differential Revision: https://reviews.llvm.org/D88057
Anatoly Parshintsev [Wed, 23 Sep 2020 06:43:13 +0000 (23:43 -0700)]
[RISCV][ASAN] implementation of ThreadSelf for riscv64
[6/11] patch series to port ASAN for riscv64
Depends On D87574
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D87575
Vitaly Buka [Wed, 23 Sep 2020 06:37:16 +0000 (23:37 -0700)]
[NFC] Reformat preprocessor directives
Vitaly Buka [Wed, 23 Sep 2020 06:29:33 +0000 (23:29 -0700)]
Revert "[RISCV][ASAN] implementation of ThreadSelf for riscv64"
Merged two unrelated commits
This reverts commit
00f6ebef6e347e0d24a8f940fe43656719e88cb8.
Albion Fung [Wed, 23 Sep 2020 06:17:59 +0000 (01:17 -0500)]
[PowerPC] Implementation of 128-bit Binary Vector Mod and Sign Extend builtins
This patch implements 128-bit Binary Vector Mod and Sign Extend builtins for PowerPC10.
Differential: https://reviews.llvm.org/D87394#inline-815858
Martin Storsjö [Wed, 23 Sep 2020 05:52:16 +0000 (08:52 +0300)]
[CVP] Remove a redundant trailing semicolon, fixing GCC warnings. NFC.
Martin Storsjö [Wed, 23 Sep 2020 05:51:34 +0000 (08:51 +0300)]
[InstCombine] Add parentheses in assert to silence GCC warning. NFC.
Martin Storsjö [Wed, 9 Sep 2020 07:34:15 +0000 (10:34 +0300)]
[MC] [Win64EH] Try to generate packed unwind info where possible
In practice, this only gives modest savings (for a 6.5 MB DLL with
230 KB xdata, the xdata sections shrinks by around 2.5 KB); to
gain more, the frame lowering would need to be tweaked to more often
generate frame layouts that match the canonical layouts that can
be written in packed form.
Differential Revision: https://reviews.llvm.org/D87371
Mehdi Amini [Wed, 23 Sep 2020 05:50:05 +0000 (05:50 +0000)]
Add a dump() method on the pass manager for debugging purpose (NFC)
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D88008
Anatoly Parshintsev [Wed, 23 Sep 2020 05:27:40 +0000 (22:27 -0700)]
[RISCV][ASAN] implementation of ThreadSelf for riscv64
[6/11] patch series to port ASAN for riscv64
Depends On D87574
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D87575
Alexey Baturo [Wed, 23 Sep 2020 05:21:05 +0000 (22:21 -0700)]
[RISCV][ASAN] implementation for vfork interceptor for riscv64
[5/11] patch series to port ASAN for riscv64
Depends On D87573
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D87574
Anatoly Parshintsev [Wed, 23 Sep 2020 05:10:13 +0000 (22:10 -0700)]
[RISCV][ASAN] implementation of clone interceptor for riscv64
[4/11] patch series to port ASAN for riscv64
Depends On D87572
Reviewed By: eugenis, vitalybuka
Differential Revision: https://reviews.llvm.org/D87573
Anatoly Parshintsev [Wed, 23 Sep 2020 04:58:25 +0000 (21:58 -0700)]
[RISCV][ASAN] implementation of internal syscalls wrappers for riscv64
implements glibc-like wrappers over Linux syscalls.
[3/11] patch series to port ASAN for riscv64
Depends On D87998
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D87572
Jan Korous [Wed, 23 Sep 2020 04:21:08 +0000 (21:21 -0700)]
[Analyzer][WebKit] Use tri-state types for relevant predicates
Some of the predicates can't always be decided - for example when a type
definition isn't available. At the same time it's necessary to let
client code decide what to do about such cases - specifically we can't
just use true or false values as there are callees with
conflicting strategies how to handle this.
This is a speculative fix for PR47276.
Differential Revision: https://reviews.llvm.org/D88133
Anatoly Parshintsev [Wed, 23 Sep 2020 04:30:09 +0000 (21:30 -0700)]
[RISCV][ASAN] updated platform macros to simplify detection of RISCV64 platform
[2/11] patch series to port ASAN for riscv64
Depends On D87997
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D87998
Fangrui Song [Wed, 23 Sep 2020 04:36:59 +0000 (21:36 -0700)]
[sanitizers] Remove the message queue with IPC_RMID after D82897
Nemanja Ivanovic [Wed, 23 Sep 2020 04:18:33 +0000 (23:18 -0500)]
[Sanitizers] Fix test case that doesn't clean up after itself
Commit https://reviews.llvm.org/rG144e57fc9535 added this test
case that creates message queues but does not remove them. The
message queues subsequently build up on the machine until the
system wide limit is reached. This has caused failures for a
number of bots running on a couple of big PPC machines.
This patch just adds the missing cleanup.
Greg McGary [Wed, 23 Sep 2020 03:42:12 +0000 (20:42 -0700)]
[lld-maco] fix build breakage
Teresa Johnson [Sat, 19 Sep 2020 17:09:28 +0000 (10:09 -0700)]
[ThinLTO] Avoid temporaries when loading global decl attachment metadata
When performing ThinLTO importing, the metadata loader attempts to lazy
load, by building an index. However, module level global decl attachment
metadata was being parsed early while building the index, since the
associated (module level) global values aren't materialized on demand.
This results in the creation of forward reference temporary metadatas,
which are expensive.
Normally, these module level global values don't have much attached
metadata. However, in the case of -fwhole-program-vtables (e.g. for
whole program devirtualization), the vtables may have many attached type
metadatas. This was resulting in very slow performance when performing
ThinLTO importing with the default lazy loading.
This patch restructures the handling of these global decl attachment
records, delaying their parsing until after the lazy loading index has
been built. Then the parser can use the interface that loads from the
index, which resolves forward references immediately instead of creating
expensive temporaries.
For one ThinLTO backend that imports from modules containing huge
numbers of vtables and associated types, I measured the following
compile times for the metadata materialization during function
importing, rounded to nearest second:
No -fwhole-program-vtables:
Lazy loading on (head): 1s
Lazy loading off (head): 3s
Lazy loading on (patch): 1s
With -fwhole-program-vtables:
Lazy loading on (head): 440s
Lazy loading off (head): 4s
Lazy loading on (patch): 2s
Differential Revision: https://reviews.llvm.org/D87970
Greg McGary [Sun, 13 Sep 2020 03:45:00 +0000 (20:45 -0700)]
[lld-macho] In the context of relocs, s/target/referent/ for sections & symbols
The word "target" is overloaded, so lighten its load by using another word to denote the symbol or section to which a reloc points. While more stilted than "target", "referent" is rather less pompous than "designatum" or "denotatum". :P
Along the way, make a few neighboring variable names more descriptive.
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D87584
Arthur Eubanks [Wed, 23 Sep 2020 02:30:03 +0000 (19:30 -0700)]
[test][NewPM] Clean up ScalarEvolution tests to work under NPM
Bing1 Yu [Wed, 23 Sep 2020 02:13:03 +0000 (10:13 +0800)]
[CostModel][X86] add CostModel for SK_Select(v8f64, v8i64, v16f32, v16i32, v32i16, v64i8)
add CostModel for SK_Select(v8f64, v8i64, v16f32, v16i32, v32i16, v64i8)
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D87884
Arthur Eubanks [Wed, 23 Sep 2020 02:26:30 +0000 (19:26 -0700)]
[test][NewPM] Fix update-scev.ll under NPM
Andrew Litteken [Wed, 23 Sep 2020 02:02:34 +0000 (21:02 -0500)]
Revert "[IRSim] Adding IRSimilarityCandidate that contains a region of IRInstructionData."
This reverts commit
4944bb190fed8861d4d043eaf45e3c1e12aa2dc5.
Arthur Eubanks [Fri, 18 Sep 2020 20:52:11 +0000 (13:52 -0700)]
[NewPM] Pin tests with -debug-pass to legacy PM
-debug-pass is a legacy PM only option.
Some tests checks that the pass returned that it made a change,
which is not relevant to the NPM, since passes return PreservedAnalyses.
Some tests check that passes are freed at the proper time, which is also
not relevant to the NPM.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D87945
Xing GUO [Wed, 23 Sep 2020 00:41:46 +0000 (08:41 +0800)]
[DWARFYAML][test] Simplify __debug_pubnames/types tests. NFC.
This patch stripped unneeded sections from the test case.
Reviewed By: grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D88073
Leonard Chan [Wed, 23 Sep 2020 00:40:53 +0000 (17:40 -0700)]
Revert "Canonicalize declaration pointers when forming APValues."
This reverts commit
905b9ca26c94fa86339451a528cedde5004fc1bb.
Reverting because this strips `weak` attributes off function
declarations, leading to the linker error we see at
https://ci.chromium.org/p/fuchsia/builders/ci/clang_toolchain.fuchsia-arm64-debug-subbuild/
b8868932035091473008.
See https://reviews.llvm.org/rG905b9ca26c94 for reproducer details.
Fangrui Song [Mon, 21 Sep 2020 16:43:23 +0000 (09:43 -0700)]
[EHStreamer] Ensure CallSiteEntry::{BeginLabel,EndLabel} are non-null. NFC
... to simplify the code a bit.
Reviewed By: rahmanl
Differential Revision: https://reviews.llvm.org/D87999
Greg McGary [Mon, 21 Sep 2020 18:04:13 +0000 (11:04 -0700)]
[lld-macho] handle option -headerpad_max_install_names
Differential Revision: https://reviews.llvm.org/D88064
Yuanfang Chen [Tue, 22 Sep 2020 23:51:23 +0000 (16:51 -0700)]
[Clang] Fix a typo in implicit-int-float-conversion.c
Andrew Litteken [Tue, 15 Sep 2020 22:30:31 +0000 (17:30 -0500)]
[IRSim] Adding IRSimilarityCandidate that contains a region of IRInstructionData.
The IRSimilarityCandidate is a container to hold a region of
IRInstructions and offer interfaces for the starting instruction, ending
instruction, parent function, length. It also assigns a global value
number for each unique instance of a value in the region.
It also contains an interface to compare two IRSimilarity as to whether
they have the same sequence of similar instructions.
Tests for whether the instructions are similar are found in
unittests/Analysis/IRSimilarityIdentifierTest.cpp.
Differential Revision: https://reviews.llvm.org/D86970
antonio-cortes-perez [Tue, 22 Sep 2020 23:39:50 +0000 (23:39 +0000)]
[NFC][docs] Fix link.
The rendered html was (no hyperlink was generated):
(see Getting Started <GettingStarted.html#git-pre-push-hook>)
Now, it is (with proper hyperlink):
(see Git pre-push hook)
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D88116
Lang Hames [Tue, 22 Sep 2020 23:04:37 +0000 (16:04 -0700)]
[ORC][examples] Add missing library dependencies.
Walter Erquinigo [Tue, 22 Sep 2020 21:49:16 +0000 (14:49 -0700)]
[trace] avoid using <regex>
Easy fix based on the feedback by maskray on
https://reviews.llvm.org/D85705.
Hubert Tong [Tue, 22 Sep 2020 22:52:47 +0000 (18:52 -0400)]
[InstCombine][NFC][tests] Add ninf base value case to pow-sqrt.ll
Hubert Tong [Tue, 22 Sep 2020 22:49:55 +0000 (18:49 -0400)]
[InstCombine] Fix errno bug in pow expansion to sqrt
A conversion from `pow` to `sqrt` shall not call an `errno`-setting
`sqrt` with -//infinity//: the `sqrt` will set `EDOM` where the `pow`
call need not.
This patch avoids the erroneous (pun not intended) transformation by
applying the restrictions discussed in the thread for
https://lists.llvm.org/pipermail/llvm-dev/2020-September/145051.html.
The existing tests are updated (depending on emphasis in the checks for
library calls, avoidance of overlap, and overall coverage):
- to add `ninf`, retaining the intended library call,
- to use the intrinsic, retaining the use of `select`, or
- to expect the replacement to not occur.
The following is tested:
- The pow intrinsic folds to a `select` instruction to
handle -//infinity//.
- The pow library call folds, with `ninf`, to `sqrt` without the
`select` instruction associated with handling -//infinity//.
- The pow library call does not fold to `sqrt` without `ninf`.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D87877
Alexey Bataev [Tue, 22 Sep 2020 20:50:21 +0000 (16:50 -0400)]
[SLP]Fix coding style, NFC.
Louis Dionne [Mon, 21 Sep 2020 14:54:16 +0000 (10:54 -0400)]
[libc++] NFC: Reindent the feature test macro generation script
Each feature-test macro is now a clear block indentation-wise.
Louis Dionne [Mon, 21 Sep 2020 14:36:37 +0000 (10:36 -0400)]
[libc++] NFC: Collocate C++20 removed members of std::allocator