Florian Mayer [Thu, 10 Mar 2022 00:16:24 +0000 (16:16 -0800)]
[NFC] [HWASan] document why we tag Size but untag AlignedSize.
Aart Bik [Wed, 9 Mar 2022 23:11:31 +0000 (15:11 -0800)]
[mlir][sparse] add end2end test for linalg.dot sparsification
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D121344
Shilei Tian [Wed, 9 Mar 2022 23:48:44 +0000 (18:48 -0500)]
[OpenMP][CUDA] Fix the check of `setContext`
Aart Bik [Wed, 9 Mar 2022 19:04:00 +0000 (11:04 -0800)]
[mlir][sparse] added linalg.dot to sparse kernel collection
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D121315
Kevin Athey [Wed, 9 Mar 2022 22:57:05 +0000 (14:57 -0800)]
Revert "[MSAN] add interceptor for timer_create, timer_settime, timer_gettime"
This reverts commit
0a4dec6cc2bf17acacc883cd897481028f1cf425.
breaks buildbots
Kevin Athey [Wed, 9 Mar 2022 22:55:12 +0000 (14:55 -0800)]
Revert "[MSAN] adjust Posix/timer.cpp"
This reverts commit
f2a97536809588f1748d32d2e79c9a2a6b4ec335.
breaks buildbot
Sanjay Patel [Wed, 9 Mar 2022 22:36:37 +0000 (17:36 -0500)]
[Analysis] remove bogus smin/smax pattern detection
This is a revert of
cfcc42bdc. The analysis is wrong as shown by
the minimal tests for instcombine:
https://alive2.llvm.org/ce/z/y9Dp8A
There may be a way to salvage some of the other tests,
but that can be done as follow-ups. This avoids a miscompile
and fixes #54311.
Sanjay Patel [Wed, 9 Mar 2022 22:18:35 +0000 (17:18 -0500)]
[InstCombine] add tests to show miscompiled smin/smax; NFC
Stanislav Mekhanoshin [Wed, 9 Mar 2022 20:55:11 +0000 (12:55 -0800)]
[SDAG] Use MMO flags in MemSDNode folding
SDNodes with different target flags may now be folded together
rightfully resulting in the assertion in the refineAlignment.
Folding nodes with different target flags may result in the
wrong load instructions produced at least on the AMDGPU.
Fixes: SWDEV-326805
Differential Revision: https://reviews.llvm.org/D121335
Louis Dionne [Wed, 9 Mar 2022 21:59:59 +0000 (16:59 -0500)]
Revert "[libc++] Remove extension to support allocator<const T>"
This reverts commit
276ca873. That commit has quite a history at this
point. It was first landed in
dbc647643577, which broke std::shared_ptr<T const>
and was reverted in
9138666f5. It was then re-applied in
276ca873, with
the std::shared_ptr issue fixed, but it caused widespread breakage at
Google (which suggests it would cause similar breakage in the wild too),
so now I'm reverting again.
Instead, I will add a escape hatch that vendors can turn on to enable
the extension and perform a phased transition over one or two releases
like we sometimes do when things become non-trivial.
Michael Gottesman [Wed, 9 Mar 2022 19:33:49 +0000 (11:33 -0800)]
[debug-info] Debug salvage llvm.dbg.addr in original function that point into the coroutine frame when splitting coros.
We are already doing this in the split functions while we clone. This just
handles the original function.
I also updated the coroutine split test to validate that we are always referring
to the msg in the context object instead of in a shadow copy.
rdar://
83957028
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D121324
David Green [Wed, 9 Mar 2022 21:46:57 +0000 (21:46 +0000)]
[AArch64][SLP] Add a test with mutual reductions. NFC
Colin Cross [Wed, 9 Mar 2022 20:45:45 +0000 (12:45 -0800)]
[CompilerRT] Fix build of compiler-rt with musl
Use the correct types for OFF_T, __sanitizer_time_t and
__sanitizer_dirent and forward time_t related functions
to fix using compiler-rt with 32-bit musl libc.
Also redirect the time_t functions that are affected by
https://musl.libc.org/time64.html to use their 64-bit
ABI names.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D119358
Craig Topper [Wed, 9 Mar 2022 21:38:32 +0000 (13:38 -0800)]
[RISCV] Switch undef -> poison in fixed-vector RVV tests
Shilei Tian [Wed, 9 Mar 2022 21:32:40 +0000 (16:32 -0500)]
[OpenMP][CUDA] Avoid calling `cuCtxSetCurrent` redundantly
Currently we set ccontext everywhere accordingly, but that causes many
unnecessary function calls. For example, in the resource pool, if we need to
resize the pool, we need to get from allocator. Each call to allocate sets the
current context once, which is unnecessary. In this patch, we set the context
only in the entry interface functions, if needed. Actually in the best way this
should be implemented via RAII, but since `cuCtxSetCurrent` could return error,
and we don't use exception, we can't stop the execution if RAII fails.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D121322
zhijian [Wed, 9 Mar 2022 21:28:55 +0000 (16:28 -0500)]
[NFC][llvm-nm] create a new helper function exportSymbolNamesFromFiles for --export-symbols
Summary:
create a new helper function exportSymbolNamesFromFiles for --export-symbols
Reviewer : James Henderson,Fangrui Song
Differential Revision: https://reviews.llvm.org/D120913
David Blaikie [Wed, 9 Mar 2022 21:05:03 +0000 (21:05 +0000)]
Revert "Disable -Wmissing-prototypes for internal linkage functions that aren't explicitly marked "static""
Regresses:
typedef struct {
static void f() {
}
} a_t;
Causing this to error instead of warn, because the linkage is computed
earlier/too early perhaps. I'll send out a review to see if there's some
other path forward or if this is an acceptable regression, etc.
This reverts commit
275c56226d7fbd6a4d554807374f78d323aa0c1c.
Kevin Athey [Wed, 9 Mar 2022 20:57:06 +0000 (12:57 -0800)]
[MSAN] adjust Posix/timer.cpp
follow up to
0a4dec6cc2bf.
add unsupported for s390 (SEGV)
restore line that s390 complains, so following asserts work.
Differential Revision: https://reviews.llvm.org/D121326
Congzhe Cao [Wed, 9 Mar 2022 20:49:05 +0000 (15:49 -0500)]
[LoopInterchange] Detect output dependency of a store instruction with itself
This patch is motivated by pr48057 where an output dependency is not detected
since loop interchange did not check a store instruction with itself.
Fixed that deficiency.
Reviewed By: bmahjour, Meinersbur, #loopoptwg
Differential Revision: https://reviews.llvm.org/D118102
zhijian [Wed, 9 Mar 2022 20:13:26 +0000 (15:13 -0500)]
[llvm-nm][NFC] remove global variable " std::vector<NMSymbol> SymbolList"
Summary:
according to Jame's comment in the patch https://reviews.llvm.org/D112735
Created a NFC patch to remove global variable " std::vector<NMSymbol> SymbolList"
Reviewer : James Henderson,Fangrui Song
Differential Revision: https://reviews.llvm.org/D120687
Valentin Clement [Wed, 9 Mar 2022 19:57:09 +0000 (20:57 +0100)]
[flang][NFC] Remove old RTBuilder.h
RTBuilder.h has been moved in `flang/Optimizer/Builder/Runtime/RTBuilder.h`.
This duplicate is not necessary anymore.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D121317
Shilei Tian [Wed, 9 Mar 2022 19:55:07 +0000 (14:55 -0500)]
[OpenMP][CUDA] Fix an issue that multiple `CUmodule` are could be overwritten
This patch fixes the issue introduced in
14de0820e87f and D120089, that
if dynamic libraries are used, the `CUmodule` array could be overwritten.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D121308
Mark Dewing [Wed, 9 Mar 2022 19:52:15 +0000 (14:52 -0500)]
[OpenMP][doc]Minor doc fixes
In SupportAndFAQ.rst, add blank lines before and after a bullet list and
sublist. This avoids an "Unepxected indentation" warning.
In Runtimes.rst, adjust the suggestion for setting LIBOMPTARGET_INFO.
The right shifts are not necessary as the bit mask values are already
correct.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D119595
zhijian [Wed, 9 Mar 2022 19:45:27 +0000 (14:45 -0500)]
[llvm-nm]add helper function to print out the object file name, archive name, architecture name
Summary:
1. added helper function printObjectNamesInfo() to print out object file name, archive name, architecture name.
2. One small behaviors change.
in the function dumpMachOUniversalBinaryArchAll , delete the functionality:
if (moreThanOneArch)
outs() << "\n";
Reviewer : James Henderson,Fangrui Song
Differential Revision: https://reviews.llvm.org/D120357
Kevin Athey [Wed, 9 Mar 2022 19:19:58 +0000 (11:19 -0800)]
[MSAN] add interceptor for timer_create, timer_settime, timer_gettime
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D120602
Alok Kumar Sharma [Wed, 9 Mar 2022 19:11:30 +0000 (00:41 +0530)]
[DebugInfo][SROA] Correct debug info for global variables in case of SROA
The existing handling produced crash for test case (attached with patch).
Now the function transferSRADebugInfo is modified to
- Ignore the current variable if it starts after the current Fragment.
- Ignore the current variable if it ends before the current Fragment.
- Generate (!DIExpression()) if current variable completely fits the
current Fragment.
- Otherwise (as earlier), generate the DW_OP_LLVM_fragment in IR if current
Fragment partially defines current variable.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D121107
Valentin Clement [Wed, 9 Mar 2022 18:50:17 +0000 (19:50 +0100)]
[flang] Lower more array character cases
This patch adds more lowering and tests for character array assignment/copy.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D121300
Reviewed By: PeteSteinfeld, schweitz
Differential Revision: https://reviews.llvm.org/D121301
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Saleem Abdulrasool [Wed, 9 Mar 2022 18:46:29 +0000 (18:46 +0000)]
lldb/ObjectFile: reflow a comment (NFC)
Reflow the textual comment which preserves formatted output from
tooling. This makes the content legible again after the lldb source
code was reformatted with automated tooling.
Florian Hahn [Wed, 9 Mar 2022 18:46:11 +0000 (18:46 +0000)]
Revert "[PassManager] Add pretty stack entries before P->run() call."
This reverts commit
128745cc2681c284bc6d0150a319673a6d6e8424.
This increased compile-time unnecessarily. Revert this change and follow
ups
2c7afadb4789 &
add0c5856d5f.
http://llvm-compile-time-tracker.com/compare.php?from=
338dfcd60f843082bb589b287d890dbd9394eb82&to=
128745cc2681c284bc6d0150a319673a6d6e8424&stat=instructions
Petr Hosek [Wed, 9 Mar 2022 18:45:27 +0000 (10:45 -0800)]
Revert "[MSAN] add interceptor for timer_create, timer_settime, timer_gettime"
This reverts commit
c2aab0d3808b3e3058febe637148ca66b0f03c71 due to
a leak in timer.cpp that showed up on several bots.
Andrew Litteken [Thu, 3 Mar 2022 04:50:40 +0000 (22:50 -0600)]
[IROutliner] Handling outlined code with no exit paths
As a result of adding multiblock outlining, it became possible to outline the entirety of basic block, and branches that only pointed to the basic blocks contained in the outlined section. This means that there are no exit paths, and no return statement. There was a previous assertion from the older version of the outliner that explicitly made sure there was a return statement. This removes that assertion.
Reviewers: paquette
Differential Revision: https://reviews.llvm.org/D120868
Saleem Abdulrasool [Wed, 9 Mar 2022 04:12:59 +0000 (20:12 -0800)]
AArch64: correct epilogue/prologue emission for swift async
The prologue and epilogue emission were unbalanced in light of different
strategies of async frame context emission. Adjust the epilogue emission
to match the prologue emission. This makes the elision work properly as
well as the deployment based. Due to the fact that the epilogue always
was clearing a bit (which should not be set in the first place), the
client would not notice the behavioural issue unless the deployment
version was in effect.
Valentin Clement [Wed, 9 Mar 2022 18:32:55 +0000 (19:32 +0100)]
[flang] Update ArrayValueCopy to support array_amend and array_access
This patch update the array value copy pass to support fir-array_amend
and fir.array_access.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld, schweitz
Differential Revision: https://reviews.llvm.org/D121300
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Xi Ruoyao [Wed, 9 Mar 2022 18:20:05 +0000 (10:20 -0800)]
[sanitizer][mips] Fix the condition to include sanitizer_atomic_clang_mips.h
The Glibc header [1] define _ABIO32 unconditionally on MIPS. So we need
to compare _MIPS_SIM and _ABIO32 to know if we are actually building for
MIPS32. Using sanitizer_atomic_clang_mips.h can cause test failures and
hangs on MIPS64.
[1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mips/sgidefs.h
Reviewed By: dvyukov, vitalybuka, MaskRay
Differential Revision: https://reviews.llvm.org/D121207
Sanjay Patel [Wed, 9 Mar 2022 18:12:43 +0000 (13:12 -0500)]
[SDAG] match rotate pattern with extra 'or' operation
This is another fold generalized from D111530.
We can find a common source for a rotate operation hidden inside an 'or':
https://alive2.llvm.org/ce/z/9pV8hn
Deciding when this is profitable vs. a funnel-shift is tricky, but this
does not show any regressions: if a target has a rotate but it does not
have a funnel-shift, then try to form the rotate here. That is why we
don't have x86 test diffs for the scalar tests that are duplicated from
AArch64 (
74a65e3834d9487 ) - shld/shrd are available. That also makes it
difficult to show vector diffs - the only case where I found a diff was
on x86 AVX512 or XOP with i64 elements.
There's an additional check for a legal type to avoid a problem seen
with x86-32 where we form a 64-bit rotate but then it gets split
inefficiently. We might avoid that by adding more rotate folds, but
I didn't check to see what is missing on that path.
This gets most of the motivating patterns for AArch64 / ARM that are in
D111530.
We still need a couple of enhancements to setcc pattern matching with
rotate/funnel-shift to get the rest.
Differential Revision: https://reviews.llvm.org/D120933
Changpeng Fang [Wed, 9 Mar 2022 18:14:05 +0000 (10:14 -0800)]
AMDGPU: Set up User SGPRs for queue_ptr only when necessary
Summary:
In general, we need queue_ptr for aperture bases and trap handling,
and user SGPRs have to be set up to hold queue_ptr. In current implementation,
user SGPRs are set up unnecessarily for some cases. If the target has aperture
registers, queue_ptr is not needed to reference aperture bases. For trap
handling, if target suppots getDoorbellID, queue_ptr is also not necessary.
Futher, code object version 5 introduces new kernel ABI which passes queue_ptr
as an implicit kernel argument, so user SGPRs are no longer necessary for
queue_ptr. Based on the trap handling document:
https://llvm.org/docs/AMDGPUUsage.html#amdgpu-trap-handler-for-amdhsa-os-v4-onwards-table,
llvm.debugtrap does not need queue_ptr, we remove queue_ptr suport for llvm.debugtrap
in the backend.
Reviewers: sameerds, arsenm
Fixes: SWDEV-307189
Differential Revision: https://reviews.llvm.org/D119762
Stanislav Mekhanoshin [Thu, 24 Feb 2022 19:32:21 +0000 (11:32 -0800)]
[AMDGPU] Merge flat with global in the SILoadStoreOptimizer
Flat can be merged with flat global since address cast is a no-op.
A combined memory operation needs to be promoted to flat.
Differential Revision: https://reviews.llvm.org/D120431
Jay Foad [Wed, 9 Mar 2022 14:59:09 +0000 (14:59 +0000)]
[AMDGPU] Remove HasAtomicFaddInstsGFX90X and HasAtomicFaddInstsGFX940
These compound predicates are not required, since we can use a
combination of setting the SubtargetPredicate (to a subtarget
predicate like isGFX940Plus) and OtherPredicates (to a list of feature
predicates like HasAtomicFaddInsts) instead. NFC.
Differential Revision: https://reviews.llvm.org/D121289
Benoit Jacob [Wed, 9 Mar 2022 18:00:54 +0000 (10:00 -0800)]
Fix linking error, undefined class static constants.
Reviewed By: spupyrev
Differential Revision: https://reviews.llvm.org/D121293
Louis Dionne [Tue, 8 Mar 2022 19:48:16 +0000 (14:48 -0500)]
[libc++] Enable format_to and vformat_to tests even outside of Debug mode
These tests don't seem specific to the debug mode, so it makes sense to
run them even when the debug mode is disabled. When we run with the debug
mode enabled, we'll get the out-of-bounds checking that this test seems
to be concerned with.
Differential Revision: https://reviews.llvm.org/D121241
Valentin Clement [Wed, 9 Mar 2022 17:35:14 +0000 (18:35 +0100)]
[flang] Add OpenACC flag to bbc
Add `-fopenacc` flag to the `bbc` tool.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D121117
Vang Thao [Thu, 10 Feb 2022 17:16:09 +0000 (09:16 -0800)]
[AMDGPU] Add scheduler pass to rematerialize trivial defs
Add a new pass in the pre-ra AMDGPU scheduler to check if sinking trivially rematerializable defs that only has one use outside of the defining block will increase occupancy. If we can determine that occupancy can be increased, then rematerialize only the minimum amount of defs required to increase occupancy. Also re-schedule all regions that had occupancy matching the previous min occupancy using the new occupancy.
This is based off of the discussion in https://reviews.llvm.org/D117562.
The logic to determine the defs we should collect and determining if sinking would be beneficial is mostly the same. Main differences is that we are no longer limiting it to immediate defs and the def and use does not have to be part of a loop.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D119475
Valentin Clement [Wed, 9 Mar 2022 17:30:46 +0000 (18:30 +0100)]
[flang] Add OpenMP flag to bbc
Add `-fopenmp` flag to the `bbc` tool.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz, awarzynski
Differential Revision: https://reviews.llvm.org/D121118
Craig Topper [Wed, 9 Mar 2022 17:07:22 +0000 (09:07 -0800)]
[InstCombine] Preserve FMF in foldLogicOfFCmps.
This patch intersects the fast math flags from the two fcmps instead
of dropping them.
I poked at this a bunch with Alive2 for nnan and ninf flags and it seemed
to check out. With the other flags it told me "Couldn't prove the
correctness of the transformation". Not sure if I should just preserve
nnan and ninf?
Reviewed By: spatel, lebedev.ri
Differential Revision: https://reviews.llvm.org/D121243
Pavel Labath [Wed, 9 Mar 2022 17:12:28 +0000 (18:12 +0100)]
Revert "[lldb] Remove the global platform list"
It makes module dependencies loopier.
This reverts commits
49cffe3c7fab74252d4b6a073303c803dc1659f0 and
ffb9429b6f3c29ab4687b96fd85374924c98ad16.
Jay Foad [Wed, 9 Mar 2022 17:03:09 +0000 (17:03 +0000)]
[AMDGPU] Fix some confusing check prefixes. NFC.
Tahiti is SI/GFX6.
Kaveri and Hawaii are CI/GFX7.
Fiji is VI/GFX8.
Peter Klausler [Tue, 1 Mar 2022 19:50:49 +0000 (11:50 -0800)]
[flang] Fix extent computation in finalization
The code that computed the extent of a dimension of a
non-allocatable/non-automatic component array during
finalization had a reversed subtraction; fix, and
use variables to make the code a little more readable.
Differential Revision: https://reviews.llvm.org/D121163
Mark de Wever [Tue, 8 Mar 2022 16:34:33 +0000 (17:34 +0100)]
[libc++][NFC] Cleanups in <charconv>.
Based on review comments in D97705 applied some code cleanups in
<charconv>. The header now uses a more recent libc++ style.
Reviewed By: Quuxplusone, #libc, philnik
Differential Revision: https://reviews.llvm.org/D121223
Nico Weber [Wed, 9 Mar 2022 16:42:33 +0000 (11:42 -0500)]
[gn build] (manually) port
ffb9429b6f3c29ab
Dave Lee [Tue, 8 Feb 2022 23:34:04 +0000 (15:34 -0800)]
[lldb] Fix step-avoid-regexp logging
Ensure step-avoid-regexp logs are emitted in the case where the regex has no
capture groups.
Without this change, the log is printed only if the regex has at least one
capture group.
Another change is to the log message: the first capture group has been removed
from the message. There could be zero capture groups, and there could be two or
more capture groups.
Differential Revision: https://reviews.llvm.org/D119298
Dave Lee [Tue, 8 Mar 2022 22:17:08 +0000 (14:17 -0800)]
[lldb] Add SBType::IsAggregateType
Add `IsAggregateType` to the SB API.
I'd like to use this from tests, and there are numerous other `Is<X>Type`
predicates on `SBType`.
Differential Revision: https://reviews.llvm.org/D121252
Florian Hahn [Wed, 9 Mar 2022 16:04:44 +0000 (16:04 +0000)]
[LV] Do not consider instrs dead if used by phi that's not in plan.
Single value phis won't be modeled in VPlan. If the phi only gets used
outside the loop, the current code misses the fact that the incoming
value is not dead. Update the code to also look through such phis to
check for outside users.
Fixes #54266
Pavel Labath [Wed, 9 Mar 2022 15:52:51 +0000 (16:52 +0100)]
[lldb] Fix TestDebuggerAPI on windows (broken by D120810)
Andrzej Warzynski [Thu, 24 Feb 2022 17:34:27 +0000 (17:34 +0000)]
[flang][driver] Add support for -S and implement -c/-emit-obj
This patch adds support for:
* `-S` in Flang's compiler and frontend drivers,
and implements:
* `-emit-obj` in Flang's frontend driver and `-c` in Flang's compiler
driver (this is consistent with Clang).
(these options were already available before, but only as placeholders).
The semantics of these options in Clang and Flang are identical.
The `EmitObjAction` frontend action is renamed as `BackendAction`. This
new name more accurately reflects the fact that this action will
primarily run the code-gen/backend pipeline in LLVM. It also makes more
sense as an action implementing both `-emit-obj` and `-S` (originally,
it was just `-emit-obj`).
`tripleName` from FirContext.cpp is deleted and, when a target triple is
required, `mlir::LLVM::LLVMDialect::getTargetTripleAttrName()` is used
instead. In practice, this means that `fir.triple` is replaced with
`llvm.target_triple`. The former was effectively ignored. The latter is
used when lowering from the LLVM dialect in MLIR to LLVM IR (i.e. it's
embedded in the generated LLVM IR module). The driver can then re-use
it when configuring the backend. With this change, the LLVM IR files
generated by e.g. `tco` will from now on contain the correct target
triple.
The code-gen.f90 test is replaced with code-gen-x86.f90 and
code-gen-aarch64.f90. With 2 seperate files we can verify that
`--target` is correctly taken into account. LIT configuration is updated
to enable e.g.:
```
! REQUIRES: aarch64-registered-target
```
Differential Revision: https://reviews.llvm.org/D120568
Stanislav Gatev [Wed, 9 Mar 2022 15:38:51 +0000 (15:38 +0000)]
Revert "[clang][dataflow] Move dataflow testing support out of unittests"
This reverts commit
26bbde2612b2042c3a8a31aed7f45e065c3dd413.
Stanislav Gatev [Wed, 9 Mar 2022 13:17:52 +0000 (13:17 +0000)]
[clang][dataflow] Move dataflow testing support out of unittests
This enables tests out of clang/unittests/Analysis/FlowSensitive to
use the testing support utilities.
Reviewed-by: ymandel, gribozavr2
Differential Revision: https://reviews.llvm.org/D121285
Thomas Preud'homme [Wed, 9 Mar 2022 15:26:27 +0000 (15:26 +0000)]
[MachinePipeliner] Fix isPseduo typo.
Aaron Ballman [Wed, 9 Mar 2022 15:18:35 +0000 (10:18 -0500)]
Add the C and C++ Language Working Group meeting info
Pavel Labath [Fri, 25 Feb 2022 13:47:27 +0000 (14:47 +0100)]
[lldb] Remove the global platform list
This patch moves the platform creation and selection logic into the
per-debugger platform lists. I've tried to keep functional changes to a
minimum -- the main (only) observable difference in this change is that
APIs, which select a platform by name (e.g.,
Debugger::SetCurrentPlatform) will not automatically pick up a platform
associated with another debugger (or no debugger at all).
I've also added several tests for this functionality -- one of the
pleasant consequences of the debugger isolation is that it is now
possible to test the platform selection and creation logic.
This is a product of the discussion at
<https://discourse.llvm.org/t/multiple-platforms-with-the-same-name/59594>.
Differential Revision: https://reviews.llvm.org/D120810
Louis Dionne [Tue, 8 Mar 2022 20:13:24 +0000 (15:13 -0500)]
[libc++] Don't manually override NDEBUG in the dylib build
LIBCXX_ENABLE_ASSERTIONS does not have any relationship to the `assert`
macro -- it only controls assertions that are internal to the library.
Playing around with `NDEBUG` only muddies the picture further than it
already is.
Also, remove a failing assertion in the benchmarks. That assertion had
never been exercised because we defined `NDEBUG` manually, and it was
failing since we introduced the ability to generate a benchmark vector
with the Quicksort adversary ordering (which is obviously not sorted).
This was split off of https://llvm.org/D121123.
Differential Revision: https://reviews.llvm.org/D121244
Shraiysh Vaishay [Wed, 9 Mar 2022 09:33:17 +0000 (15:03 +0530)]
[mlir][OpenMP] Generating enums in accordance with the guidelines
This patch changes the enums generated from `OMP.td` for MLIR according
to the enum naming guidelines in LLVM Coding Standards.
This also helps the issues we had with `static` being a C++ keyword and
also a value for the schedule clause.
Enumerator naming guidelines: https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D120825
Simon Pilgrim [Wed, 9 Mar 2022 14:26:39 +0000 (14:26 +0000)]
[X86] Add shift identity select tests
Extension to D119654
fourdim [Wed, 9 Mar 2022 14:13:28 +0000 (22:13 +0800)]
[JITLink][RISCV] Refactor range checking and alignment checking
This patch refactors the range checking function to make it compatible with all relocation types and supports range checking for R_RISCV_BRANCH. Moreover, it refactors the alignment check functions.
Reviewed By: StephenFan
Differential Revision: https://reviews.llvm.org/D117946
Florian Hahn [Wed, 9 Mar 2022 14:09:23 +0000 (14:09 +0000)]
[PassManager] Another adjustment to account for different printing.
On some system, there's extra `class` specifiers when printing pass
manager types.
Timm Bäder [Mon, 21 Feb 2022 12:25:04 +0000 (13:25 +0100)]
[clang][sema] Enable first-class bool support for C2x
Implement N2395 for C2x.
This also covers adding "bool", which is part of N2394.
Differential Revision: https://reviews.llvm.org/D120244
Dmitry Vassiliev [Wed, 9 Mar 2022 14:03:26 +0000 (18:03 +0400)]
[llvm-dwarfdump] Avoid possible div-by-zero in debug output
Nikita Popov [Wed, 9 Mar 2022 13:45:24 +0000 (14:45 +0100)]
[Coroutines] Avoid pointer element access for resume function type
For switch ABI, the function type is always "void (%frame*)", so
just hardcode that rather than fetching it from a pointer element
type.
Pavel Labath [Wed, 2 Mar 2022 09:49:55 +0000 (10:49 +0100)]
[lldb] Don't print *trailing* nuls in char arrays
Embedded nul characters are still printed, and they don't terminate the
string. See also D111634.
Differential Revision: https://reviews.llvm.org/D120803
Pavel Labath [Tue, 22 Feb 2022 13:25:39 +0000 (14:25 +0100)]
[lldb/driver] Fix SIGTSTP handling
Our SIGTSTP handler was working, but that was mostly accidental.
The reason it worked is because lldb is multithreaded for most of its
lifetime and the OS is reasonably fast at responding to signals. So,
what happened was that the kill(SIGTSTP) which we sent from inside the
handler was delivered to another thread while the handler was still set
to SIG_DFL (which then correctly put the entire process to sleep).
Sometimes it happened that the other thread got the second signal after
the first thread had already restored the handler, in which case the
signal handler would run again, and it would again attempt to send the
SIGTSTP signal back to itself.
Normally it didn't take many iterations for the signal to be delivered
quickly enough. However, if you were unlucky (or were playing around
with pexpect) you could get SIGTSTP while lldb was single-threaded, and
in that case, lldb would go into an endless loop because the second
SIGTSTP could only be handled on the main thread, and only after the
handler for the first signal returned (and re-installed itself). In that
situation the handler would keep re-sending the signal to itself.
This patch fixes the issue by implementing the handler the way it
supposed to be done:
- before sending the second SIGTSTP, we unblock the signal (it gets
automatically blocked upon entering the handler)
- we use raise to send the signal, which makes sure it gets delivered to
the thread which is running the handler
This also means we don't need the SIGCONT handler, as our TSTP handler
resumes right after the entire process is continued, and we can do the
required work there.
I also include a test case for the SIGTSTP flow. It uses pexpect, but it
includes a couple of extra twists. Specifically, I needed to create an
extra process on top of lldb, which will run lldb in a separate process
group and simulate the role of the shell. This is needed because SIGTSTP
is not effective on a session leader (the signal gets delivered, but it
does not cause a stop) -- normally there isn't anyone to notice the
stop.
Differential Revision: https://reviews.llvm.org/D120320
Pavel Labath [Thu, 3 Mar 2022 11:32:52 +0000 (12:32 +0100)]
[lldb] Warn when we fail to find dwo/dwp files
This ensures that the user is aware that many commands will not work
correctly.
We print the warning only once (per module) to avoid spamming the user
with potentially thousands of error messages.
Differential Revision: https://reviews.llvm.org/D120892
Florian Hahn [Wed, 9 Mar 2022 13:20:15 +0000 (13:20 +0000)]
[PassManager] Adjust check lines to account for different printing.
Relax some checks to account for types being printed differently on
different platforms, surfaced by different buildbots.
Florian Hahn [Wed, 9 Mar 2022 13:01:09 +0000 (13:01 +0000)]
[PassManager] Add pretty stack entries before P->run() call.
This patch adds PrettyStackEntries before running passes. The entries
include the pass name and the IR unit the pass runs on.
The information is used the print additional information when a pass
crashes, including the name and a reference to the IR unit on which it
crashed. This is similar to the behavior of the legacy pass manager.
The improved stack trace now includes:
Stack dump:
0. Program arguments: bin/opt -loop-vectorize -force-vector-width=4 crash.ll
1. Running pass 'ModuleToFunctionPassAdaptor' on module 'crash.ll'
2. Running pass 'LoopVectorizePass' on function '@a'
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D120993
Aaron Ballman [Wed, 9 Mar 2022 12:57:30 +0000 (07:57 -0500)]
Update my office hours
Adds "frontend attributes" to the list of things to come talk about,
removes the extra timezone information to hopefully reduce confusion
about daylight savings time.
Simon Pilgrim [Wed, 9 Mar 2022 12:02:37 +0000 (12:02 +0000)]
[IR] MatrixBuilder - CreateIndexAssumption - fix unused variable warning on NDEBUG builds
Vladislav Khmelevsky [Tue, 8 Mar 2022 23:16:13 +0000 (02:16 +0300)]
[BOLT] Move some of the tests to common directory
Some of the tests are not x86-specific, move them to common directory.
Differential Revision: https://reviews.llvm.org/D121261
Krasimir Georgiev [Wed, 9 Mar 2022 11:39:09 +0000 (12:39 +0100)]
[lldb] Fix -Wformat warning after
5a27b99825a5ba3a7a2eec3d35aea381a3ba9a31
No functional changes intended.
Simon Pilgrim [Wed, 9 Mar 2022 11:21:38 +0000 (11:21 +0000)]
[clang] ScalarExprEmitter::VisitCastExpr - use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointers are always dereferenced, so assert the cast is correct instead of returning nullptr
Simon Pilgrim [Wed, 9 Mar 2022 10:51:43 +0000 (10:51 +0000)]
[clang] Environment::createValueUnlessSelfReferential - use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointer is always dereferenced, so assert the cast is correct instead of returning nullptr
Simon Pilgrim [Wed, 9 Mar 2022 10:48:45 +0000 (10:48 +0000)]
[X86] Add common check prefixes to vector-bitreverse.ll
Simon Pilgrim [Wed, 9 Mar 2022 10:47:26 +0000 (10:47 +0000)]
[clang] Sema::ActOnModuleImport - remove superfluous nullptr test
Mod has already been dereferenced
Alexey Lapshin [Wed, 9 Mar 2022 11:25:10 +0000 (14:25 +0300)]
Fix for buildbot failure: https://lab.llvm.org/buildbot#builders/110/builds/11051
after https://reviews.llvm.org/D121005
Chuanqi Xu [Wed, 9 Mar 2022 11:05:41 +0000 (19:05 +0800)]
[NFC] [C++20] [Modules] Add test to show private module fragment is not allowed in partition unit
Uday Bondhugula [Wed, 9 Mar 2022 06:25:49 +0000 (11:55 +0530)]
NFC. Clean up memref utils library
NFC. Clean up memref utils library. This library had a single function
that was completely misplaced. MemRefUtils is expected to be (also per
its comment) a library providing analysis/transforms utilities on memref
dialect ops or memref types. However, in reality it had a helper that
was depended upon by the MemRef dialect, i.e., it was a helper for the
dialect ops library and couldn't contain anything that itself depends on
the MemRef dialect. Move the single method to the memref dialect that
will now allow actual utilities depending on the memref dialect to be
placed in it.
Put findDealloc in the `memref` namespace. This is a pure move.
Differential Revision: https://reviews.llvm.org/D121273
Andrzej Warzynski [Thu, 3 Mar 2022 13:25:09 +0000 (13:25 +0000)]
[flang] Remove 'using namespace mlir;` from header files
Currently, CGOps.h and FIROps.h contain `using namespace mlir;`. Every
file that includes one of these header files (directly and transitively)
will have the MLIR namespace enabled. With name-clashes within
sub-projects (LLVM and MLIR, MLIR and Flang), this is not desired. Also,
it is not possible to "un-use" a namespace once it is "used". Instead,
we should try to limit `using namespace` to implementation files (i.e.
*.cpp).
This patch removes `using namespace mlir;` from header files and adjusts
other files accordingly. In header and TableGen files, extra namespace
qualifier is added when referring to symbols defined in MLIR. Similar
approach is adopted in source files that didn't require many changes. In
files that would require a lot of changes, `using namespace mlir;` is
added instead.
Differential Revision: https://reviews.llvm.org/D120897
Nikita Popov [Fri, 4 Mar 2022 12:21:45 +0000 (13:21 +0100)]
[CoroFrame] Avoid pointer element type access for swifterror
These must have pointer-to-pointer type, and with opaque pointers
we don't care about the specific pointer type anymore.
LLVM GN Syncbot [Wed, 9 Mar 2022 10:05:09 +0000 (10:05 +0000)]
[gn build] Port
2dc4a80ec026
Alexey Lapshin [Thu, 3 Mar 2022 13:23:42 +0000 (16:23 +0300)]
[objcopy][NFC] Move NameOrPattern::create() into CommonConfig.h
While moving objcopy into separate library(D88827), NameOrPattern::create()
was mistakenly placed into ObjcopyOptions.cpp. This patch moves
the NameOrPattern::create() into CommonConfig.h. Additionally it adds
test for using NameOrPattern.
Differential Revision: https://reviews.llvm.org/D121005
Stanislav Gatev [Wed, 9 Mar 2022 09:51:03 +0000 (09:51 +0000)]
Revert "[clang][dataflow] Add analysis that detects unsafe accesses to optionals"
This reverts commit
ce205cffdfa0f16ce9441ba46fa43e23cecf8be7.
Nikita Popov [Wed, 9 Mar 2022 09:43:59 +0000 (10:43 +0100)]
[IR][IPSCCP] Treat different function type as address taken (PR54258)
Without opaque pointers, this code currently treats a call through
a bitcast as the function being address taken, and IPSCCP relies
on this for correctness. Match the same behavior under opaque
pointers by checking that the function types are the same.
Fixes https://github.com/llvm/llvm-project/issues/54258.
Stanislav Gatev [Tue, 8 Mar 2022 09:55:00 +0000 (09:55 +0000)]
[clang][dataflow] Add analysis that detects unsafe accesses to optionals
Adds a dataflow analysis that detects unsafe accesses to values of type
`std::optional`, `absl::optional`, or `base::Optional`.
Reviewed-by: ymandel, xazax.hun
Differential Revision: https://reviews.llvm.org/D121197
David Spickett [Tue, 8 Mar 2022 16:51:36 +0000 (16:51 +0000)]
[libcxx][CI] Use temporary clang-13 bots for Arm/AArch64
This is a stop gap until I am able to update the usual bots
to clang-13.
Differential Revision: https://reviews.llvm.org/D121224
Jean Perier [Wed, 9 Mar 2022 08:41:55 +0000 (09:41 +0100)]
[flang] Use unix logical representation for fir.logical
The front-end and the runtime are currently using the unix logical
representation, but lowering was not. These inconsistencies could
caused issues.
The only place that defines what the logical representation is in
lowering is the translation from FIR to LLVM (FIR is agnostic to the
actual representation). More precisely, the LLVM implementation of
`fir.convert` between `i1` and `fir.logcial` is what defines the
representation:
- `fir.convert` from `i1` to `fir.logical` defines the `.true.` and `.false.`
canonical representations
- `fir.convert` from `fir.logical` to `i1` decides what the test for
truth is.
Unix representation is:
- .true. canonical integer representation is 1
- .false. canonical integer representation is 0
- the test for truth is "integer representation != 0"
For the record, the previous representation that was used was in
codegen was:
- .true. canonical integer representation is -1 (all bits 1)
- .false. canonical integer representation is 0
- the test for truth is "integer representation lowest bit == 1"
Differential Revision: https://reviews.llvm.org/D121200
Nikita Popov [Mon, 7 Mar 2022 11:37:55 +0000 (12:37 +0100)]
[SCEV] Verify all IR -> SCEV mappings
This extends SCEV verification to check not only backedge-taken
counts, but all entries in the IR -> SCEV cache. The restrictions
are the same as for the BECount case, i.e. we ignore expressions
based on undef, we only diagnose constant deltas (there are way
too many false positives otherwise) and we limit to reachable code.
Differential Revision: https://reviews.llvm.org/D121104
Nikita Popov [Fri, 4 Mar 2022 11:00:04 +0000 (12:00 +0100)]
[Attributor] Use byval type instead of pointer element type
For compatibility with opaque pointers, use the byval type rather
than the pointer element type.
Differential Review: https://reviews.llvm.org/D120983
Weining Lu [Wed, 9 Mar 2022 07:54:24 +0000 (15:54 +0800)]
[LoongArch] Add basic support to AsmParser
This patch adds basic support to AsmParser which can handle basic
instructions with register or immediate operands. With the addition of
the parser, now it's possible to test instructions encoding with `llvm-mc`.
Disassembler will be added later and then we can do `round-trip` test.
Reviewed By: xen0n, MaskRay, myhsu
Differential Revision: https://reviews.llvm.org/D120476
Martin Storsjö [Fri, 4 Mar 2022 08:53:32 +0000 (10:53 +0200)]
[libcxx] [test] XFAIL the get/put long_double_ru_RU tests on Glibc < 2.27
Those older versions used a different monetary decimal separator.
To avoid unnecessary churn to support that, just XFAIL the test
on those older versions. (Up until
df1e43c496b43e998f66c610b0e15a0951f316b3, the whole test was XFAILed
on all versions of glibc.)
Differential Revision: https://reviews.llvm.org/D120979
Martin Storsjö [Wed, 19 Jan 2022 11:07:13 +0000 (11:07 +0000)]
[libcxx] [test] Fix the classic_table test on Windows
On Windows, constants like F::alpha and F::print are bitmasks
consisting of multiple bits (e.g. F::alpha consisting of both the
bits F::upper and F::lower). In such a case, we can't check that
all the bits from all the expected constants are set. Instead,
check that (p[i] & mask) != 0 returns the expected value.
Differential Revision: https://reviews.llvm.org/D120802
Jonas Devlieghere [Wed, 9 Mar 2022 04:31:20 +0000 (20:31 -0800)]
[lldb] Add --exists flag to `settings set`
Add a --exists/-e flag to `settings set` that sets the setting if it
exists, but doesn't print an error otherwise. This is useful for example
when setting options in your ~/.lldbinit that might not exist in older
versions of lldb.
Differential revision: https://reviews.llvm.org/D121155
Venkata Ramanaiah Nalamothu [Mon, 7 Mar 2022 19:39:18 +0000 (01:09 +0530)]
[AMDGPU] Move call clobbered return address registers s[30:31] to callee saved range
Currently the return address ABI registers s[30:31], which fall in the call
clobbered register range, are added as a live-in on the function entry to
preserve its value when we have calls so that it gets saved and restored
around the calls.
But the DWARF unwind information (CFI) needs to track where the return address
resides in a frame and the above approach makes it difficult to track the
return address when the CFI information is emitted during the frame lowering,
due to the involvment of understanding the control flow.
This patch moves the return address ABI registers s[30:31] into callee saved
registers range and stops adding live-in for return address registers, so that
the CFI machinery will know where the return address resides when CSR
save/restore happen during the frame lowering.
And doing the above poses an issue that now the return instruction uses undefined
register `sgpr30_sgpr31`. This is resolved by hiding the return address register
use by the return instruction through the `SI_RETURN` pseudo instruction, which
doesn't take any input operands, until the `SI_RETURN` pseudo gets lowered to the
`S_SETPC_B64_return` during the `expandPostRAPseudo()`.
As an added benefit, this patch simplifies overall return instruction handling.
Note: The AMDGPU CFI changes are there only in the downstream code and another
version of this patch will be posted for review for the downstream code.
Reviewed By: arsenm, ronlieb
Differential Revision: https://reviews.llvm.org/D114652
Yevgeny Rouban [Wed, 9 Mar 2022 05:59:49 +0000 (12:59 +0700)]
[clangd] Make dexp command line options sticky
Preparing for the cl::opt reset fix proposed on D115433 this
patch fixes the dexp tool to preserve its three command line
options (IndexLocation, ExecCommand, ProjectRoot) from reset
that is done before parsing query options.
Tags: #clang