Commit Graph

409247 Commits

Author SHA1 Message Date
Fangrui Song bfc2f4b122 [ELF] Update help messages to prefer canonical name for some long options
And improve the help message for --pop-state.
2022-01-06 00:43:46 -08:00
Matthias Springer 0e5f258452 [mlir][linalg][bufferize][NFC] Simplify InsertSliceOp bufferization
No need to keep track of equivalent extract_slice / insert_slice tensors during bufferization. Just emit a copy, it will fold away.

Note: The analysis still keeps track of equivalent tensors to make the correct inplace bufferization decisions.

Differential Revision: https://reviews.llvm.org/D116684
2022-01-06 17:35:45 +09:00
Nikita Popov e8b98a5216 [CodeGen] Emit elementtype attributes for indirect inline asm constraints
This implements the clang side of D116531. The elementtype
attribute is added for all indirect constraints (*) and tests are
updated accordingly.

Differential Revision: https://reviews.llvm.org/D116666
2022-01-06 09:29:22 +01:00
Martin Storsjö 1919720fdd [lldb] [debugserver] Simplify handling of arch specific files
There are no duplicates among the include files, and all the
source files are wrapped in architecture ifdefs, so there's no harm
in including all of them, always.

This fixes builds if TARGET_TRIPLE is set to something else than the
build architecture.

This also allows building for multiple architectures at once by
setting CMAKE_OSX_ARCHITECTURES.

Differential Revision: https://reviews.llvm.org/D116625
2022-01-06 10:23:04 +02:00
Nikita Popov 32808cfb24 [IR] Track users of comdats
Track all GlobalObjects that reference a given comdat, which allows
determining whether a function in a comdat is dead without scanning
the whole module.

