Matthias Springer [Wed, 4 Aug 2021 13:48:34 +0000 (22:48 +0900)]
[mlir] Fix gcc-5 build in ViewOpGraph.cpp
Differential Revision: https://reviews.llvm.org/D107458
Matthias Springer [Wed, 4 Aug 2021 13:11:27 +0000 (22:11 +0900)]
[flang] Add missing FileSystem.h
This file was previously included transitively via `mlir/Transforms/Passes.h`, but the include has been removed from that file.
Differential Revision: https://reviews.llvm.org/D107455
David Green [Wed, 4 Aug 2021 13:21:32 +0000 (14:21 +0100)]
[RDA] Attempt to make RDA subreg aware
This attempts to make more of RDA aware of potentially overlapping
subregisters. Some of this was already in place, with it iterating
through MCRegUnitIterators. This also replaces calls to
LiveRegs.contains(..) with !LiveRegs.available(..), and updates the
isValidRegUseOf and isValidRegDefOf to search subregs.
Differential Revision: https://reviews.llvm.org/D107351
David Green [Wed, 4 Aug 2021 10:07:00 +0000 (11:07 +0100)]
[ARM] Test showing incorrect codegen when subreg liveness is enabled. NFC
Matthias Springer [Wed, 4 Aug 2021 12:37:10 +0000 (21:37 +0900)]
[mlir] Include llvm/Support/Debug.h in Transforms/Passes.h
There are many downstream users of llvm::dbgs, which is defined in Debug.h. Before D106342, many users included that dependency transitively via the now deleted ViewRegionGraph.h. Adding it back to Transforms/Passes.h for convenience.
Differential Revision: https://reviews.llvm.org/D107451
Simon Pilgrim [Wed, 4 Aug 2021 12:07:35 +0000 (13:07 +0100)]
[X86] Rename X86 tuning feature flag FeatureHasFastGather -> FeatureFastGather
Match the naming style used by the other 'FeatureFast/FeatureSlow' tuning flags.
Simon Pilgrim [Wed, 4 Aug 2021 11:41:34 +0000 (12:41 +0100)]
[X86] Move FeatureFastBEXTR from bdver2 features to tuning
Noticed while looking at the feature flag renaming suggested in D107370
Muhammad Omair Javaid [Wed, 4 Aug 2021 11:53:07 +0000 (16:53 +0500)]
[LLDB] Skip flaky tests on Arm/AArch64 Linux bots
Following LLDB tests fail randomly on LLDB Arm/AArch64 Linux buildbots.
We still not have a reliable solution for these tests to pass
consistently. I am marking them skipped for now.
TestBreakpointCallbackCommandSource.py
TestIOHandlerResize.py
TestEditline.py
TestGuiViewLarge.py
TestGuiExpandThreadsTree.py
TestGuiBreakpoints.py
Dmitry Vyukov [Tue, 3 Aug 2021 15:18:06 +0000 (17:18 +0200)]
tsan: don't use spinning in __cxa_guard_acquire/pthread_once
Currently we use passive spinning with internal_sched_yield to wait
in __cxa_guard_acquire/pthread_once. Passive spinning tends to degrade
ungracefully under high load. Use FutexWait/Wake instead.
Depends on D107359.
Reviewed By: vitalybuka, melver
Differential Revision: https://reviews.llvm.org/D107360
Jan Svoboda [Wed, 4 Aug 2021 11:47:29 +0000 (13:47 +0200)]
[clang][deps] Substitute clang-scan-deps executable in lit tests
The lit tests for `clang-scan-deps` invoke the tool without going through the substitution system. While the test runner correctly picks up the `clang-scan-deps` binary from the build directory, it doesn't print its absolute path. When copying the invocations when reproducing test failures, this can result in `command not found: clang-scan-deps` errors or worse yet: pick up the system `clang-scan-deps`. This patch adds new local `%clang-scan-deps` substitution.
Reviewed By: lxfind, dblaikie
Differential Revision: https://reviews.llvm.org/D107155
Dmitry Vyukov [Wed, 4 Aug 2021 11:29:38 +0000 (13:29 +0200)]
tsan: refactor guard_acquire/release
Introduce named consts for magic values we use.
Differential Revision: https://reviews.llvm.org/D107445
Jan Svoboda [Wed, 4 Aug 2021 11:27:25 +0000 (13:27 +0200)]
[clang][cli] Expose -fno-cxx-modules in cc1
For some use-cases, it might be useful to be able to turn off modules for C++ in `-cc1`. (The feature is implied by `-std=C++20`.)
This patch exposes the `-fno-cxx-modules` option in `-cc1`.
Reviewed By: arphaman
Differential Revision: https://reviews.llvm.org/D106864
Matthias Springer [Wed, 4 Aug 2021 11:20:48 +0000 (20:20 +0900)]
[mlir] Support drawing control-flow graphs in ViewOpGraph.cpp
* Add new pass option `print-data-flow-edges`, default value `true`.
* Add new pass option `print-control-flow-edges`, default value `false`.
* Remove `PrintCFGPass`. Same functionality now provided by
`PrintOpPass`.
Differential Revision: https://reviews.llvm.org/D106342
Dmitry Vyukov [Tue, 3 Aug 2021 14:30:08 +0000 (16:30 +0200)]
tsan: unify __cxa_guard_acquire and pthread_once implementations
Currently we effectively duplicate "once" logic for __cxa_guard_acquire
and pthread_once. Unify the implementations.
This is not a no-op change:
- constants used for pthread_once are changed to match __cxa_guard_acquire
(__cxa_guard_acquire constants are tied to ABI, but it does not seem
to be the case for pthread_once)
- pthread_once now also uses PotentiallyBlockingRegion annotations
- __cxa_guard_acquire checks thr->in_ignored_lib to skip user synchronization
It's unclear if these 2 differences are intentional or a mere sloppy inconsistency.
Since all tests still pass, let's assume the latter.
Reviewed By: vitalybuka, melver
Differential Revision: https://reviews.llvm.org/D107359
Dmitry Vyukov [Tue, 3 Aug 2021 17:01:38 +0000 (19:01 +0200)]
tsan: use DCHECK instead of CHECK in atomic functions
Atomic functions are semi-hot in profiles.
The CHECKs verify values passed by compiler
and they never fired, so replace them with DCHECKs.
Reviewed By: vitalybuka, melver
Differential Revision: https://reviews.llvm.org/D107373
Dmitry Vyukov [Tue, 3 Aug 2021 16:42:52 +0000 (18:42 +0200)]
tsan: minor MetaMap tweaks
1. Add some comments.
2. Use kInvalidStackID instead of literal 0.
3. Add more LIKELY/UNLIKELY.
Reviewed By: vitalybuka, melver
Differential Revision: https://reviews.llvm.org/D107371
David Spickett [Wed, 4 Aug 2021 10:26:46 +0000 (10:26 +0000)]
[llvm][MC] Disable cfi-version test for Windows on Arm
Like Windows on x86-64, Windows on arm64 uses structured
exception handling, so we don't emit .debug_frame.
See:
https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling?view=msvc-160
Reviewed By: ostannard
Differential Revision: https://reviews.llvm.org/D107440
Tim Northover [Wed, 4 Aug 2021 11:09:51 +0000 (12:09 +0100)]
X86: add test for realignment fix committed earlier.
Forgot "git add" for a new file.
Jaroslav Sevcik [Wed, 4 Aug 2021 09:51:16 +0000 (11:51 +0200)]
Reland "[lldb/DWARF] Only match mangled name in full-name function lookup (with accelerators)"
Summary:
In the spirit of https://reviews.llvm.org/D70846, we only return functions with
matching mangled name from Apple/DebugNamesDWARFIndex::GetFunction if
eFunctionNameTypeFull is requested.
This speeds up lookup in the presence of large amount of class methods of the
same name (a typical examples would be constructors of templates with many
instantiations or overloaded operators).
Reviewers: labath, teemperor
Reviewed By: labath, teemperor
Subscribers: aprantl, arphaman, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73191
Matthias Springer [Wed, 4 Aug 2021 10:19:27 +0000 (19:19 +0900)]
[mlir] Fix CMake linker rules for ViewOpGraph.cpp
Differential Revision: https://reviews.llvm.org/D107439
Serge Pavlov [Wed, 4 Aug 2021 10:18:15 +0000 (17:18 +0700)]
Revert "Introduce intrinsic llvm.isnan"
This reverts commit
16ff91ebccda1128c43ff3cee104e2c603569fb2.
Several errors were reported mainly test-suite execution time. Reverted
for investigation.
Simon Pilgrim [Wed, 4 Aug 2021 10:16:23 +0000 (11:16 +0100)]
[X86] Split Subtarget ISA / Security / Tuning Feature Flags Definitions. NFC
Our list of slow/fast tuning feature flags has become pretty extensive and is randomly interleaved with ISA and Security (Retpoline etc.) flags, not even based on when the ISAs/flags were introduced, making it tricky to locate them. Plus we started treating tuning flags separately some time ago, so this patch tries to group the flags to match.
I've left them mostly in the same order within each group - I'm happy to rearrange them further if there are specific ISA or Tuning flags that you think should be kept closer together.
Differential Revision: https://reviews.llvm.org/D107370
Kim-Anh Tran [Wed, 4 Aug 2021 07:16:10 +0000 (09:16 +0200)]
[lldb] Fix lookup of .debug_loclists with split-dwarf
This patch fixes the lookup of locations in
.debug_loclists, if they are split in a .dwp file.
Mainly, we need to consider the cu index offsets.
Reviewed By: jankratochvil
Differential Revision: https://reviews.llvm.org/D107161
David Spickett [Tue, 3 Aug 2021 15:16:41 +0000 (15:16 +0000)]
[llvm][ExecutionEngine] Don't try to run tests on ARM64/Windows on Arm
We use CMAKE_SYSTEM_PROCESSOR to set the host_arch lit feature.
This is going to be the same value as CMAKE_HOST_SYSTEM_PROCESSOR,
which on windows is set to the value of the PROCESSOR_ARCHITECTURE
environment variable.
https://cmake.org/cmake/help/latest/variable/CMAKE_HOST_SYSTEM_PROCESSOR.html#cmake-host-system-processor
On Windows on Arm this is "ARM64", not "AArch64" as we currently
look for.
https://docs.microsoft.com/en-us/windows/win32/winprog64/wow64-implementation-details#environment-variables
Add ARM64 to the unsupported list.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D107361
Raphael Isemann [Wed, 4 Aug 2021 08:59:53 +0000 (10:59 +0200)]
[lldb] Partly revert "Allow range-based for loops over DWARFDIE's children"
As pointed out in D107434 by Walter, D103172 also changed two for loops that
were actually not just iterating over some DIEs but also using the iteration
variable later on for some other things. This patch reverts the respective
faulty parts of D103172.
Tim Northover [Wed, 4 Aug 2021 08:24:39 +0000 (09:24 +0100)]
X86: fix frame offset calculation with mandatory tail calls
If there's a region of the stack reserved for potential tail call arguments
(only the case when we guarantee tail calls will be honoured), this is right
next to the incoming stored return address, not necessarily next to the
callee-saved area, so combining the two into a single figure leads to incorrect
offsets in some edge cases.
Serge Pavlov [Wed, 4 Aug 2021 08:27:49 +0000 (15:27 +0700)]
Introduce intrinsic llvm.isnan
Clang has builtin function '__builtin_isnan', which implements C
library function 'isnan'. This function now is implemented entirely in
clang codegen, which expands the function into set of IR operations.
There are three mechanisms by which the expansion can be made.
* The most common mechanism is using an unordered comparison made by
instruction 'fcmp uno'. This simple solution is target-independent
and works well in most cases. It however is not suitable if floating
point exceptions are tracked. Corresponding IEEE 754 operation and C
function must never raise FP exception, even if the argument is a
signaling NaN. Compare instructions usually does not have such
property, they raise 'invalid' exception in such case. So this
mechanism is unsuitable when exception behavior is strict. In
particular it could result in unexpected trapping if argument is SNaN.
* Another solution was implemented in https://reviews.llvm.org/D95948.
It is used in the cases when raising FP exceptions by 'isnan' is not
allowed. This solution implements 'isnan' using integer operations.
It solves the problem of exceptions, but offers one solution for all
targets, however some can do the check in more efficient way.
* Solution implemented by https://reviews.llvm.org/D96568 introduced a
hook 'clang::TargetCodeGenInfo::testFPKind', which injects target
specific code into IR. Now only SystemZ implements this hook and it
generates a call to target specific intrinsic function.
Although these mechanisms allow to implement 'isnan' with enough
efficiency, expanding 'isnan' in clang has drawbacks:
* The operation 'isnan' is hidden behind generic integer operations or
target-specific intrinsics. It complicates analysis and can prevent
some optimizations.
* IR can be created by tools other than clang, in this case treatment
of 'isnan' has to be duplicated in that tool.
Another issue with the current implementation of 'isnan' comes from the
use of options '-ffast-math' or '-fno-honor-nans'. If such option is
specified, 'fcmp uno' may be optimized to 'false'. It is valid
optimization in general, but it results in 'isnan' always returning
'false'. For example, in some libc++ implementations the following code
returns 'false':
std::isnan(std::numeric_limits<float>::quiet_NaN())
The options '-ffast-math' and '-fno-honor-nans' imply that FP operation
operands are never NaNs. This assumption however should not be applied
to the functions that check FP number properties, including 'isnan'. If
such function returns expected result instead of actually making
checks, it becomes useless in many cases. The option '-ffast-math' is
often used for performance critical code, as it can speed up execution
by the expense of manual treatment of corner cases. If 'isnan' returns
assumed result, a user cannot use it in the manual treatment of NaNs
and has to invent replacements, like making the check using integer
operations. There is a discussion in https://reviews.llvm.org/D18513#387418,
which also expresses the opinion, that limitations imposed by
'-ffast-math' should be applied only to 'math' functions but not to
'tests'.
To overcome these drawbacks, this change introduces a new IR intrinsic
function 'llvm.isnan', which realizes the check as specified by IEEE-754
and C standards in target-agnostic way. During IR transformations it
does not undergo undesirable optimizations. It reaches instruction
selection, where is lowered in target-dependent way. The lowering can
vary depending on options like '-ffast-math' or '-ffp-model' so the
resulting code satisfies requested semantics.
Differential Revision: https://reviews.llvm.org/D104854
Andre Vieira [Wed, 4 Aug 2021 08:17:12 +0000 (09:17 +0100)]
[libc] Fix Memory Benchmarks code after rename
Differential Revision: https://reviews.llvm.org/D107376
Sjoerd Meijer [Tue, 3 Aug 2021 19:42:09 +0000 (20:42 +0100)]
[FuncSpec] Support specialising recursive functions
This adds support for specialising recursive functions. For example:
int Global = 1;
void recursiveFunc(int *arg) {
if (*arg < 4) {
print(*arg);
recursiveFunc(*arg + 1);
}
}
void main() {
recursiveFunc(&Global);
}
After 3 iterations of function specialisation, followed by inlining of the
specialised versions of recursiveFunc, the main function looks like this:
void main() {
print(1);
print(2);
print(3);
}
To support this, the following has been added:
- Update the solver and state of the new specialised functions,
- An optimisation to propagate constant stack values after each iteration of
function specialisation, which is necessary for the next iteration to
recognise the constant values and trigger.
Specialising recursive functions is (at the moment) controlled by option
-func-specialization-max-iters and is opt-in for compile-time reasons. I.e.,
the default is -func-specialization-max-iters=1, but for the example above we
would need to use -func-specialization-max-iters=3. Future work is to see if we
can increase the default, or improve the cost-model/heuristics to control
compile-times.
Differential Revision: https://reviews.llvm.org/D106426
Senran Zhang [Wed, 4 Aug 2021 06:59:09 +0000 (23:59 -0700)]
[Support] Initialize common options in `getRegisteredOptions`
This allows users accessing options in libSupport before invoking
`cl::ParseCommandLineOptions`, and also matches the behavior before
D105959.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D106334
Adrian Kuegel [Wed, 4 Aug 2021 06:49:30 +0000 (08:49 +0200)]
[mlir][Bazel] Adjust BUILD.bazel file.
The dependency is needed after
1b00b94ffc2d60
Differential Revision: https://reviews.llvm.org/D107426
Esme-Yi [Wed, 4 Aug 2021 06:28:26 +0000 (06:28 +0000)]
[llvm-readobj][XCOFF] dump the string table only if the size is bigger than 4.
Stephen Neuendorffer [Tue, 1 Jun 2021 05:32:49 +0000 (22:32 -0700)]
[mlir] Handle cases where transfer_read should turn into a scalar load
The existing vector transforms reduce the dimension of transfer_read
ops. However, beyond a certain point, the vector op actually has
to be reduced to a scalar load, since we can't load a zero-dimension
vector. This handles this case.
Note that in the longer term, it may be preferaby to support
zero-dimension vectors. see
https://llvm.discourse.group/t/should-we-have-0-d-vectors/3097.
Differential Revision: https://reviews.llvm.org/D103432
hsmahesha [Wed, 4 Aug 2021 04:08:55 +0000 (09:38 +0530)]
[AMDGPU] Ignore call graph node which does not have function info.
While collecting reachable callees (from kernels), ignore call graph node which
does not have associated function or associated function is not a definition.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D107329
Senran Zhang [Wed, 4 Aug 2021 04:52:14 +0000 (21:52 -0700)]
[NFC][ConstantFold] Check getAggregateElement before getSplatValue call
Constant::getSplatValue has O(N) time complexity in the worst case,
where N is the # of elements in a vector. So we call
Constant::getAggregateElement first and return earlier if possible to
avoid unnecessary getSplatValue calls.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D107252
Matthias Springer [Wed, 4 Aug 2021 04:10:42 +0000 (13:10 +0900)]
[mlir] Fix broken build in pass_manager.py
This test ensures that an error is generated from the Python side when running a module pass on a function. The test used to instantiate ViewOpGraph, however, this pass was changed into a general "any op" pass in D106253. Therefore, a different pass must be used in this test.
Differential Revision: https://reviews.llvm.org/D107424
Heejin Ahn [Mon, 2 Aug 2021 01:30:18 +0000 (18:30 -0700)]
[WebAssembly] Misc. cosmetic changes in EH (NFC)
- Rename `wasm.catch` intrinsic to `wasm.catch.exn`, because we are
planning to add a separate `wasm.catch.longjmp` intrinsic which
returns two values.
- Rename several variables
- Remove an unnecessary parameter from `canLongjmp` and `isEmAsmCall`
from LowerEmscriptenEHSjLj pass
- Add `-verify-machineinstrs` in a test for a safety measure
- Add more comments + fix some errors in comments
- Replace `std::vector` with `SmallVector` for cases likely with small
number of elements
- Renamed `EnableEH`/`EnableSjLj` to `EnableEmEH`/`EnableEmSjLj`: We are
soon going to add `EnableWasmSjLj`, so this makes the distincion
clearer
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D107405
Arthur Eubanks [Mon, 2 Aug 2021 22:33:07 +0000 (15:33 -0700)]
[MC][CodeGen] Emit constant pools earlier
Previously we would emit constant pool entries for ldr inline asm at the
very end of AsmPrinter::doFinalization(). However, if we're emitting
dwarf aranges, that would end all sections with aranges. Then if we have
constant pool entries to be emitted in those same sections, we'd hit an
assert that the section has already been ended.
We want to emit constant pool entries before emitting dwarf aranges.
This patch splits out arm32/64's constant pool entry emission into its
own MCTargetStreamer virtual method.
Fixes PR51208
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D107314
Matthias Springer [Wed, 4 Aug 2021 02:57:44 +0000 (11:57 +0900)]
[mlir] Truncate/skip long strings in ViewOpGraph.cpp
* New pass option `max-label-len`: Truncate attributes/result types that have more #chars.
* New pass option `print-attrs`: Activate/deactivate rendering of attributes.
* New pass option `printResultTypes`: Activate/deactivate rendering of result types.
Differential Revision: https://reviews.llvm.org/D106337
Vitaly Buka [Tue, 3 Aug 2021 20:14:52 +0000 (13:14 -0700)]
[llvm-readobj][XCOFF] Warn about invalid offset
Followup for D105522
Differential Revision: https://reviews.llvm.org/D107398
Jacob Hegna [Wed, 4 Aug 2021 03:08:02 +0000 (03:08 +0000)]
[MLGO] Update the current model url for the Oz inliner model.
Matthias Springer [Wed, 4 Aug 2021 02:47:34 +0000 (11:47 +0900)]
[mlir] Improve Graphviz visualization in PrintOpPass
* Visualize blocks and regions as subgraphs.
* Generate DOT file directly instead of using `GraphTraits`. `GraphTraits` does not support subgraphs.
Differential Revision: https://reviews.llvm.org/D106253
Christian Kandeler [Wed, 4 Aug 2021 02:53:01 +0000 (19:53 -0700)]
[clangd] Add new semantic token modifier "virtual"
This is needed for clients that want to highlight virtual functions
differently.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D107145
Aart Bik [Wed, 4 Aug 2021 01:26:28 +0000 (18:26 -0700)]
[mlir][sparse] add example to attribute doc
Also makes style consistent with the "surrounding"
text that appears on one webpage in MLIR doc
Reviewed By: grosul1
Differential Revision: https://reviews.llvm.org/D107418
Vitaly Buka [Tue, 3 Aug 2021 07:08:34 +0000 (00:08 -0700)]
[msan] Add bsearch interceptor
Similar to qsort, bsearch can be called from non-instrumented
code of glibc. When it happends tls for arguments can be in uninitialized
state.
Unlike to qsort, bsearch does not move data, so we don't need to
check or initialize searched memory or key. Intrumented comparator will
do that on it's own.
Differential Revision: https://reviews.llvm.org/D107387
Jessica Paquette [Wed, 4 Aug 2021 00:27:37 +0000 (17:27 -0700)]
[AArch64][GlobalISel] Widen G_SELECT before clamping it
This allows us to handle the s88 G_SELECTS:
https://godbolt.org/z/5s18M4erY
Weird types like this can result in weird merges.
Widening to s128 first and then clamping down avoids that situation.
Differential Revision: https://reviews.llvm.org/D107415
Matthias Springer [Wed, 4 Aug 2021 01:19:53 +0000 (10:19 +0900)]
[mlir][scf] Fix bug in peelForLoop
Insertion point should be set before creating new operations.
Differential Revision: https://reviews.llvm.org/D107326
wlei [Mon, 2 Aug 2021 18:42:15 +0000 (11:42 -0700)]
[llvm-profgen][CSSPGO] Support count based aggregated type of hybrid perf script
This change tried to integrate a new count based aggregated type of perf script. The only difference of the format is that an aggregated count is added at the head of the original sample which means the same samples are repeated to the given count times. This is used to reduce the perf script size.
e.g.
```
2
4005dc
400634
400684
7f68c5788793
0x4005c8/0x4005dc/P/-/-/0 ....
```
Implemented by a dedicated PerfReader `AggregatedHybridPerfReader`.
Differential Revision: https://reviews.llvm.org/D107192
Rob Suderman [Wed, 4 Aug 2021 00:25:43 +0000 (17:25 -0700)]
[mlir][tosa] Tosa shape propagation for tosa.cond_if
We can propagate the shape from tosa.cond_if operands into the true/false
regions then through the connected blocks. Then, using the tosa.yield ops
we can determine what all possible return types are.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D105940
Dan Liew [Tue, 3 Aug 2021 23:18:23 +0000 (16:18 -0700)]
[Compiler-rt] Fix running ASan/TSan unit tests under macOS 12.0.
On macOS the unit tests currently rely on libmalloc being used for
allocations (due to no functioning interceptors) but also having the
ASan/TSan allocator initialized in the same process.
This leads to crashes with the macOS 12.0 libmalloc nano allocator so
disable use of the allocator while running unit tests as a workaround.
rdar://
80086125
Differential Revision: https://reviews.llvm.org/D107412
Rob Suderman [Wed, 4 Aug 2021 00:01:56 +0000 (17:01 -0700)]
[mlir][tosa] Shape inference for a few remaining easy cases:
Handles shape inference for identity, cast, and rescale. These were missed
during the initialy elementwise work. This includes resize shape propagation
which includes both attribute and input type based propagation.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D105845
Shimin Cui [Tue, 3 Aug 2021 23:22:53 +0000 (19:22 -0400)]
[GlobalOpt] Fix the load types when OptimizeGlobalAddressOfMalloc
Currently, in OptimizeGlobalAddressOfMalloc, the transformation for global loads assumes that they have the same Type. With the support of ConstantExpr (https://reviews.llvm.org/D106589), this may not be true any more (as seen in the test case), and we miss the code to handle this, This is to fix that.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D107397
Michael Kruse [Tue, 3 Aug 2021 23:07:59 +0000 (18:07 -0500)]
[clang/OpenMP][docs] Update OpenMP support list for unroll.
Aart Bik [Tue, 3 Aug 2021 21:36:03 +0000 (14:36 -0700)]
[mlir][sparse] fixed doc formatting
Indentation seems to have an impact on website layout.
Reviewed By: grosul1
Differential Revision: https://reviews.llvm.org/D107403
Roman Lebedev [Tue, 3 Aug 2021 22:46:58 +0000 (01:46 +0300)]
[NFC][Codegen][X86] Add test for parity-of-vector-of-bools (PR51312)
Roman Lebedev [Tue, 3 Aug 2021 22:46:21 +0000 (01:46 +0300)]
[NFC][Codegen][SystemZ] Autogenerate checklines in int-cmp-47.ll
Craig Topper [Tue, 3 Aug 2021 21:54:51 +0000 (14:54 -0700)]
[SimplifyCFG] Enable switch to lookup table for more types.
This transform has been restricted to legal types since
https://reviews.llvm.org/rG65df808f6254617b9eee931d00e95d900610b660
in 2012.
This is particularly restrictive on RISCV64 which only has i64
as a legal integer type. i32 is a very common type in code
generated from C, but we won't form a lookup table with it.
This also effects other common types like i8/i16 types on ARM,
AArch64, RISCV, etc.
This patch proposes to allow power of 2 types larger than 8 bit, if
they will fit in the largest legal integer type in DataLayout.
These types are common in C code so generally well handled in
the backends.
We could probably do this for other types like i24 and rely on
alignment and padding to allow the backend to use a single wider
load. This isn't my main concern right now and it will need more
tests.
We could also allow larger types up to some limit and let the
backend split into multiple loads, but we need to define that
limit. It's also not my main concern right now.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D107233
Jeffrey Tan [Tue, 3 Aug 2021 15:34:47 +0000 (08:34 -0700)]
Fix expression evaluation result expansion in lldb-vscode
VScode now sends a "scopes" DAP request immediately after any expression evaluation.
This scopes request would clear and invalidate any non-scoped expandable variables in g_vsc.variables, causing later "variables" request to return empty result.
The symptom is that any expandable variables in VScode watch window/debug console UI to return empty content.
This diff fixes this issue by only clearing the expandable variables at process continue time. To achieve this, we have to repopulate all scoped variables
during context switch for each "scopes" request without clearing global expandable variables.
So the PR puts the scoped variables into its own locals/globals/registers; and all expandable variables into separate "expandableVariables" list.
Also, instead of using the variable index for "variableReference", it generates a new variableReference id each time as the key of "expandableVariables".
As a further new feature, this PR adds a new "expandablePermanentVariables" which has the lifetime of debug session. Any expandable variables from debug console
are added into this list. This enables users to snapshot expanable old variable in debug console and compare with new variables if desire.
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D105166
River Riddle [Tue, 3 Aug 2021 21:29:51 +0000 (21:29 +0000)]
[mlir-lsp-server] Disable multi-threading in LSP contexts
This prevents an explosion of threads, given that each file gets its own context and thus its own thread pool. We don't really need a thread pool for the LSP contexts anyways, so it's better to just disable threading.
Aart Bik [Tue, 3 Aug 2021 18:09:31 +0000 (11:09 -0700)]
[mlir][sparse] fix bug in permuting data structure
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D107379
Matheus Izvekov [Tue, 3 Aug 2021 20:10:34 +0000 (22:10 +0200)]
[clang] fix crash on template instantiation of invalid requires expressions
See PR48656.
The implementation of the template instantiation of requires expressions
was incorrectly trying to get the expression from an 'ExprRequirement'
before checking if it was an error state.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D107399
Evandro Menezes [Sun, 25 Jul 2021 01:46:31 +0000 (20:46 -0500)]
[RISCV] Add scheduling resources for V
Add the scheduling resources for the V extension instructions.
Differential Revision: https://reviews.llvm.org/D98002
Matheus Izvekov [Mon, 2 Aug 2021 14:15:34 +0000 (16:15 +0200)]
[clang] fix canonicalization of nested name specifiers
See PR47174.
When canonicalizing nested name specifiers of the type kind,
the prefix for 'DependentTemplateSpecialization' types was being
dropped, leading to malformed types which would cause failures
when rebuilding template names.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D107311
modimo [Tue, 3 Aug 2021 20:18:57 +0000 (13:18 -0700)]
[ThinLTO] Add TimeTrace for Thinlink step
Results from Clang self-build:
{
F17435948}
Testing:
ninja check-all
Reviewed By: anton-afanasyev
Differential Revision: https://reviews.llvm.org/D104428
Alexey Bataev [Mon, 2 Aug 2021 21:17:34 +0000 (14:17 -0700)]
[SLP]Do not emit extra shuffle for insertelements vectorization.
If the vectorized insertelements instructions form indentity subvector
(the subvector at the beginning of the long vector), it is just enough
to extend the vector itself, no need to generate inserting subvector
shuffle.
Differential Revision: https://reviews.llvm.org/D107344
Nico Weber [Tue, 3 Aug 2021 10:48:03 +0000 (12:48 +0200)]
[lldb] Get rid of HAVE_SYS_TYPES_H
LLVM includes this header unconditionally on all platforms
(including Windows), so this define should no longer be necessary.
No behavior change.
Differential Revision: https://reviews.llvm.org/D107338
Nico Weber [Tue, 3 Aug 2021 11:30:04 +0000 (13:30 +0200)]
[lldb] Move comment about noindex next to line it refers to
The comment was originally added in
34769d80d. Then D44526
removed the flag added there (but kept the comment), and then
D66966 reintroduced a .noindex dir (which D68606 and then
33fca97880
moved around a bit).
No behavior change.
Differential Revision: https://reviews.llvm.org/D107341
Douglas Chen [Tue, 3 Aug 2021 20:01:29 +0000 (22:01 +0200)]
[clang-tidy] Fix command line is too long issue which breaks test on Windows
This patch tries to fix command line too long problem on Windows for
https://reviews.llvm.org/D86671.
The command line is too long with check_clang_tidy.py program on Windows,
because the configuration is long for regression test. Fix this issue by
passing the settings in file instead.
Differential Revision: https://reviews.llvm.org/D107325
George Burgess IV [Tue, 3 Aug 2021 19:38:10 +0000 (19:38 +0000)]
bugprone-argument-comment: ignore mismatches from system headers
As of
2a3498e24f97d, we ignore parameter name mismatches for functions
in the `std::` namespace, since those aren't standardized. It seems
reasonable to extend this to all functions which are declared in system
headers, since this lint can be a bit noisy otherwise
(https://bugs.chromium.org/p/chromium/issues/detail?id=1191507).
Differential Revision: https://reviews.llvm.org/D99993
River Riddle [Tue, 3 Aug 2021 19:52:43 +0000 (19:52 +0000)]
[vscode-mlir] Add proper support for mlir markdown codeblocks
A special language contribution is required for properly
supporting markdown code blocks in vscodes builtin markdown
grammar, see https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example
for more details.
Vitaly Buka [Tue, 3 Aug 2021 19:44:59 +0000 (12:44 -0700)]
[tests][sanitizers] Don't reflow comments
This lets us to apply ColumnLimit without breaking "RUN:" lines.
Alexey Bataev [Tue, 3 Aug 2021 19:22:10 +0000 (12:22 -0700)]
[SLP][NFC]Add tests for SLP vectorizer for crashes, found in new
reordering algorithm.
Kostya Serebryany [Tue, 3 Aug 2021 18:42:16 +0000 (11:42 -0700)]
[libFuzzer] fix clang-tidy
[libFuzzer] fix clang-tidy
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D107382
Alexey Bataev [Tue, 3 Aug 2021 18:30:18 +0000 (11:30 -0700)]
Revert "[SLP]Improve graph reordering."
This reverts commit
e408d1dfab42b27d0aa51b221e50fa6390fb5ed1 and
2 other (
4b25c113210e579a5346ca0abc0717ab1ce5d9df and
c2deb2afafee991c06cc96dc5beecb6de448b9fc) related to fix the problem with the
reordering shuffles.
Alex Langford [Tue, 3 Aug 2021 18:49:46 +0000 (11:49 -0700)]
[lldb] Further constrain a test that fails without python enabled
The test relies on the python embedded interpreter being available and
fails otherwise.
Sami Tolvanen [Tue, 3 Aug 2021 17:56:56 +0000 (10:56 -0700)]
ThinLTO: Fix inline assembly references to static functions with CFI
Create an internal alias with the original name for static functions
that are renamed in promoteInternals to avoid breaking inline
assembly references to them.
Relands
700d07f8ce6f2879610fd6b6968b05c6f17bb915 with -msvc targets
fixed.
Link: https://github.com/ClangBuiltLinux/linux/issues/1354
Reviewed By: nickdesaulniers, pcc
Differential Revision: https://reviews.llvm.org/D104058
Kostya Serebryany [Tue, 3 Aug 2021 17:04:16 +0000 (10:04 -0700)]
[libFuzzer] replace Vector/Set with std::vector/std::set. The custom names are not required any more since we now build with a private version of libc++. Fix some of the 81+ character lines. Mechanical change, NFC expected.
[libFuzzer] replace Vector/Set with std::vector/std::set.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D107374
Dylan Fleming [Tue, 3 Aug 2021 17:40:23 +0000 (18:40 +0100)]
[InstCombine] Fixed select + masked load fold failure
Fixed type assertion failure caused by trying to fold a masked load with a
select where the select condition is a scalar value
Reviewed By: sdesmalen, lebedev.ri
Differential Revision: https://reviews.llvm.org/D107372
Philip Reames [Tue, 3 Aug 2021 18:04:42 +0000 (11:04 -0700)]
[tests] Autogen an unroll test for ease of update
Jennifer Yu [Tue, 3 Aug 2021 17:35:04 +0000 (10:35 -0700)]
Stop emit incomplete type error for a variable in a map clause
where should not.
Currently we are using QTy->isIncompleteType(&ND) to check incomplete
type. But before doing that, need to instantiate for a class template
specialization or a class member of a class template specialization,
or an array with known size of such..., so that we know it is really
incomplete type.
To fix this using RequireCompleteType instead.
The new test is added into "test/OpenMP/target_update_messages.cpp"
The different of using RequireCompleteType is when emit incomplete type,
an additional note is also emitted to point to where incomplete type
is declared. Because this change, many tests are needed to be fixed
by adding additional note.
This is to fix https://bugs.llvm.org/show_bug.cgi?id=50508
Differential Revision: https://reviews.llvm.org/D107200
Vitaly Buka [Tue, 3 Aug 2021 17:29:30 +0000 (10:29 -0700)]
[llvm-readobj] Fix UB in pointer arithmetics after D105522
Simon Pilgrim [Tue, 3 Aug 2021 17:23:39 +0000 (18:23 +0100)]
[X86][AVX] Add some multiple/nested subvector insertion shuffle tests
As discussed on D107068 - see how well we merge INSERT_SUBVECTOR nodes and combine a shuffles using multiple ops in CONCAT_VECTORS nodes.
Philip Reames [Tue, 3 Aug 2021 17:28:02 +0000 (10:28 -0700)]
[runtimeunroll] A bit of style cleanup to simplify a following change [NFC]
Use for-range, use the idiomatic pattern for non-loop values, etc..
Ahmed Taei [Mon, 2 Aug 2021 20:26:03 +0000 (13:26 -0700)]
Reorder mmt4d r.h.s operand layout
Switch r.h.s operand layout (n1, k1, n0, k0) -> (n1, k1, k0, n0)
which is more consistant with scalar-vector products vectorization
and elementates operand transpose.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D107307
Sumesh Udayakumaran [Tue, 3 Aug 2021 16:41:55 +0000 (19:41 +0300)]
[NFC][MLIR] Split large fusion test file into 4 test files
mlir/test/transforms/loop-fusion.mlir is too big and is split into mlir/test/transforms/loop-fusion.mlir, mlir/test/transforms/loop-fusion-2.mlir, mlir/test/transforms/loop-fusion-3.mlir
and mlir/test/transforms/loop-fusion-4.mlir. Further tests can be added in mlir/test/transforms/loop-fusion-4.mlir
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D106473
wlei [Thu, 29 Jul 2021 18:42:55 +0000 (11:42 -0700)]
[llvm-profgen] Support perf script without parsing MMap events
This change supports to run without parsing MMap binary loading events instead it always assumes binary is loaded at the preferred address. This is used when we have assured no binary load address changes or we have pre-processed the addresses resolution. Warn if there's interior mmap event but without leading mmap events.
Reviewed By: hoy
Differential Revision: https://reviews.llvm.org/D107097
Cullen Rhodes [Tue, 3 Aug 2021 16:42:17 +0000 (16:42 +0000)]
[AArch64][SME] Fix out of date comment
Missed in
3a349d22692c.
Dmitry Vyukov [Tue, 3 Aug 2021 16:24:48 +0000 (18:24 +0200)]
tsan: fix a typo in debug output
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D107368
Vitaly Buka [Mon, 2 Aug 2021 23:26:28 +0000 (16:26 -0700)]
[NFC][tsan] Rename _inl.h to .inc
Differential Revision: https://reviews.llvm.org/D107319
David Green [Tue, 3 Aug 2021 16:25:40 +0000 (17:25 +0100)]
[AArch64] Prefer fmov over orr v.16b when copying f32/f64
This changes the lowering of f32 and f64 COPY from a 128bit vector ORR to
a fmov of the appropriate type. At least on some CPU's with 64bit NEON
data paths this is expected to be faster, and shouldn't be slower on any
CPU that treats fmov as a register rename.
Differential Revision: https://reviews.llvm.org/D106365
Kazu Hirata [Tue, 3 Aug 2021 16:16:15 +0000 (09:16 -0700)]
[llvm] Fix header guards (NFC)
Identified with llvm-header-guard.
KareemErgawy-TomTom [Tue, 3 Aug 2021 16:08:00 +0000 (18:08 +0200)]
[MLIR][Linalg] Extend detensoring control flow model.
This patch extends the PureControlFlowDetectionModel to consider
detensoring br and cond_br operands.
See: https://github.com/google/iree/issues/1159#issuecomment-
884322687,
for a disccusion on the need for such extension.
Reviewed By: silvas
Differential Revision: https://reviews.llvm.org/D107358
Andrea Di Biagio [Tue, 3 Aug 2021 15:52:19 +0000 (16:52 +0100)]
[MCA][NFC] Add tests for PR51318 and PR51322.
Also, regenerate existing X86 tests using update_mca_test.py.
Fangrui Song [Tue, 3 Aug 2021 16:01:03 +0000 (09:01 -0700)]
[ELF] Add --export-dynamic-symbol-list
This is available in GNU ld 2.35 and can be seen as a shortcut for multiple
--export-dynamic-symbol, or a --dynamic-list variant without the symbolic intention.
In the long term, this option probably should be preferred over --dynamic-list.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D107317
Florian Hahn [Tue, 3 Aug 2021 15:16:10 +0000 (16:16 +0100)]
[VectorCombine] Add tests where the index is guaranteed non-poison.
Tests for PR50949.
Craig Topper [Mon, 2 Aug 2021 19:29:39 +0000 (12:29 -0700)]
[RISCV] Indicate that RISCVMergeBaseOffsetOpt preserves the CFG.
Return false from runOnFunction if nothing changed. Curiously
we already returned a bool from detectAndFoldOffset, but didn't
use it.
Fix a couple breaks after returns that I saw while auditing
detectAndFoldOffset.
Differential Revision: https://reviews.llvm.org/D107303
Kostya Kortchinsky [Mon, 2 Aug 2021 20:38:14 +0000 (13:38 -0700)]
[scudo] Make Vector() constexpr
A `Vector` that doesn't require an initial `reserve()` (eg: with a
default, or small enough capacity) can have a constant initializer.
This changes the code in a few places to make that possible:
- mark a few other functions as `constexpr`
- do without any `reinterpret_cast`
- allow to skip `reserve` from `init`
Differential Revision: https://reviews.llvm.org/D107308
Krasimir Georgiev [Tue, 3 Aug 2021 14:19:24 +0000 (16:19 +0200)]
[clan-format] detect function definitions more conservatively
https://reviews.llvm.org/D105964 updated the detection of function
definitions. It had the unfortunate effect to start marking object
definitions with attribute-like macros as function definitions.
This addresses this issue.
Reviewed By: owenpan
Differential Revision: https://reviews.llvm.org/D107269
Dmitry Vyukov [Tue, 3 Aug 2021 11:49:46 +0000 (13:49 +0200)]
tsan: remove mallopt calls
mallopt calls are left-over from the times we used
__libc_malloc/__libc_free for internal allocations.
Now we have own internal allocator, so this is not needed.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107342
Dmitry Vyukov [Tue, 3 Aug 2021 11:31:39 +0000 (13:31 +0200)]
tsan: remove unused caller_pc from TsanInterceptorContext
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107340