Chris Bieneman [Tue, 26 Apr 2022 14:58:16 +0000 (09:58 -0500)]
[SPIRV][NFC] Remove unused variable
This removes an unused local variable that was causing a warning to be
emitted.
Jonas Paulsson [Thu, 24 Mar 2022 11:41:34 +0000 (12:41 +0100)]
[SystemZ] Fix C++ ABI for passing args of structs containing zero width bitfield.
A struct like { float a; int :0; } should per the SystemZ ABI be passed in a
GPR, but to match a bug in GCC it has been passed in an FPR (see 759449c).
GCC has now corrected the C++ ABI for this case, and this patch for clang
follows suit.
Reviewed By: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D122388
Nikita Popov [Tue, 26 Apr 2022 15:04:25 +0000 (17:04 +0200)]
[InstCombine] Add tests for GEP of GEP with opaque pointers (NFC)
Test cases with element type mismatch, some of which can still
be combined.
Chris Bieneman [Tue, 26 Apr 2022 14:46:50 +0000 (09:46 -0500)]
[SPIRV][NFC] Fix warnings for switch cases
Switch statements that cover all cases should not have a `default`
case. When a switch covers all cases and includes a `default` case,
clang emits a diagnostic. Omitting the `default` case allows the
compiler to instead emit a diagnostic on unhandled enum values.
This change removes default cases from all the places that they
shouldn't be, and adds a missing enum case for one switch statement
that wasn't covering all values.
Chris Bieneman [Tue, 26 Apr 2022 14:46:07 +0000 (09:46 -0500)]
[SPIRV][NFC] Fix warning on class/struct mismatch
Clang issues a warning on class/struct mismatch because the MSVC ABI
varries for classes and structs.
Joseph Huber [Tue, 26 Apr 2022 14:49:31 +0000 (10:49 -0400)]
[OpenMP] Fix incorrect path taken when searching for LLD for offloading
Summary:
A previous patch updated the path searching in the linker wrapper. I
made an error and caused `lld`, which is necessary to link AMDGPU
images, to not be found on some systems. This patch fixes this by
correctly searching that linker-wrapper's binary path first again.
Jeremy Morse [Tue, 26 Apr 2022 10:08:05 +0000 (11:08 +0100)]
Reapply D124184, [DebugInfo][InstrRef] Add a size operand to DBG_PHI
This was reverted twice, in
987cd7c3ed75b and
13815e8cbf8d4. The latter
stemed from not accounting for rare register classes in a pre-allocated
array, and the former from an array not being completely initialized,
leading to asan complaining.
Igor Kudrin [Tue, 26 Apr 2022 14:44:24 +0000 (18:44 +0400)]
[LoopPeel][NFCI] Simplify the code to calculate peel count for PGO
This reorganizes the code as a preparation for D123865:
* Use more descriptive names for variables
* Simplify a condition by use an already calculated value
for `MaxPeelCount`
* Remove a duplicate log entry
* Report basic values for loop costs
Differential Revision: https://reviews.llvm.org/D124388
Igor Kudrin [Tue, 26 Apr 2022 14:43:56 +0000 (18:43 +0400)]
[LoopPeel][NFC] Exit early if there is no room for peeling
Differential Revision: https://reviews.llvm.org/D123864
Yaxun (Sam) Liu [Mon, 25 Apr 2022 15:34:08 +0000 (11:34 -0400)]
[HIP] Fix diag msg about sanitizer
Fix the misleading diag msg as the option is ignored for a particular
offload arch only.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D124396
Igor Chebykin [Tue, 26 Apr 2022 14:23:17 +0000 (17:23 +0300)]
[NVPTX][tests] add "XFAIL: nvptx" for some tests
Some tests failed for NVPTX target, but it seems that NVPTX will be
fixed and the tests will pass. So, just mark the tests as XFAIL
Differential Revision: https://reviews.llvm.org/D124125
Igor Chebykin [Tue, 26 Apr 2022 14:15:50 +0000 (17:15 +0300)]
[NVPTX][tests] Do not run the tests which are not supported by nvptx
Some generic tests are not supported by the nvptx now. Moreover, they
are no plans to fix the tested features in nvptx. So, suggest to mark
them as UNSUPPORTED
Differential Revision: https://reviews.llvm.org/D123928
Krystian Kuzniarek [Thu, 7 Apr 2022 11:11:02 +0000 (13:11 +0200)]
[clang-format][docs] Fix incorrect 'clang-format 9' option marker
Introduced by
23a5090c6, this style option marker indicated
'clang-format 9', though its respective option was available in
an earlier release.
Differential Revision: https://reviews.llvm.org/D123299
Paul Robinson [Tue, 26 Apr 2022 14:14:27 +0000 (07:14 -0700)]
[PS5] Correctly test for analyzer defaults
Commit 5c90eca added some analyzer option checking, but a typo meant
it was redundantly checking PS4 and not adding checking for PS5.
With the test corrected, it identified the necessary driver updates,
added in this commit.
Ilya Biryukov [Tue, 26 Apr 2022 13:38:28 +0000 (13:38 +0000)]
[Index] [clangd] Support for concept declarations and requires expressions
Add support for concepts and requires expression in the clang index.
Genarate USRs for concepts.
Also change how `RecursiveASTVisitor` handles return type requirement in
requires expressions. The new code unpacks the synthetic template parameter
list used for storing the actual expression. This simplifies
implementation of the indexing. No code seems to depend on the original
traversal anyway and the synthesized template parameter list is easily
accessible from inside the requires expression if needed.
Add tests in the clangd codebase.
Fixes https://github.com/clangd/clangd/issues/1103.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D124441
Erich Keane [Tue, 26 Apr 2022 12:50:33 +0000 (05:50 -0700)]
Fix test from 5ff992 to work with win 32 bit, fix a typo.
See the discussion on D123319. Default calling convention on Windows32
bit is to have 'this-call' for member functions, so add a wildcard to
take care of that.
Also, one of the FileCheck 'match' flags was incorrect, so fix that too.
Florian Hahn [Tue, 26 Apr 2022 12:16:02 +0000 (13:16 +0100)]
[ConstraintElimination] Check if const. is small enough before using it
Check if the value of a ConstantInt is small enough to be used for
solving before calling getSExtValue.
Fixes #55085
Liqiang Tao [Tue, 26 Apr 2022 12:16:37 +0000 (20:16 +0800)]
[llvm][Inline] Remove PriorityInlineOrder in SCC inliner
Since the size of most of SCC's is 1, the PriorityInlineOrder would not change the inline
order in SCC inliner.
Reviewed By: kazu
Differential Revision: https://reviews.llvm.org/D123608
Alex Zinenko [Tue, 26 Apr 2022 11:57:03 +0000 (13:57 +0200)]
[mlir] Fix -Wunused-private-field in the Transform dialect
Classes derived from TransformState::Extension may need access to the
parent state.
Florian Hahn [Tue, 26 Apr 2022 11:41:41 +0000 (12:41 +0100)]
[IPSCCP] Support unfeasible default dests for switch.
At the moment, unfeasible default destinations are not handled properly
in removeNonFeasibleEdges. So far, only unfeasible cases are removed,
but later code expects unreachable blocks to have no predecessors.
This is causing the crash reported in PR49573.
If the default destination is unfeasible it won't be executed. Create
a new unreachable block on demand and use that as default
destination.
Note that at the moment this only is relevant for cases where
resolvedUndefsIn marks the first case as executable. Regular switch
handling has a FIXME/TODO to support determining whether the default
case is feasible or not.
Fixes #48917.
Differential Revision: https://reviews.llvm.org/D113497
Nathan Sidwell [Mon, 28 Feb 2022 18:13:44 +0000 (10:13 -0800)]
[demangler] Simplify OutputBuffer initialization
Every non-testcase use of OutputBuffer contains code to allocate an
initial buffer (using either 128 or 1024 as initial guesses). There's
now no need to do that, given recent changes to the buffer extension
heuristics -- it allocates a 1k(ish) buffer on first need.
Just pass in a buffer (if any) to the constructor. Thus the
OutputBuffer's ownership of the buffer starts at its own lifetime
start. We can reduce the lifetime of this object in several cases.
That new constructor takes a 'size_t *' for the size argument, as all
uses with a non-null buffer are passing through a malloc'd buffer from
their own caller in this manner.
The buffer reset member function is never used, and is deleted.
The original buffer initialization code would return a failure code if
that first malloc failed. Existing code either ignored that, called
std::terminate with a FIXME, or returned an error code.
But that's not foolproof anyway, as a subsequent buffer extension
failure ends up calling std::terminate. I am working on addressing
that unfortunate failure mode in a manner more consistent with the C++
ABI design.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D122604
Alex Zinenko [Tue, 26 Apr 2022 11:04:41 +0000 (13:04 +0200)]
[mlir] Add a title to the Transform Dialect doc
Alexey Lapshin [Tue, 26 Apr 2022 09:45:28 +0000 (12:45 +0300)]
[llvm-objcopy][NFC] rename variable.
Martin Storsjö [Thu, 24 Mar 2022 11:17:28 +0000 (13:17 +0200)]
[compiler-rt] Use C_STANDARD instead of custom logic for adding -std=c11
Apply this in add_compiler_rt_runtime instead of manually adding it
to the individual projects. This applies the option on more
parts of compiler-rt than before, but should ideally not make any
difference assuming the other runtimes that lacked the option
also were C11 compatible.
Not marking this as required, to match the existing behaviour (where
`-std=c11` was added only if supported by the compiler).
This was suggested during the review of D110005.
Differential Revision: https://reviews.llvm.org/D124343
LLVM GN Syncbot [Tue, 26 Apr 2022 09:06:40 +0000 (09:06 +0000)]
[gn build] Port
854c33946fd4
Dmitry Makogon [Fri, 15 Apr 2022 07:59:40 +0000 (14:59 +0700)]
[RS4GC] Prune inputs of BDV if they are BDV themselves
Don't check whether an input of BDV can be pruned if the input
is the BDV itself. BDV is present in the states map, so in case
the input is the BDV itself, we'd return false. So explicitly check this case.
Differential Revision: https://reviews.llvm.org/D123846
Alexey Lapshin [Fri, 22 Apr 2022 09:58:13 +0000 (12:58 +0300)]
[llvm-gsymutil][NFC] refactor AddressRange&AddresRanges structures.
llvm-gsymutil has an implementation of AddressRange and AddressRanges
classes. That implementation might be reused in other parts of llvm.
This patch moves AddressRange and AddressRanges classes into llvm/ADT.
Differential Revision: https://reviews.llvm.org/D124350
Haojian Wu [Tue, 26 Apr 2022 08:35:53 +0000 (10:35 +0200)]
[pseudo] NFC, fix some code-style naming violations.
Jun Zhang [Sat, 9 Apr 2022 02:42:25 +0000 (10:42 +0800)]
[Clang] Use std::move in GlobalModuleIndex::readIndex. NFC
BitstreamCursors are heavy-weight objects that should not be passed by value.
Differential Revision: https://reviews.llvm.org/D123436
Xiang1 Zhang [Fri, 22 Apr 2022 06:59:53 +0000 (14:59 +0800)]
[X86] Add use condition for combineSetCCMOVMSK
Reviewed by RKSimon, LuoYuanke
Differential Revision: https://reviews.llvm.org/D123652
Haojian Wu [Mon, 25 Apr 2022 13:42:35 +0000 (15:42 +0200)]
[clang] Fix a constant evaluator crash on a NULL-type expr.
Differential Revision: https://reviews.llvm.org/D124384
Christudasan Devadasan [Tue, 26 Apr 2022 06:45:08 +0000 (12:15 +0530)]
[AMDGPU] Vector register spill test cleanup (NFC)
The vector register spills have no dependency with
SILowerSGPRSpills pass anymore. The entire handling
has been moved to PrologEpilogInserter with D55301.
Siva Chandra [Tue, 26 Apr 2022 07:25:12 +0000 (00:25 -0700)]
[libc] Add stdio entrypoints to aarch64 fullbuild.
Siva Chandra [Tue, 26 Apr 2022 07:09:35 +0000 (00:09 -0700)]
[libc][Obvious] Add deps of fopencookie_test only if it is enabled.
Luo, Yuanke [Sun, 24 Apr 2022 08:31:43 +0000 (16:31 +0800)]
[X86][AMX] Report error when shapes are not pre-defined.
Instead of report fatal error, this patch emit error message and exit
when shapes are not pre-defined. This would cause the compiling fail but
not crash.
Differential Revision: https://reviews.llvm.org/D124342
Nikolas Klauser [Sat, 23 Apr 2022 08:07:24 +0000 (10:07 +0200)]
[libc++] Remove <functional> includes
Reviewed By: var-const, #libc, ldionne
Spies: #libc_vendors, ldionne, libcxx-commits, miyuki
Differential Revision: https://reviews.llvm.org/D124123
Balazs Benics [Tue, 26 Apr 2022 06:49:05 +0000 (08:49 +0200)]
[analyzer] Fix ValistChecker false-positive involving symbolic pointers
In the following example:
int va_list_get_int(va_list *va) {
return va_arg(*va, int); // FP
}
The `*va` expression will be something like `Element{SymRegion{va}, 0, va_list}`.
We use `ElementRegions` for representing the result of the dereference.
In this case, the `IsSymbolic` was set to `false` in the
`getVAListAsRegion()`.
Hence, before checking if the memregion is a SymRegion, we should take
the base of that region.
Analogously to the previous example, one can craft other cases:
struct MyVaList {
va_list l;
};
int va_list_get_int(struct MyVaList va) {
return va_arg(va.l, int); // FP
}
But it would also work if the `va_list` would be in the base or derived
part of a class. `ObjCIvarRegions` are likely also susceptible.
I'm not explicitly demonstrating these cases.
PS: Check the `MemRegion::getBaseRegion()` definition.
Fixes #55009
Reviewed By: xazax.hun
Differential Revision: https://reviews.llvm.org/D124239
Serge Pavlov [Sun, 10 Oct 2021 15:46:58 +0000 (22:46 +0700)]
Intrinsic for checking floating point class
This change introduces a new intrinsic, `llvm.is.fpclass`, which checks
if the provided floating-point number belongs to any of the the specified
value classes. The intrinsic implements the checks made by C standard
library functions `isnan`, `isinf`, `isfinite`, `isnormal`, `issubnormal`,
`issignaling` and corresponding IEEE-754 operations.
The primary motivation for this intrinsic is the support of strict FP
mode. In this mode using compare instructions or other FP operations is
not possible, because if the value is a signaling NaN, floating-point
exception `Invalid` is raised, but the aforementioned functions must
never raise exceptions.
Currently there are two solutions for this problem, both are
implemented partially. One of them is using integer operations to
implement the check. It was implemented in https://reviews.llvm.org/D95948
for `isnan`. It solves the problem of exceptions, but offers one
solution for all targets, although some can do the check in more
efficient way.
The other, implemented in https://reviews.llvm.org/D96568, introduced a
hook 'clang::TargetCodeGenInfo::testFPKind', which injects a target
specific code into IR to implement `isnan` and some other functions. It is
convenient for targets that have dedicated instruction to determine FP data
class. However using target-specific intrinsic complicates analysis and can
prevent some optimizations.
A special intrinsic for value class checks allows representing data class
tests with enough flexibility. During IR transformations it represents the
check in target-independent way and saves it from undesired transformations.
In the instruction selector it allows efficient lowering depending on the
used target and mode.
This implementation is an extended variant of `llvm.isnan` introduced
in https://reviews.llvm.org/D104854. It is limited to minimal intrinsic
support. Target-specific treatment will be implemented in separate
patches.
Differential Revision: https://reviews.llvm.org/D112025
Tanya Lattner [Tue, 26 Apr 2022 05:32:56 +0000 (22:32 -0700)]
Provide the complete response and reporting Code of Conduct documentation. Remove the word draft from all documents, add information about the CoC committee expectations and add a place for transparency reports.
This patch provides the response and reporting guides for Code of Conduct reports. It also removes the word draft from all the documents,
adds information about the CoC committee, and a place to put transparency reports. A post will also be made on Discourse to provide more details about the history of the code of conduct, this patch, and next steps. Please see that post for full details. I will put a link below once I have it.
Reviewed By: aaron.ballman, hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D122937
Walter Erquinigo [Wed, 20 Apr 2022 04:57:31 +0000 (21:57 -0700)]
[NFC][trace] simplify the instruction dumper
TraceInstructionDumper::DumpInstructions was becoming too big, so I'm
refactoring it into smaller functions. I also made some static methods proper
instance methods to simplify calls. Other minor improvements are also done.
Differential Revision: https://reviews.llvm.org/D124064
Lian Wang [Thu, 21 Apr 2022 03:17:31 +0000 (03:17 +0000)]
[RISCV][SelectionDAG] Support VP_ADD/VP_MUL/VP_SUB mask operations
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D124144
Walter Erquinigo [Mon, 18 Apr 2022 16:28:10 +0000 (09:28 -0700)]
[trace][intel pt] Support events
A trace might contain events traced during the target's execution. For
example, a thread might be paused for some period of time due to context
switches or breakpoints, which actually force a context switch. Not only
that, a trace might be paused because the CPU decides to trace only a
specific part of the target, like the address filtering provided by
intel pt, which will cause pause events. Besides this case, other kinds
of events might exist.
This patch adds the method `TraceCursor::GetEvents()`` that returns the
list of events that happened right before the instruction being pointed
at by the cursor. Some refactors were done to make this change simpler.
Besides this new API, the instruction dumper now supports the -e flag
which shows pause events, like in the following example, where pauses
happened due to breakpoints.
```
thread #1: tid = 2717361
a.out`main + 20 at main.cpp:27:20
0: 0x00000000004023d9 leaq -0x1200(%rbp), %rax
[paused]
1: 0x00000000004023e0 movq %rax, %rdi
[paused]
2: 0x00000000004023e3 callq 0x403a62 ; std::vector<int, std::allocator<int> >::vector at stl_vector.h:391:7
a.out`std::vector<int, std::allocator<int> >::vector() at stl_vector.h:391:7
3: 0x0000000000403a62 pushq %rbp
4: 0x0000000000403a63 movq %rsp, %rbp
```
The `dump info` command has also been updated and now it shows the
number of instructions that have associated events.
Differential Revision: https://reviews.llvm.org/D123982
LLVM GN Syncbot [Tue, 26 Apr 2022 01:46:12 +0000 (01:46 +0000)]
[gn build] Port
b1fa5ac3ba34
Mircea Trofin [Mon, 25 Apr 2022 20:49:27 +0000 (13:49 -0700)]
[mlgo] Factor out TensorSpec
This is a simple datatype with a few JSON utilities, and is independent
of the underlying executor. The main motivation is to allow taking a
dependency on it on the AOT side, and allow us build a correctly-sized
buffer in the cases when the requested feature isn't supported by the
model. This, in turn, allows us to grow the feature set supported by the
compiler in a backward-compatible way; and also collect traces exposing
the new features, but starting off the older model, and continue
training from those new traces.
Differential Revision: https://reviews.llvm.org/D124417
Jeffrey Tan [Wed, 20 Apr 2022 14:30:53 +0000 (07:30 -0700)]
Refactor protected virtual functions from SymbolFile into new SymbolFileCommon class.
This is a preparatory patch for https://reviews.llvm.org/D121631.
It refactors protected virtual members of SymbolFile
into a new SymbolFileCommon class per suggestion in:
https://reviews.llvm.org/D121631
This will avoid the friendship declaration in that patch.
Differential Revision: https://reviews.llvm.org/D124110
Chris Bieneman [Tue, 26 Apr 2022 01:07:56 +0000 (20:07 -0500)]
NFC. Add missing DXILPointerTyID case
This resolves -Werror hexigon build failures.
YASHASVI KHATAVKAR [Tue, 26 Apr 2022 00:46:14 +0000 (20:46 -0400)]
Don't replace Undef with null value for Constants Differential Revision:https://reviews.llvm.org/D124098
Vladimir Vereschaka [Tue, 26 Apr 2022 00:44:35 +0000 (17:44 -0700)]
[CMake] Update cache file for Win to ARM Linux cross toolchain builders. NFC.
Use default test configuration file for the libunwind tests.
Vladimir Vereschaka [Tue, 26 Apr 2022 00:33:03 +0000 (17:33 -0700)]
[libunwind] Update the test configuration files to support the remote execution.
These changes allow remote execution for the libunwind library tests.
Differential Revision: https://reviews.llvm.org/D123890
Nico Weber [Tue, 26 Apr 2022 00:25:39 +0000 (20:25 -0400)]
[gn build] Kind of port
e6f44a3cd273 (DirectXTests)
Vitaly Buka [Mon, 25 Apr 2022 23:35:58 +0000 (16:35 -0700)]
[test][clangd] Use StringRef instead of std::string
runWithAST stores the first parameters as StringRef, so we can't
use temporarily std::string from parameter ID.
Will Hawkins [Mon, 25 Apr 2022 23:29:07 +0000 (16:29 -0700)]
[lldb] Update online help text (consistency, typo)
Update the online help text for breakpoint set to be
consistent with respect to the spelling of Objective-C
and fix a few space-related typos.
Differential revision: https://reviews.llvm.org/D124338
Craig Topper [Mon, 25 Apr 2022 18:03:19 +0000 (11:03 -0700)]
[RISCV] Pre-commit test for D122769. NFC
Zequan Wu [Mon, 25 Apr 2022 23:06:52 +0000 (16:06 -0700)]
[LLDB][NativePDB] Fix incorrect file index of inlinees introduced by
f00cd23caed5f920495bcae2055f4c478d8383d6
Eric Schweitz [Mon, 25 Apr 2022 19:13:54 +0000 (12:13 -0700)]
[NFC] Cleanup code to get back in synch for upstreaming.
Differential Revision: https://reviews.llvm.org/D124410
Chris Bieneman [Thu, 14 Apr 2022 18:40:26 +0000 (13:40 -0500)]
Add PointerType analysis for DirectX backend
As implemented this patch assumes that Typed pointer support remains in
the llvm::PointerType class, however this could be modified to use a
different subclass of llvm::Type that could be disallowed from use in
other contexts.
This does not rely on inserting typed pointers into the Module, it just
uses the llvm::PointerType class to track and unique types.
Fixes #54918
Reviewed By: kuhar
Differential Revision: https://reviews.llvm.org/D122268
Jeremy Morse [Mon, 25 Apr 2022 22:30:15 +0000 (23:30 +0100)]
Revert "Reapply D124184, [DebugInfo][InstrRef] Add a size operand to DBG_PHI"
This reverts commit
5db925023169f8a19419e68153682d1e518f8392.
Further to the early revert, the sanitizers have found something wrong with
this.
Frederik Gossen [Mon, 25 Apr 2022 21:44:53 +0000 (17:44 -0400)]
Add missing comparison operators to SmallVector
Differential Revision: https://reviews.llvm.org/D124407
Vitaly Buka [Fri, 1 Apr 2022 04:58:44 +0000 (21:58 -0700)]
[libc++] Avoid lifetime UB in __thread_local_data()
Detected on many lld tests with -fsanitize-memory-use-after-dtor.
Also https://lab.llvm.org/buildbot/#/builders/sanitizer-x86_64-linux-fast after D122869 will report a lot of them.
Threads may outlive static variables. Even if ~__thread_specific_ptr() does nothing, lifetime of members ends with ~ and accessing the value is UB https://eel.is/c++draft/basic.life#1
```
==9214==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x557e1cec4539 in __libcpp_tls_set ../include/c++/v1/__threading_support:428:12
#1 0x557e1cec4539 in set_pointer ../include/c++/v1/thread:196:5
#2 0x557e1cec4539 in void* std::__msan::__thread_proxy<
std::__msan::tuple<...>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()> >(void*) ../include/c++/v1/thread:285:27
Memory was marked as uninitialized
#0 0x557e10a0759d in __sanitizer_dtor_callback compiler-rt/lib/msan/msan_interceptors.cpp:940:5
#1 0x557e1d8c478d in std::__msan::__thread_specific_ptr<std::__msan::__thread_struct>::~__thread_specific_ptr() libcxx/include/thread:188:1
#2 0x557e10a07dc0 in MSanCxaAtExitWrapper(void*) compiler-rt/lib/msan/msan_interceptors.cpp:1151:3
```
The test needs D123979 or -fsanitize-memory-param-retval enabled by default.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D122864
Quinn Pham [Fri, 22 Apr 2022 21:21:02 +0000 (16:21 -0500)]
[libcxx][NFC] Inclusive language: remove use of sanity check
from libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.virtuals/
[NFC] As part of using inclusive language within the llvm project, this
patch rewords comments to remove sanity check.
Reviewed By: #libc, philnik
Differential Revision: https://reviews.llvm.org/D124391
Jakub Chlanda [Mon, 25 Apr 2022 21:22:22 +0000 (14:22 -0700)]
[NVPTX] Support float <-> 2 x half bitcasts
Make sure NVPTX backend can handle bitcasting between `float` and `<2 x half>` types.
This was discovered through: https://github.com/intel/llvm/issues/5969
I'm not suggesting that such bitcasts make much sense, but it feels like the compiler should not hard crash on them.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D124171
Artem Belevich [Mon, 25 Apr 2022 21:28:30 +0000 (14:28 -0700)]
Change NVPTX/f16x2-instructions.ll to use unix EOL. NFC
Sanjay Patel [Mon, 25 Apr 2022 19:49:30 +0000 (15:49 -0400)]
[InstCombine] add tests for icmp with extended operands; NFC
Sanjay Patel [Mon, 25 Apr 2022 17:15:55 +0000 (13:15 -0400)]
[InstCombine] use isKnownNonNegative to reduce code duplication; NFC
We may be able to make the ValueTracking wrapper smarter
in the future (for example, analyze a simple recurrence),
so this will automatically benefit if that happens.
Quinn Pham [Fri, 22 Apr 2022 21:15:24 +0000 (16:15 -0500)]
[compiler-rt][NFC] Inclusive language: remove use of sanity check/test
from compiler-rt/lib/tsan
[NFC] As part of using inclusive language within the llvm project, this
patch rewords comments to remove sanity check and sanity test.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D124390
Matt Arsenault [Fri, 1 Apr 2022 13:59:05 +0000 (09:59 -0400)]
RegAllocGreedy: Allow last chance recolor to retry overlapping tuples
Last chance recoloring didn't try recoloring a done register with the
same class since it believed there was no point. This doesn't
necessarily apply if the members in that class overlap. Allow the
recoloring to proceed if the assigned interfering physical register
overlaps with the candidate register.
This avoids an allocation failure with overlapping tuples. This
testcase could be handled better, and I don't believe should reach
last chance recoloring. The failure only manifests with the mutually
unsatisfiable register hints to overlapping tuples. The earlier
assignment decisions probably should have figured out that using these
hints was a bad idea.
Quinn Pham [Fri, 22 Apr 2022 21:26:13 +0000 (16:26 -0500)]
[clang][NFC] Inclusive language: remove use of Whitelist in clang/lib/Analysis/
[NFC] As part of using inclusive language within the llvm project, this patch
rewords a comment to replace Whitelist with Allowlist in
`RetainSummaryManager.cpp`.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D124389
Krzysztof Drewniak [Tue, 19 Apr 2022 17:10:31 +0000 (17:10 +0000)]
[mlir] Allow data flow analysis of non-control flow branch arguments
This commit adds the visitNonControlFlowArguments method to
DataFlowAnalysis, allowing analyses to provide lattice values for the
arguments to a RegionSuccessor block that aren't directly tied to an
op's inputs. For example, integer range interface can use this method
to infer bounds for the step values in loops.
This method has a default implementation that keeps the old behavior
of assigning a pessimistic fixedpoint state to all such arguments.
Reviewed By: Mogball, rriddle
Differential Revision: https://reviews.llvm.org/D124021
Martin Storsjö [Mon, 25 Apr 2022 08:02:36 +0000 (11:02 +0300)]
[libunwind] [CMake] Remove leftover no-op cmake variable setting. NFC.
The setting and restoring of this variable became unused in
3ee0cec88effc88285732c8bec2a8f0e4e37c0b1 / D112155.
Differential Revision: https://reviews.llvm.org/D124372
Martin Storsjö [Mon, 25 Apr 2022 10:00:13 +0000 (13:00 +0300)]
[libunwind] Fix build warnings in Unwind-EHABI.cpp. NFC.
Differential Revision: https://reviews.llvm.org/D124371
Peter Klausler [Wed, 20 Apr 2022 22:58:43 +0000 (15:58 -0700)]
[flang][runtime] Fix total MAXLOC/MINLOC for non-integer data
A template argument was hard-coded as the Integer type category
rather than properly forwarding the type category of the data for
type-specific instantiations of total (no DIM=) MAXLOC and MINLOC.
This broke total MAXLOC and MINLOC reductions for real and character
data.
Differential Revision: https://reviews.llvm.org/D124303
Paul Robinson [Mon, 25 Apr 2022 19:41:37 +0000 (12:41 -0700)]
[PS5] Driver test for analyzer defaults
Peter Klausler [Tue, 19 Apr 2022 20:49:06 +0000 (13:49 -0700)]
[flang] Add semantic checks for intrinsic function REDUCE()
Support REDUCE's special semantic requirements in intrinsic
procedure semantics.
Differential Revision: https://reviews.llvm.org/D124296
Yuanfang Chen [Sun, 24 Apr 2022 02:30:00 +0000 (19:30 -0700)]
[lit] Keep stdout/stderr when using GoogleTest format
When a unit test crashes or timeout, print the shard's stdout and
stderr. When a unit test fails, attaches the test's output to the LIT
output to help debugging.
While at it, concatenating shard's environment variables using space
instead of newline to make the reproducer script user friendly.
Based on D123797. (Thanks to @lenary)
Valery N Dmitriev [Mon, 25 Apr 2022 19:25:33 +0000 (12:25 -0700)]
[SLP] Steer for the best chance in tryToVectorize() when rooting with binary ops.
tryToVectorize() method implements one of searching paths for vectorizable tree roots in SLP vectorizer,
specifically for binary and comparison operations. Order of making probes for various scalar pairs
was defined by its implementation: the instruction operands, then climb over one operand if
the instruction is its sole user and then perform same actions for another operand if previous
attempts failed. Problem with this approach is that among these options we can have more than a
single vectorizable tree candidate and it is not necessarily the one that encountered first.
Trying to build vectorizable tree for each possible combination for just evaluation is expensive.
But we already have lookahead heuristics mechanism which we use for finding best pick among
operands of commutative instructions. It calculates cumulative score for candidates in two
consecutive lanes. This patch introduces use of the heuristics for choosing the best pair among
several combinations. We only try one that looks as most promising for vectorization.
Additional benefit is that we reduce total number of vectorization trees built for probes
because we skip those looking non-profitable early.
Reviewed By: Alexey Bataev (ABataev), Vasileios Porpodas (vporpo)
Differential Revision: https://reviews.llvm.org/D124309
Sam McCall [Mon, 25 Apr 2022 19:16:31 +0000 (21:16 +0200)]
[Serialization] Remove dead TYPE_FUNCTION_PROTO abbreviation. NFC
It was added in
01b2cb47 but never used.
Peter Klausler [Sat, 23 Apr 2022 22:41:16 +0000 (15:41 -0700)]
[flang] Accept "INFINITY" as real input
Both "INF" and "INFINITY" are standard.
Differential Revision: https://reviews.llvm.org/D124401
jfurtek [Mon, 25 Apr 2022 19:00:20 +0000 (19:00 +0000)]
[mlir][tblgen] Generate builders with inferred return types and unwrapped attributes
This diff causes mlir-tblgen to generate code for an additional builder for an
operation argument with a return type that can be inferred *AND* an attribute in
the argument list can be "unwrapped." (Previously, the unwrapped build function
was only generated for builders with explicit return types in separate or
aggregate form.) As an example, this builder might be used by code that creates
operations that implement the `SameOperandsAndResultType` interface. A test case
was created.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D124043
Jeremy Furtek [Mon, 25 Apr 2022 18:51:09 +0000 (18:51 +0000)]
[mlir][ods] Extend the EnumAttr tablegen class to support BitEnum attributes
This diff allows the EnumAttr class to be used for bit enum attributes (in
addition to previously supported integer enum attributes). While integer
and bit enum attributes share many common implementation aspects, parsing
bit enum values requires a separate implementation. This is accomplished
by creating empty parser and printer strings in the EnumAttrInfo record,
and having derived classes (specific to bit and integer enums) override with
an appropriate parser/printer string.
To support existing bit enums that may use a vertical bar separator, the
parser is modified to support the | token.
Tests were added for bit enums alongside integer enums.
Future diffs for fastmath attributes in the arithmetic dialect will use these
changes.
(resubmission of earlier abaondoned diff, updated to reflect subsequent changes
in the repository)
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D123880
jfurtek [Mon, 25 Apr 2022 18:48:16 +0000 (18:48 +0000)]
[mlir][ods] Add tablegen field for concise printing of BitEnum attributes
This diff introduces a tablegen field for bit enum attributes
(`printBitEnumPrimaryGroups`) to control printing when the enum uses "group"
cases. An example would be an implementation that uses a `fastmath` enum value
as an alias for individual fastmath flags. The proposed field would allow
printing of simply `fast` for the enum value, instead of the more verbose list
that would include `fast` as well as the individual flags (e.g. `reassoc,nnan,
ninf,nsz,arcp,contract,afn,fast`).
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D123871
Ishaan Gandhi [Mon, 25 Apr 2022 18:15:15 +0000 (20:15 +0200)]
compile commands header to source heuristic lower-cases filenames before inferring file types
This leads to ".C" files being rewritten as ".c" files and being inferred to be "c" files as opposed to "c++" files.
Fixes https://github.com/clangd/clangd/issues/1108
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D124262
Rahman Lavaee [Mon, 25 Apr 2022 18:32:13 +0000 (11:32 -0700)]
[BOLT] Refactor DataAggregator::printLBRHeatMap.
This also fixes some logs that were impacted by D123067.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D124281
Mingming Liu [Mon, 25 Apr 2022 15:51:45 +0000 (15:51 +0000)]
Add a regression test to guard the 0 hot-caller threshold in SamplePGO + ThinLTO. - Add a comment near where the threshold is set.
Peter Klausler [Sat, 23 Apr 2022 17:15:02 +0000 (10:15 -0700)]
[flang][runtime] Fix KIND=16 real/complex component I/O
Don't treat KIND=16 as 80-bit extended floating-point any more on x86.
Differential Revision: https://reviews.llvm.org/D124400
Nathan Lanza [Mon, 25 Apr 2022 17:48:55 +0000 (10:48 -0700)]
[coroutines] Get an IntegerType from the value instead of defaulting to 64 bit
This AliasPtr is being created always from an Int64 even for targets
where 32 bit is the proper type. e.g. “thumbv7-none-linux-android16”.
This causes the assert in the `get` func to fail as we're getting a 32
bit from the APInt.
Fix this by simply always just getting the type from the value instead.
Reviewed By: ChuanqiXu
Differential Revision: https://reviews.llvm.org/D123272
Sam McCall [Mon, 25 Apr 2022 17:20:39 +0000 (19:20 +0200)]
[Basic] SourceManager docs: macro expansion SLocs aren't a single token. NFC
And haven't been since 2011: https://github.com/llvm/llvm-project/commit/
eeca36fe9ad767380b2eab76a6fe5ba410a47393
Craig Topper [Mon, 25 Apr 2022 17:45:48 +0000 (10:45 -0700)]
[RISCV] Add isCommutable to ADD/ADDW/MUL/AND/OR/XOR/MIN/MAX/CLMUL
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D123970
David Green [Mon, 25 Apr 2022 17:44:35 +0000 (18:44 +0100)]
[CostModel] Add fptoi_sat costmodel tests. NFC
Vitaly Buka [Tue, 19 Apr 2022 03:39:30 +0000 (20:39 -0700)]
[libcxx] Disable long double -> int128 test with msan
On x86 long double is 80 bit with padding, which produces
uninitialized bits in the result.
This will trigger errors with -fsanitize-memory-param-retval.
Can be triggered with D123979.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D123980
Fangrui Song [Mon, 25 Apr 2022 17:21:26 +0000 (10:21 -0700)]
[LegacyPM] Remove HWAsanSanitizerLegacyPass
Using the legacy PM for the optimization pipeline was deprecated in 13.0.0.
Following recent changes to remove non-core features of the legacy
PM/optimization pipeline, remove AddressSanitizerLegacyPass...
...,
ModuleAddressSanitizerLegacyPass, and ASanGlobalsMetadataWrapperPass.
MemorySanitizerLegacyPass was removed in D123894.
AddressSanitizerLegacyPass was removed in D124216.
Reviewed By: #sanitizers, vitalybuka
Differential Revision: https://reviews.llvm.org/D124337
Louis Dionne [Mon, 25 Apr 2022 17:16:30 +0000 (11:16 -0600)]
[libc++][NFC] Use brace-init instead of parens to workaround macro expansion in badly behaved systems
David Green [Mon, 25 Apr 2022 17:13:23 +0000 (18:13 +0100)]
[NFC] Rename Instrinsic to Intrinsic
Arthur Eubanks [Mon, 25 Apr 2022 17:01:17 +0000 (10:01 -0700)]
[test] Remove legacy PM pipeline test
The legacy PM for the optimization pipeline is deprecated and in the process of being cleaned up.
Nathan Sidwell [Fri, 8 Apr 2022 13:55:31 +0000 (06:55 -0700)]
[demangler][NFC] OperatorInfo table unit test
Placing a run-once test inside the operator lookup function caused
problems with the thread sanitizer. See D122975.
Break out the operator table into a member variable, and move the test
to the unit test machinery.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D123390
Peter Klausler [Fri, 22 Apr 2022 21:06:54 +0000 (14:06 -0700)]
[flang] Avoid global name conflict when BIND(C,NAME=) is used
At the top level of program units in a source file, two subprograms
are allowed to have the same name if at least one of them has a
distinct interoperable binding name. F18's symbol table requires
(most) symbols in a scope to have distinct names, though. Solve
by using compiler-created names for the symbols of global scope
subprograms that have interoperable binding names.
Differential Revision: https://reviews.llvm.org/D124295
Peter Klausler [Fri, 22 Apr 2022 21:16:16 +0000 (14:16 -0700)]
[flang] Disambiguate F(X)=Y case where F is a function returning a pointer
F(X)=Y may be initially parsed as a statement function definition; an
existing pass will detect statement functions that should be rewritten
into assignment statemets with array element references as their
left-hand side variables. However, F() may also be a reference to a
function that returns a data pointer, and f18 did not handle this
case correctly.
The right fix is to rewrite the parse tree for F(X)=Y into an assignment
to a function reference result. The cases that are actually assignments
to array elements -- including all of the cases previously handled --
will have their left-hand sides converted to array element references
later by another existing rewriting step.
Differential Revision: https://reviews.llvm.org/D124299
Zakk Chen [Mon, 25 Apr 2022 15:44:55 +0000 (08:44 -0700)]
[RISCV] Fix incorrect policy implement for unmasked vslidedown and vslideup.
vslideup works by leaving elements 0<i<OFFSET undisturbed.
so it need the destination operand as input for correctness
regardless of policy. Add a operand to indicate policy.
We also add policy operand for unmaksed vslidedown to keep the interface consistent with vslideup
because vslidedown have only undisturbed at 0<i<vstart but user have no way to control of vstart.
Reviewed By: rogfer01, craig.topper
Differential Revision: https://reviews.llvm.org/D124186
Simon Pilgrim [Mon, 25 Apr 2022 15:51:57 +0000 (16:51 +0100)]
[X86] combineX86ShuffleChain - don't fold to truncate(concat(V1,V2)) if it was already a PACK op
Fixes #55050
Christudasan Devadasan [Mon, 25 Apr 2022 15:47:33 +0000 (21:17 +0530)]
[AMDGPU] Lit test pre-commit changes (NFC)
Run line change needed for an upcoming patch.
Christudasan Devadasan [Mon, 25 Apr 2022 15:32:28 +0000 (21:02 +0530)]
[AMDGPU] Regenerate lit test pattern (NFC).