Commit Graph

411630 Commits

Author SHA1 Message Date
Matthias Springer be8742b6c9 [mlir][linalg][bufferize][NFC] Merge AllocationCallbacks into BufferizationOptions
Also move `createAlloc` and related helper functions out of BufferizationState. The goal is to make BufferizationState as small as possible. (Code cleanup)

Differential Revision: https://reviews.llvm.org/D117476
2022-01-19 18:36:34 +09:00
Matthias Springer b44defa5a5 [mlir][linalg][bufferize] Generalize destination-passing style detection
If not allow-return-memref, raise an error if a new memory allocation is returned/yielded from a block. We do not check for new allocations directly, but for ops that yield/return values that are not equivalent to values that are defined outside of the current of the block.

Note: We still need to check that scf.for yield values and bbArgs are aliasing to ensure that getAliasingOpOperand/getAliasingOpResult is correct.

Differential Revision: https://reviews.llvm.org/D116687
2022-01-19 18:21:29 +09:00
Elliott Maguire 480a1fab72 [clang-format] Fix incorrect alignment of operator= overloads.
Fixes https://github.com/llvm/llvm-project/issues/31568.

Added a check for operator keyword tokens.

Reviewed By: MyDeveloperDay, curdeius, owenpan, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D117421
2022-01-19 10:18:47 +01:00
Matthias Springer b83c67d978 [mlir][linalg][bufferize] Support scf.execute_region bufferization
This op is needed for unit testing in a subsequent revision. (This is the first op that has a block that yields equivalent values via the op's results.)

Note: Bufferization of scf.execute_region ops with multiple blocks is not yet supported.

Differential Revision: https://reviews.llvm.org/D117424
2022-01-19 18:17:09 +09:00
esmeyi b9d85a5231 [NFC][XCOFF] remove the tool name `yaml2obj` in the test. 2022-01-19 04:11:21 -05:00
esmeyi 05fffac1f9 [NFC][XCOFF] commit tests for D113552.
The code part of D113552 was committed at
817936408b, where the test was left because
it depended on another patch.
There are no dependencies now.
2022-01-19 04:06:37 -05:00
Jay Foad 7af959673e [AMDGPU] Tweak some compares in wave32.ll test
This prevents the compares from being optimized away when D86578 lands,
which seems unintended.
2022-01-19 08:14:06 +00:00
Igor Kudrin f3471dc517 [llvm-objcopy] Preserve ARM and AArch64 mapping symbols
Mapping symbols are required by ARM/AArch64 ELF ABI. They help to
disassemble files correctly and are also used in linkers. Nonetheless,
for executable files, the symbols can be stripped to better resemble
the behavior of GNU's objcopy.

Differential Revision: https://reviews.llvm.org/D117233
2022-01-19 14:41:21 +07:00
Fangrui Song 288082d45d [ELF] Move SHT_REL/SHT_RELA handling from createInputSection to initializeSections
This simplifies the code a bit. While here,

* change the `multiple relocation sections` diagnostic from `fatal` to `error` and include the relocated section name.
* drop less useful name from `getRelocTarget`. Without -r/--emit-relocs we don't need to get SHT_REL/SHT_RELA names.
2022-01-18 23:31:51 -08:00
not-jenni 41d05e29c0 [mlir][tosa] Add tosa.clamp as no-op canonicalization
When the min/max are the total range of the value, it is a no-op as the values
are already restricted to that range.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D117625
2022-01-18 23:15:40 -08:00
Stanislav Gatev a0262043bb Revert "[clang][dataflow] Add a test to justify skipping past references in UO_Deref"
This reverts commit 68226e572f.
2022-01-19 06:46:37 +00:00
Fangrui Song 84944b63f3 [ELF] Simplify ObjFile<ELFT>::initializeSections. NFC 2022-01-18 22:45:04 -08:00
Mehdi Amini 3df97bfebc Fix GCC 5 MLIR Build (NFC)
Try to fix the error:

mlir/lib/Parser/Parser.cpp:553:14: error: cannot call member function 'mlir::InFlightDiagnostic mlir::detail::Parser::emitError(llvm::SMLoc, const llvm::Twine&)' without object
              << "operation location alias was never defined";
2022-01-19 06:44:28 +00:00
eopXD 9f27941c2f [RISCV] Add patterns for vector narrowing integer right shift instructions
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D117454
2022-01-18 22:30:13 -08:00
Siva Chandra Reddy d7c8d51f94 [libc][Obvious] Add -Wno-c++17-extensions to sinf, cosf and sincosf targets. 2022-01-19 06:22:17 +00:00
Amir Ayupov 5a4bf4c2b3 [BOLT][CMAKE] Use BOLT_CLANG_EXE and BOLT_LLD_EXE as is
Add an ability to provide paths that don't match tool name exactly:
e.g. clang-13.
Remove use_lld call that sets up unused extra tools.

Test plan:
```
cmake -G Ninja ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt" -DBOLT_CLANG_EXE=/usr/bin/clang-13 -DBOLT_LLD_EXE=/usr/bin/lld-13
...
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /usr/bin/clang-13
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld: /usr/bin/lld-13

cmake -G Ninja ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt;lld" -DBOLT_CLANG_EXE=/usr/bin/clang-13
...
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /usr/bin/clang-13
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld: /data/llvm-build2/bin/lld

cmake -G Ninja ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt;clang;lld"
...
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /data/llvm-build3/bin/clang
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld: /data/llvm-build3/bin/lld
```

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D117446
2022-01-18 21:14:00 -08:00
River Riddle 7ceffae18c [mlir] Convert OpTrait::FunctionLike to FunctionOpInterface
This commit refactors the FunctionLike trait into an interface (FunctionOpInterface).
FunctionLike as it is today is already a pseudo-interface, with many users checking the
presence of the trait and then manually into functionality implemented in the
function_like_impl namespace. By transitioning to an interface, these accesses are much
cleaner (ideally with no direct calls to the impl namespace outside of the implementation
of the derived function operations, e.g. for parsing/printing utilities).

I've tried to maintain as much compatability with the current state as possible, while
also trying to clean up as much of the cruft as possible. The general migration plan for
current users of FunctionLike is as follows:

* function_like_impl -> function_interface_impl
Realistically most user calls should remove references to functions within this namespace
outside of a vary narrow set (e.g. parsing/printing utilities). Calls to the attribute name
accessors should be migrated to the `FunctionOpInterface::` equivalent, most everything
else should be updated to be driven through an instance of the interface.

* OpTrait::FunctionLike -> FunctionOpInterface
`hasTrait` checks will need to be moved to isa, along with the other various Trait vs
Interface API differences.

* populateFunctionLikeTypeConversionPattern -> populateFunctionOpInterfaceTypeConversionPattern

Fixes #52917

Differential Revision: https://reviews.llvm.org/D117272
2022-01-18 20:56:53 -08:00
Tue Ly b0cd3abf03 [libc] Remove as_double usage as constant initializations in sincosf implementation.
Use hexadecimal floats with C++17 instead of as_double as floating point constant initializations.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D117628
2022-01-18 23:48:48 -05:00
River Riddle 196c4279c0 [flang] Convert uses of FunctionPass to OperationPass<FuncOp>
FunctionPass has been deprecated and is in the process of being removed.
2022-01-18 20:46:44 -08:00
Peixin-Qiao a56a7d99e8 [MLIR][OpenMP] Support schedule chunk size with various bit width
The chunk size in schedule clause is one integer expression, which can
be either constant integer or integer variable. Fix schedule clause in
MLIR Op Def to support integer expression with different bit width.

Reviewed By: shraiysh

Differential Revision: https://reviews.llvm.org/D116073
2022-01-19 12:36:53 +08:00
River Riddle d288656368 [mlir] Mark FunctionPass as deprecated using the C++14 deprecated attribute 2022-01-18 20:18:47 -08:00
River Riddle 4157455425 [mlir][Pass] Deprecate FunctionPass in favor of OperationPass<FuncOp>
The only benefit of FunctionPass is that it filters out function
declarations. This isn't enough to justify carrying it around, as we can
simplify filter out declarations when necessary within the pass. We can
also explore with better scheduling primitives to filter out declarations
at the pipeline level in the future.

The definition of FunctionPass is left intact for now to allow time for downstream
users to migrate.

Differential Revision: https://reviews.llvm.org/D117182
2022-01-18 19:52:44 -08:00
Casey Carter a94739985b [libcxx][test] test _LIBCPP_VERSION with #ifdef, not #if 2022-01-18 19:37:03 -08:00
Jacques Pienaar d5db25fb1d [mlir][textmate] Add support for function visibility
Avoids functions with visibility not being marked as functions. Tested
via Lightshow.
2022-01-18 18:48:43 -08:00
Louis Dionne a00f3e2d09 [libc++] Re-enable the _BitInt test for std::atomic on Clang 14
It should now work since the Clang on CI nodes has been updated.

Differential Revision: https://reviews.llvm.org/D115256
2022-01-18 21:32:22 -05:00
Michael Gottesman 7ed95d1577 [debug-info] Add support for llvm.dbg.addr in DIBuilder.
I based this off of the API already create for llvm.dbg.value since both
intrinsics have the same arguments at the API level.

I added some tests exercising the API a little as well as an additional small
test that shows how one can use llvm.dbg.addr to limit the PC range where an
address value is available in the debugger. This is done by calling
llvm.dbg.value with undef and the same metadata info as one used to create the
llvm.dbg.addr.

rdar://83957028

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D117442
2022-01-18 18:26:50 -08:00
Hongtao Yu ff0b634d97 [CSSPGO] Print "context-nested" instead of "preilnined" for ProfileSummarySection.
Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D117141
2022-01-18 18:10:42 -08:00
Daniel Thornburgh 2e2999cd44 [NFC] Test commit to verify commit access. 2022-01-18 18:03:26 -08:00
Chuanqi Xu c8ecf12bc3 [Coroutines] Offering llvm.coro.align intrinsic
It is a known problem that we can't align the switch-based coroutine
frame if the alignment exceeds std::max_align_t (which is 16 usually).

We could solve the problem on the middle-end by dynamically transforming
or in the frontend by emitting aligned allocation function.

If we need to solve it in the frontend, the middle end need to offer an
intrinsic to tell the alignment at least. This patch tries to offer such
an intrinsic called llvm.coro.align.

Reviewed By: https://reviews.llvm.org/D117542

Differential revision: https://reviews.llvm.org/D117542
2022-01-19 09:52:45 +08:00
minglotus-6 76b74236c7 Update bitcode format doc to mention that a multi-module bitcode file is
valid.

Differential Revision: https://reviews.llvm.org/D117067
2022-01-18 17:49:34 -08:00
Fangrui Song 5f404a749a [ELF] De-template InputSectionBase::getLocation. NFC 2022-01-18 17:33:58 -08:00
Jonas Devlieghere d230848a85 [lldb] Print an error message when we're reading libobjc.A.dylib from memory
Use libobjc.A.dylib as a sentinel to detect situations where we're
reading libraries from process memory instead of the shared cache.

Differential revision: https://reviews.llvm.org/D117623
2022-01-18 17:23:38 -08:00
Fangrui Song eafd34581f [ELF] Simplify/optimize EhInputSection::split
and change some `fatal` to `errorOrWarn`.

EhFrame.cpp is a helper file. We don't place all .eh_frame implementation there,
so the code move is fine.
2022-01-18 17:03:23 -08:00
Jessica Clarke b6a93967d9 [NFC][libunwind] Fix uintptr_t vs size_t confusion for lengths
These two are not conceptually the same; the former is a pointer shoved
in an integer, the latter is an offset or length. On the architectures
supported by libunwind, these two have the same underlying type, namely
unsigned int on ILP32, unsigned long on LP64 and unsigned long long on
LLP64. However, on CHERI, and thus Arm's Morello, they are not the same,
as pointers are hardware capabilities that carry additional metadata
including bounds and permissions, which is preserved in uintptr_t but
not in size_t. Thus, fix all length variables to be of type size_t not
uintptr_t, as we have done downstream for a while in CHERI LLVM but did
not get round to upstreaming.

Note that dyld_unwind_sections is currently defined in Apple's headers
as genuinely using uintptr_t to represent lengths. This is a bad API and
should be fixed, which would be totally API and ABI compatible due to
size_t and uintptr_t being the same type on all supported Apple systems,
but our definition is left matching theirs until such a time as they fix
their bogus types.

This is intended to be an NFC change on all architectures supported by
LLVM upstream, only being a functional change for CHERI downstream in
CHERI LLVM.
2022-01-19 00:05:30 +00:00
Matt Arsenault e3dd47f987 AMDGPU: Fix using deprecated buffer intrinsics in test 2022-01-18 19:02:47 -05:00
Ben Langmuir fa40c53960 [llvm-jitlink] Prevent dead-stripping of test callback
`llvm_jitlink_setTestResultOverride` is used via runtime lookup by
tests, so make sure it is not dead-stripped from llvm-jitlink in release
builds.

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

Differential Revision: https://reviews.llvm.org/D117609
2022-01-18 15:57:46 -08:00
Benjamin Kramer 355acf2bef [bazel] Port 755dc07d69
Still a fair bit of spaghetti in the unittest rules
2022-01-19 00:57:22 +01:00
Vincent Lee e5347f2556 [lld-macho] Allow deduplicate-literals to be overridden
It's still uncertain but whether we want to have `deduplicate-literals` be the
default flag for LLD out of the box or not. If `deduplicate-literals` is the default
behavior, then we will need a way override it and not deduplicate. Luckily, we
have `no_deduplicate` to fill this gap. For now, I've set the default to be false
which aligns with the existing behavior. That can only always be changed after
discussions on D117250.

Reviewed By: #lld-macho, int3

Differential Revision: https://reviews.llvm.org/D117387
2022-01-18 15:42:59 -08:00
Peter Klausler a567961574 [flang] Better messages for function vs. array errors
When a scalar-valued function with no distinct RESULT
is being called recursively in its own executable part,
emit a better message about the error.  Clean up the
code that resolves function vs. array ambiguities in
expression semantics.

Update to address review comment

Differential Revision: https://reviews.llvm.org/D117577
2022-01-18 15:42:08 -08:00
Philip Reames 215bd46905 [MemoryBuiltins] Demote isMallocLikeFn to implementation routine since last use has been removed
Try 2, this time including the test.
2022-01-18 15:24:52 -08:00
Joseph Huber 4863fed933 [Libomptarget] Fix external visibility for internal variables
After the changes in D117362 made variables declared inside of a target
declare directive visible outside the plugin, some variables inside the
runtime were given visiblity that conflicted with their address space
type. This caused problems when shared or local memory was made
externally visible. This patch fixes this issue by making these
varialbes static within the module, therefore limiting their visibility
to being internal.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D117526
2022-01-18 18:19:57 -05:00
Joseph Huber ca6c9e43ea [OpenMP] Remove hidden visibility for declare target variables
This patch changes the visiblity of variables declared within a declare
target directive. Variable declarations within a declare target
directive need to be externally visible to the plugin for initialization
or reading. Previously this would cause runtime errors where the named
global could not be found because it was not included in the symbol
table.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D117362
2022-01-18 18:19:57 -05:00
Philip Reames fcab2d1309 Revert "[MemoryBuiltins] Demote isMallocLikeFn to implementation routine since last use has been removed"
This reverts commit 167af7bbfe. Buildbot breaks since I forgot to remove a unit test.
2022-01-18 15:16:12 -08:00
Philip Reames 167af7bbfe [MemoryBuiltins] Demote isMallocLikeFn to implementation routine since last use has been removed 2022-01-18 15:12:07 -08:00
Peter Klausler 047884e71e [flang] runtime: catch OPEN(ACCESS='DIRECT',POSITION=)
A POSITION= specifier may not be used on a direct access file.

Differential Revision: https://reviews.llvm.org/D117596
2022-01-18 14:54:53 -08:00
Peter Klausler e847b30369 [flang] runtime error on inappropriate OPEN(UNIT=extant,RECL=n)
Don't let a program set a fixed RECL= on a connected unit unless
it already had one with the same value.

Differential Revision: https://reviews.llvm.org/D117595
2022-01-18 14:54:27 -08:00
Philip Reames 17beee44e1 [LangRef] Clarify that inaccessiblememonly functions are allowed noalias returns
Confusion over this point came up in a couple of recent changes (D117180, e20b32ff3). Current tone of discussion seems to be that we think inaccessiblememonly was always legal on allocation functions, so this change takes the form of a clarification instead of a change.

Differential Revision: https://reviews.llvm.org/D117571
2022-01-18 14:47:46 -08:00
Benjamin Kramer ff5de8a9e0 [linalg][fusion] Disallow fusion when it would create an invalid expand_shape
The input type of a linalg.generic can be less dynamic than its output
type. If this is the case moving a reshape across the generic op would
create invalid IR, as expand_shape cannot expand arbitrary dynamic
dimensions.

Check that the reshape is actually valid before creating the
expand_shape. This exposes the existing verification logic in reshape
utils and removes the incomplete custom implementation in fusion.

Differential Revision: https://reviews.llvm.org/D116600
2022-01-18 23:44:14 +01:00
Benjamin Kramer f100bedb03 [mlir][linalg] Insert a cast for identity linalg.generics when the types don't match
This can happen when the result has different dynamic dimensions than
the input.

Differential Revision: https://reviews.llvm.org/D117498
2022-01-18 23:44:14 +01:00
Mogball 7294d7dae7 [mlir] Fix bazel build of GPU dialect 2022-01-18 22:41:04 +00:00