In particular, this makes filterDeadComdatFunctions() have complexity
O(#DeadFunctions) rather than O(#SymbolsInModule), which addresses
half of the compile-time issue exposed by D115545.

Differential Revision: https://reviews.llvm.org/D115864
2022-01-06 09:13:58 +01:00
mydeveloperday 49d311874e [clang-format] Missing space after cast in a macro
https://github.com/llvm/llvm-project/issues/52979

Though SpaceAfterCStyleCast is set to true, clang-format 13 does not add a space after (void *) here:

```
```

This patch addresses that

Fixes: #52979

Reviewed By: curdeius, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D116592
2022-01-06 08:07:03 +00:00
Lang Hames 118e953b18 Re-apply "[JITLink] Update JITLink to use ExecutorAddr rather... " with fixes.
This re-applies 133f86e954, which was reverted in
c5965a411c while I investigated bot failures.

The original failure contained an arithmetic conversion think-o (on line 419 of
EHFrameSupport.cpp) that could cause failures on 32-bit platforms. The issue
should be fixed in this patch.
2022-01-06 17:22:21 +11:00
Vitaly Buka 6396a44361 Revert "SIGSEGV in Sanitizer INTERCEPTOR of strstr function."
Breaks Asan on Fuchsia's and ubsan with gcc.

This reverts commit 685c94c6cb.
2022-01-05 21:28:01 -08:00
Christudasan Devadasan 50b5b367c1 [AMDGPU] Iterate LoweredEndCf in the reverse order
The function that optimally inserts the exec mask
restore operations by combining the blocks currently
visits the lowered END_CF pseudos in the forward
direction as it iterates the setvector in the order
the entries are inserted in it.

Due to the absence of BranchFolding at -O0, the
irregularly placed BBs cause the forward traversal
to incorrectly place two unconditional branches in
certain BBs while combining them, especially when
an intervening block later gets optimized away in
subsequent iterations.

It is avoided by reverse iterating the setvector.
The blocks at the bottom of a function will get
optimized first before processing those at the top.

Fixes: SWDEV-315215

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D116273
2022-01-06 00:27:11 -05:00
David Blaikie 31b79b86ee Revert "Remove unused variable (-Wunused)"
Patch that removed the use of this variable was  reverted in
8ade3d43a3

This reverts commit 3988a06d86.
2022-01-05 20:43:30 -08:00
David Blaikie 811b60f0b9 llvm-dwarfdump: Speed up type unit lookup using the TUIndex or a cache
Use the TUIndex in a DWP file if present, otherwise (in .o, .dwo, and
non-split linked executables) cache a DenseMap for lookup of type units.
2022-01-05 20:41:07 -08:00
David Blaikie 33529ba0cb llvm-dwarfdump --summarize-types: skip compilation units
Important for DWARFv5 debug info which might contain type units in the
debug_info section, which made summarize-types fairly ineffective/lost
amongst the noise of CUs being dumped.
2022-01-05 20:36:04 -08:00
Congzhe Cao 8ade3d43a3 Revert "[LoopInterchange] Remove a limitation in LoopInterchange legality"
This reverts commit 15702ff9ce while I
investigate a ppc build bot failure at
https://lab.llvm.org/buildbot#builders/36/builds/16051.
2022-01-05 23:34:36 -05:00
David Blaikie 3988a06d86 Remove unused variable (-Wunused) 2022-01-05 20:29:35 -08:00
David Blaikie 06c154602e DebugInfo: Rebuild varargs function types correctly
Improves llvm-dwarfdump output and for simplified template names roundtripping.
2022-01-05 20:29:29 -08:00
Vaivaswatha Nagaraj 2c384c3772 [MLIR][DataFlowAnalysis] Use a queue to maintain the worklist
Since the analysis is described to be suitable for a forward
data-flow analysis, maintaining the worklist as a queue mimics
RPO ordering of block visits, thus reaching the fixpoint earlier.

Differential Revision: https://reviews.llvm.org/D116393
2022-01-06 09:55:22 +05:30
Lang Hames c5965a411c Revert "[JITLink] Update JITLink to use ExecutorAddr rather than..."
This reverts commit 133f86e954 while I investigate
the bot failures at https://lab.llvm.org/buildbot#builders/186/builds/3370.
2022-01-06 15:20:21 +11:00
Shilei Tian aab62aab04 [OpenMP][Offloading] Fixed a crash caused by dereferencing nullptr
In function `DeviceTy::getTargetPointer`, `Entry` could be `nullptr` because of
zero length array section. We need to check if it is a valid iterator before
using it.

Reviewed By: ronlieb

Differential Revision: https://reviews.llvm.org/D116716
2022-01-05 23:04:29 -05:00
Fangrui Song f71e02fa46 [CMake] Disable LLVM_INCLUDE_GO_TESTS by default
llvm/test/Bindings/Go is quite flaky in the past few months and nobody fixes it.

See

* https://lists.llvm.org/pipermail/llvm-dev/2021-December/154353.html "Suggestions on debugging pre-merge test failure that looks irrelevant."
* https://github.com/llvm/llvm-project/issues/53017

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D116698
2022-01-05 20:03:52 -08:00
Congzhe Cao 15702ff9ce [LoopInterchange] Remove a limitation in LoopInterchange legality
There was a limitation in legality that in the original inner loop latch,
no instruction was allowed between the induction variable increment
and the branch instruction. This is because we used to split the
inner latch at the induction variable increment instruction. Since
now we have split at the inner latch branch instruction and have
properly duplicated instructions over to the split block, we remove
this limitation.

Please refer to the test case updates to see how we now interchange
loops where instructions exist between the induction variable increment
and the branch instruction.

Reviewed By: bmahjour

Differential Revision: https://reviews.llvm.org/D115238
2022-01-05 22:37:54 -05:00
Petr Hosek 9eeb2c98f4 [msan] Check for AVX regs using offset
glibc versions < 2.26 use different names for the fields.
However the layout is unchanged, so using the offset should be a
portable way to address this issue across platforms.

Fixes: https://github.com/llvm/llvm-project/issues/53014

Patch By: paulkirth

Differential Revision: https://reviews.llvm.org/D116695
2022-01-05 19:24:00 -08:00
Dave Lee 3a1a0d4957 [lldb] Add StringList::AppendString(const Twine&) (NFC)
Add a convenience for appending constructed string values.

Differential Revision: https://reviews.llvm.org/D116682
2022-01-05 18:49:15 -08:00
Lang Hames 133f86e954 [JITLink] Update JITLink to use ExecutorAddr rather than JITTargetAddress.
ExecutorAddr is the preferred representation for executor process addresses now.
2022-01-06 13:48:12 +11:00
Lang Hames 9e2cfb061a [ORC] Make ExecutorAddrDiff an alias for uint64_t.
We don't need to restrict operations on ExecutorAddrDiff as carefully as we do
for ExecutorAddr.
2022-01-06 13:48:11 +11:00
Dave Lee ef6817f932 [lldb] Break out long help for 'frame var'
The current help for `frame variable` is somewhat long. Its length, combined
with the few aliases (`var`, `v`, and `vo`) can make the output of `apropos`
redundant and noisy.

This separates out the details into a separate long help.

Differential Revision: https://reviews.llvm.org/D116708
2022-01-05 18:47:52 -08:00
Jim Lin cb0e12a144 [M68k][test][NFC] Add missing tests for MxCMP_RM
Let each format of inst have two tests for it like other MxCMP
testcases.
2022-01-06 10:38:53 +08:00
William S. Moses 358d020017 [MLIR][LLVM] Add simple folders for bitcast/addrspacecast/gep
Add 5 simple folders
* bitcast(x : T0, T0) -> x
* addrcast(x : T0, T0) -> x
* bitcast(bitcast(x : T0, T1), T0) -> x
* addrcast(addrcast(x : T0, T1), T0) -> x
* gep %x:T, 0 -> %x:T

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D116715
2022-01-05 21:17:32 -05:00
Jim Lin 75ea6b4319 [M68k][test][NFC] Fix no newline at end of file 2022-01-06 10:07:35 +08:00
Mogball b0774e5f50 [mlir][ods] ODS ops get an `extraClassDefinition`
Extra definitions are placed in the generated source file for each op class. The substitution `$cppClass` is replaced by the op's C++ class name.

This is useful when declaring but not defining methods in TableGen base classes:

```
class BaseOp<string mnemonic>
    : Op<MyDialect, mnemonic, [DeclareOpInterfaceMethods<SomeInterface>] {
  let extraClassDeclaration = [{
    // ZOp is declared at at the bottom of the file and is incomplete here
    ZOp getParent();
  }];
  let extraClassDefinition = [{
    int $cppClass::someInterfaceMethod() {
      return someUtilityFunction(*this);
    }
    ZOp $cppClass::getParent() {
      return dyn_cast<ZOp>(this->getParentOp());
    }
  }];
}
```

Certain things may prevent defining these functions inline, in the declaration. In this example, `ZOp` in the same dialect is incomplete at the function declaration because ops classes are declared in alphabetical order. Alternatively, functions may be too big to be desired as inlined, or they may require dependencies that create cyclic includes, or they may be calling a templated utility function that one may not want to expose in a header. If the functions are not inlined, then inheriting from the base class N times means that each function will need to be defined N times. With `extraClassDefinitions`, they only need to be defined once.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D115783
2022-01-06 01:43:26 +00:00
Craig Topper 0f5b718030 [LTO][codegen] Add TargetLibraryInfoWrapperPass initially
Many codegen pass require this pass with useful triple info. Legacy pass manager need to
add a TargetLibraryInfo with the module info before run passes. Or the TargetLibraryInfo
will be initialized too conservative.

Reviewed By: pengfei, aeubanks

Differential Revision: https://reviews.llvm.org/D115850
2022-01-06 09:24:35 +08:00
Yuanfang Chen 74bb4ad5d4 Consider CMAKE_{t}_LINKER_FLAGS_<CONFIG> when passing -gcodeview-ghash
CMake may add /Debug in the CONFIG-specific flag.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D116710
2022-01-05 17:22:11 -08:00
Shilei Tian 9584c6fa2f [OpenMP][Offloading] Fixed data race in libomptarget caused by async data movement
The async data movement can cause data race if the target supports it.
Details can be found in [1]. This patch tries to fix this problem by attaching
an event to the entry of data mapping table. Here are the details.

For each issued data movement, a new event is generated and returned to `libomptarget`
by calling `createEvent`. The event will be attached to the corresponding mapping table
entry.

For each data mapping lookup, if there is no need for a data movement, the
attached event has to be inserted into the queue to gaurantee that all following
operations in the queue can only be executed if the event is fulfilled.

This design is to avoid synchronization on host side.

Note that we are using CUDA terminolofy here. Similar mechanism is assumped to
be supported by another targets. Even if the target doesn't support it, it can
be easily implemented in the following fall back way:
- `Event` can be any kind of flag that has at least two status, 0 and 1.
- `waitEvent` can directly busy loop if `Event` is still 0.

My local test shows that `bug49334.cpp` can pass.

Reference:
[1] https://bugs.llvm.org/show_bug.cgi?id=49940

Reviewed By: grokos, JonChesterfield, ye-luo

Differential Revision: https://reviews.llvm.org/D104418
2022-01-05 20:20:04 -05:00
Egor Zhdan 809c6a5a1d [Clang] Extract availability mapping from VersionMap for watchOS/tvOS
This change makes it possible to extract iOS-to-another-platform version mappings from `VersionMap` in the `SDKSettings.json` file in Darwin SDKs, for example, `iOS_watchOS` and `iOS_tvOS`.

This code was originally authored by Alex Lorenz.

rdar://81491680

Differential Revision: https://reviews.llvm.org/D116615
2022-01-05 17:00:03 -08:00
wren romano ceda1ae9a7 [mlir][sparse] Strengthening first arguments of fromCOO/toCOO
Better capturing of invariants

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D116700
2022-01-05 16:15:28 -08:00
wren romano c03fd1e61f [mlir][sparse] Marking cursor parameters const
These parameters aren't modified, so we make that invariant explicit.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D116693
2022-01-05 16:14:02 -08:00
Daniil Suchkov 524abc68f2 Introduce NewPM .dot printers for DomTree
This patch adds a couple of NewPM function passes (dot-dom and
dot-dom-only) that dump DomTree into .dot files.

Reviewed-By: aeubanks
Differential Revision: https://reviews.llvm.org/D116629
2022-01-05 23:25:40 +00:00
Richard d7b6574c3b [clang-tidy] Recognize transformer checks as providing fixits
- Recognize older checks that might not end with Check.cpp
- Update list of checks based on improvements to add_new_check
- Fix spelling error in TransformerClangTidyCheck.h

Fixes #52962

Differential Revision: https://reviews.llvm.org/D116550
2022-01-05 16:13:52 -07:00
Andrew Browne 4e173585f6 [DFSan] Add option for conditional callbacks.
This allows DFSan to find tainted values used to control program behavior.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D116207
2022-01-05 15:07:09 -08:00
Jonas Devlieghere 46a28a954e [lldb] Create a property to store the REPL language
Until the introduction of the C++ REPL, there was always a single REPL
language. Several places relied on this assumption through
repl_languages.GetSingularLanguage. Now that this is no longer the case,
we need a way to specify a selected/preferred REPL language. This patch
does that with the help of a debugger property, taking inspiration from
how we store the scripting language.

Differential revision: https://reviews.llvm.org/D116697
2022-01-05 15:03:46 -08:00
Ikhlas Ajbar 2819e5de42 [Hexagon] Handle instruction selection for select(I1,Q,Q)
Lower select(I1,Q,Q) by converting vector predicate Q to vector register V,
doing select(I1,V,V), and then converting the resulting V back to Q. Also,
try to avoid creating such situations in the first place.
2022-01-05 14:50:12 -08:00
Quentin Colombet cdbad62c52 [ADCE][NFC] Batch DT updates together
This patch delayed the updates of the dominator tree to the very end of
the pass instead of doing that in small increments after each basic
block.

This improves the runtime of the pass in particular in pathological
cases because now the updater sees the full extend of the updates and
can decide whether it is faster to apply the changes incrementally or
just recompute the full tree from scratch.

Put differently, thanks to this patch, we can take advantage of the
improvements that Chijun Sima <simachijun@gmail.com> made in the
dominator tree updater a while ago with commit 32fd196cbf4d: "Teach the
DominatorTree fallback to recalculation when applying updates to speedup
JT (PR37929)".

This change is NFC but can improve the runtime of the compiler
dramatically in some pathological cases (where the pass was pushing a
lot (several thousands) of small updates (less than 6)).

For instance on the motivating example we went from 300+ sec to less
than a second.

Differential Revision: https://reviews.llvm.org/D116610
2022-01-05 14:05:20 -08:00
Philip Reames cfcd7af8de [instcombine] Add test coverage for (x >>u y) pred x [part 2] 2022-01-05 13:37:17 -08:00
Philip Reames 8cc52ca734 [instcombine] Add test coverage for (x >>u y) pred x 2022-01-05 13:34:05 -08:00
Ikhlas Ajbar 3892baaa71 [Hexagon] Replace isImmValidForOpcode() with isExtendable flag 2022-01-05 13:19:02 -08:00
Krzysztof Parzyszek f6309db719 [Hexagon] Handle L2_loadb[sz]w[24]_io in HII::isValidOffset 2022-01-05 13:19:02 -08:00
Sumanth Gundapaneni 9d0f5c1f8e [Hexagon] Add missing memop instructions to HexagonInstrInfo
This patch updated HexagonInstrInfo API to deal with missing immediate
memop instructions that checks for the validity of the offset.
2022-01-05 13:19:02 -08:00
Sumanth Gundapaneni 69deb3c829 [Hexagon] Update instruction info for missing .cur post-increment cases 2022-01-05 13:19:02 -08:00
Stefan Pintilie 04496201e0 [PowerPC] Add support for ROP protection for 32 bit.
Add support for Return Oriented Programming (ROP) protection for 32 bit.
This patch also adds a testing for AIX on both 64 and 32 bit.

Reviewed By: amyk

Differential Revision: https://reviews.llvm.org/D111362
2022-01-05 15:15:53 -06:00
Kevin Athey 4d06565bd8 Initialize SaveInfo in methods Output::preflightKey and Output::preflightElement.
When enabling MSAN eager mode with noundef analysis these variables were found to not be initialized in unit tests.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D116428
2022-01-05 13:13:48 -08:00
Collin Baker 7e08a12088 [clang] Fall back on Android triple w/o API level for runtimes search
Clang searches for runtimes (e.g. libclang_rt*) first in a
subdirectory named for the target triple (corresponding to
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON), then if it's not found uses
.../lib/<os>/libclang_rt* with a suffix corresponding to the arch and
environment name.

Android triples optionally include an API level indicating the minimum
Android version to be run on
(e.g. aarch64-unknown-linux-android21). When compiler-rt is built with
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON this API level is part of the
output path.

Linking code built for a later API level against a runtime built for
an earlier one is safe. In projects with several API level targets
this is desireable to avoid re-building the same runtimes many
times. This is difficult with the current runtime search method: if
the API levels don't exactly match Clang gives up on the per-target
runtime directory path.

To enable this more simply, this change tries target triple without
the API level before falling back on the old layout.

Another option would be to try every API level in the triple,
e.g. check aarch-64-unknown-linux-android21, then ...20, then ...19,
etc.

Differential Revision: https://reviews.llvm.org/D115049
2022-01-05 16:00:48 -05:00