Commit graph

420116 commits

Author SHA1 Message Date
Andrzej Warzynski dda366ed37 [flang][cmake] Make CMake copy "omp_lib.h" into the build directory
Any header or module file in the Flang source directory is of no use to
the compiler unless it is copied into the build directory. Indeed, all
compiler search paths are relative to the compiler executable (flang-new
in our case). Hence, "omp_lib.h" should be copied into the build
directory alongside other compiler-provided files that can be "included"
(header files) or "used" (module files).

For now, "omp_lib.h" is copied into "<build-dir>/include/flang/OpenMP".
We may decide to change this in future. For example, Clang copies a
bunch of runtime headers into “<build-dir>/lib/clang/<version-number>”.
We could also consider using a similar header from a different
sub-project.

Flang's driver search path is updated accordingly. A rule for
"installing" the "omp_lib.h" header is _yet to be added_ (we will also
need to determine the suitable location for this).

Differential Revision: https://reviews.llvm.org/D122015
2022-04-05 08:25:26 +00:00
Mehdi Amini d2ca2b94fd Apply clang-tidy fixes for readability-redundant-control-flow in FuncToLLVM.cpp (NFC) 2022-04-05 08:19:33 +00:00
Nikita Popov d69e9f9d89 [OpaquePtrs][Clang] Add -opaque-pointers/-no-opaque-pointers cc1 options
This adds cc1 options for enabling and disabling opaque pointers
on the clang side. This is not super useful now (because
-mllvm -opaque-pointers and -Xclang -opaque-pointers have the same
visible effect) but will be important once opaque pointers are
enabled by default in clang. In that case, it will only be
possible to disable them using the cc1 -no-opaque-pointers option.

Differential Revision: https://reviews.llvm.org/D123034
2022-04-05 10:15:41 +02:00
Alexander Belyaev cc6788aece [mlir] Update mlir/BUILD.bazel. 2022-04-05 10:14:41 +02:00
Muhammad Omair Javaid 0320115c16 Revert "[CodeGen] Async unwind - add a pass to fix CFI information"
This reverts commit 980c3e6dd2.

This commit had failing tests with clang crashing across various
AArch64/Linux buildots.

https://lab.llvm.org/buildbot/#/builders/179/builds/3346

Differential Revision: https://reviews.llvm.org/D114545
2022-04-05 13:12:30 +05:00
Alexander Belyaev 64f659bee6 [mlir] Rewrite canonicalization of collapse(expand) and expand(collapse).
Differential Revision: https://reviews.llvm.org/D122666
2022-04-05 10:03:07 +02:00
Adrian Kuegel 72fe439a4e [mlir] Fix 1 ClangTidyPerformance finding (NFC) 2022-04-05 09:29:35 +02:00
Max Kazantsev 9a2798c7a3 [CodeGen][NFC] Hoist budget check out of loop
Less computations & early exit if we know for sure that the limit will be exceeded.
2022-04-05 14:20:42 +07:00
Evgeniy Brevnov 970ae8376e An attempt to fix problem with building
Transforms/Utils/MemTransferLowerTest
2022-04-05 14:12:00 +07:00
Simon Pilgrim 7120c67c04 Revert rG5adc94bb8a23eb819f6ca80e722f5b0e6e41401d "New regression test against expandMemCpyAsLoop utility"
This was causing link errors on buildbots (and locally)
2022-04-05 08:11:21 +01:00
Luboš Luňák 76bc772920 [lldb][gui] make 'step out' step out of the selected frame
Differential Revision: https://reviews.llvm.org/D123001
2022-04-05 08:29:13 +02:00
Luboš Luňák f90fa55569 [lldb][gui] use just '#2' instead of 'frame #2' in the threads/frame view
Since the threads/frame view is taking only a small part on the right side
of the screen, only a part of the function name of each frame is visible.
It seems rather wasteful to spell out 'frame' there when it's obvious
that it is a frame, it's better to use the space for more of the function
name.

Differential Revision: https://reviews.llvm.org/D122998
2022-04-05 08:29:13 +02:00
Luboš Luňák aaca2acd5f [lldb][gui] do not show the help window on first gui startup
It's rather annoying if it's there after every startup,
and that 'Help (F6)' at the top should be enough to help people
who don't know.

Differential Revision: https://reviews.llvm.org/D122997
2022-04-05 08:29:13 +02:00
Maksim Panchenko 163e188e3e [BOLT][test] Fix AArch64 test
Remove header dependency from cross-platform test.

Reviewed By: yota9

Differential Revision: https://reviews.llvm.org/D123107
2022-04-04 23:28:47 -07:00
Evgeniy Brevnov 5adc94bb8a New regression test against expandMemCpyAsLoop utility
Unit test for functionality going to be added by D118441

Differential Revision: https://reviews.llvm.org/D118440
2022-04-05 13:28:13 +07:00
Min-Yih Hsu 18b38ff6c7 [M68k] Adopt VarLenCodeEmitter for move instructions
The `move` instruction has one of the most complicate sets of variants, so
we're refactoring it first before finishing up rest of the data
instructions in a separate patch.

Note that since we're introducing more `move` variants, the codegen
actually got improved in terms of code size.
2022-04-04 23:02:27 -07:00
Maksim Panchenko f927106e10 [BOLT][test] Enable cross-target testing
Check for supported target architecture instead of the host arch when
deciding to execute non-runtime tests.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D122498
2022-04-04 23:00:54 -07:00
Maksim Panchenko f0f5d19a36 [BOLT][test] Fix X86 cross-platform tests
Use target-specific flags for building X86 non-runnable tests.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D123072
2022-04-04 22:25:42 -07:00
Brad Smith 4875ff1dc9 [RISCV] Remove redundant enabling of IAS for Clang, NFC
Generic_GCC::IsIntegratedAssemblerDefault() already takes care of RISCV.

Reviewed By: kito-cheng, MaskRay

Differential Revision: https://reviews.llvm.org/D123097
2022-04-04 23:44:49 -04:00
Wei Xiao ca33d74ca5 [X86] Improve x86-partial-reduction to support abs intrinsic
Current implementation only recognizes absolute operation implemented by
select instruction. This patch adds support for abs intrinsic.

Differential Revision: https://reviews.llvm.org/D122777
2022-04-05 11:32:09 +08:00
wren romano 72ec2f7639 [mlir][sparse] Factoring out finalizeSegment and (generic) appendIndex
This change introduces two new methods: `finalizeSegment` and `appendIndex`; and removes three old methods: `endDim`, `appendCurrentPointer`, `appendIndex`.  The two new methods better encapsulate their algorithms, thus allowing to remove repetitious code in several other places.

Depends On D122435

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D122625
2022-04-04 19:11:31 -07:00
Volodymyr Sapsai 29444f0444 [modules] Merge ObjC interface ivars with anonymous types.
Without the fix ivars with anonymous types can trigger errors like

> error: 'TestClass::structIvar' from module 'Target' is not present in definition of 'TestClass' provided earlier
> [...]
> note: declaration of 'structIvar' does not match

It happens because types of ivars from different modules are considered
to be different. And it is caused by not merging anonymous `TagDecl`
from different modules.

To fix that I've changed `serialization::needsAnonymousDeclarationNumber`
to handle anonymous `TagDecl` inside `ObjCInterfaceDecl`. But that's not
sufficient as C code inside `ObjCInterfaceDecl` doesn't use interface
decl as a decl context but switches to its parent (TranslationUnit in
most cases).  I'm changing that to make `ObjCContainerDecl` the lexical
decl context but keeping the semantic decl context intact.

Test "check-dup-decls-inside-objc.m" doesn't reflect a change in
functionality but captures the existing behavior to prevent regressions.

rdar://85563013

Differential Revision: https://reviews.llvm.org/D118525
2022-04-04 18:48:30 -07:00
Michael Kruse c7bd9dcb06 [docs] Add Loop Opt WG meeting ics.
Add ics file for biweekly loop optimization meeting.

Reviewed By: #loopoptwg, bmahjour

Differential Revision: https://reviews.llvm.org/D120343
2022-04-04 20:07:51 -05:00
Arjun P b238c252e8 Revert "[MLIR][Presburger] IntegerPolyhedron: add support for symbolic integer lexmin"
This reverts commit da92f92621.
2022-04-05 00:31:17 +01:00
Arjun P da92f92621 [MLIR][Presburger] IntegerPolyhedron: add support for symbolic integer lexmin
Add support for computing the symbolic integer lexmin of a polyhedron.
This finds, for every assignment to the symbols, the lexicographically
minimum value attained by the dimensions. For example, the symbolic lexmin
of the set

`(x, y)[a, b, c] : (a <= x, b <= x, x <= c)`

can be written as

```
x = a if b <= a, a <= c
x = b if a <  b, b <= c
```

This also finds the set of assignments to the symbols that make the lexmin unbounded.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D122985
2022-04-05 00:24:57 +01:00
David Green 3b9833597e [AArch64] Alter mull buildvectors(ext(..)) combine to work on shuffles
D120018 altered this combine to work on buildvectors as opposed to
shuffle dup's. This works well for dups and other things that are
expanded into buildvectors. Some shuffles are legal though, and stay as
vector_shuffle through lowering. This expands the transform to also
handle shuffles, so that we can turn mul(shuffle(sext into
mul(sext(shuffle and more readily make smull/umull instructions. This
can come up from the SLP vectorizer adding shuffles that are costed from
extends.

Differential Revision: https://reviews.llvm.org/D123012
2022-04-04 23:07:47 +01:00
David Green a70480dd13 [AArch64] Add some tests for mul(shuffle(ext. NFC 2022-04-04 22:54:55 +01:00
Louis Dionne 9a44ed43cf [libc++] Implement tests for private headers using the new generator
Differential Revision: https://reviews.llvm.org/D123028
2022-04-04 17:44:47 -04:00
River Riddle 1269f96d2e [mlir] Add MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID to SerializeToCubinPass
This pass is defined in an anonymous namespace and requires an explicit TypeID
2022-04-04 14:28:10 -07:00
Lei Zhang f1a7e508a5 [mlir][spirv] Check nullptr before usage to fix crash
Reviewed By: mravishankar, hanchung

Differential Revision: https://reviews.llvm.org/D123035
2022-04-04 17:20:00 -04:00
Jason Molenda 7ebcd8891a Add DumpBinaryEscaped method to JSONGenerator, avoid extra copy
All uses of JSONGenerator in debugserver would create a JSON text
dump of the object collection, then copy that string into a
binary-escaped string, then send it up to the lldb side or
make a compressed version and send that.

This adds a DumpBinaryEscaped method to JSONGenerator which
does the gdb remote serial protocol binary escaping directly,
and removes the need to pass over the string and have an
additional copy in memory.

Differential Revision: https://reviews.llvm.org/D122882
rdar://91117456
2022-04-04 14:14:02 -07:00
Amir Ayupov 686406a006 [BOLT][NFC] Use X86 mnemonic checks
Remove switches in X86MCPlusBuilder.cpp, use mnemonic checks instead

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D122853
2022-04-04 14:05:46 -07:00
River Riddle 5e50dd048e [mlir] Rework the implementation of TypeID
This commit restructures how TypeID is implemented to ideally avoid
the current problems related to shared libraries. This is done by changing
the "implicit" fallback path to use the name of the type, instead of using
a static template variable (which breaks shared libraries). The major downside to this
is that it adds some additional initialization costs for the implicit path. Given the
use of type names for uniqueness in the fallback, we also no longer allow types
defined in anonymous namespaces to have an implicit TypeID. To simplify defining
an ID for these classes, a new `MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID` macro
was added to allow for explicitly defining a TypeID directly on an internal class.

To help identify when types are using the fallback, `-debug-only=typeid` can be
used to log which types are using implicit ids.

This change generally only requires changes to the test passes, which are all defined
in anonymous namespaces, and thus can't use the fallback any longer.

Differential Revision: https://reviews.llvm.org/D122775
2022-04-04 13:52:26 -07:00
Martin Storsjö dba90d74be [libcxx] Stop recommending setting LIBCXX_HAS_WIN32_THREAD_API in the MinGW builds
Since a8d15a9266 / D110975, this is
the default, even if winpthread headers are available, so we don't
need to cargo cult setting this option in all builds.

Differential Revision: https://reviews.llvm.org/D122717
2022-04-04 23:07:40 +03:00
Aaron Ballman ee8a92b637 Require C99 for more tests; NFC intended
This augments 5d90004874 which got all of
the -verify lines, but accidentally missed all of the -verify= ones.
2022-04-04 15:58:26 -04:00
wren romano 3bf2ba3b9a [mlir][sparse] Simplifying code in expInsert
Just some minor cleanup

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D122934
2022-04-04 12:53:42 -07:00
Rob Suderman 126e7eaf0d [tosa] Add option to disable tosa.apply_scale lowering in TosaToStandard
Apply scale should be optionally disabled when lowering via TosaToStandard.
In most cases it should persist until the lowering to specific backend.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D122948
2022-04-04 12:22:12 -07:00
Sam McCall 6f3f1e9868 [clangd] Remove trivial uses of FileEntry::getName
It's deprecated; migrate to FileEntryRef::getName where it doesn't matter.
Also change one subtle case of implicit FileEntry::getName to be explicit.

After this patch, all the remaining FileEntry::getName calls are subtle
cases where we may be relying on exactly which filename variant is returned
(for indexing, IWYU directive handling, etc).
2022-04-04 20:59:51 +02:00
Simon Pilgrim ffe0cc82db [X86] Add XOR(X, MIN_SIGNED_VALUE) -> ADD(X, MIN_SIGNED_VALUE) isel patterns (PR52267)
Improve chances of folding to LEA patterns

Differential Revision: https://reviews.llvm.org/D123043
2022-04-04 19:47:06 +01:00
Daniel Resnick e394c4e5d9 [mlir][capi] Fix leak in test 2022-04-04 12:26:13 -06:00
Mehdi Amini dacb2713c4 Apply clang-tidy fixes for llvm-qualified-auto in FuncToLLVM.cpp (NFC) 2022-04-04 18:18:10 +00:00
Mitch Phillips 786c89fed3 [ELF][MTE] Add --android-memtag-* options to synthesize ELF notes
This ELF note is aarch64 and Android-specific. It specifies to the
dynamic loader that specific work should be scheduled to enable MTE
protection of stack and heap regions.

Current synthesis of the ".note.android.memtag" ELF note is done in the
Android build system. We'd like to move that to the compiler. This patch
adds the --memtag-stack, --memtag-heap, and --memtag-mode={async, sync,
none} flags to the linker, which synthesises the note for us.

Future changes will add -fsanitize=memtag* flags to clang which will
pass these through to lld.

Depends on D119381.

Differential Revision: https://reviews.llvm.org/D119384
2022-04-04 11:17:36 -07:00
Vang Thao 45c2371c0d [AMDGPU] Ignore debug use during PreRARematerialize stage in scheduling pass
Ignore all debug uses when collecting trivially rematerializable defs. This fixes an issue with difference in codegen when enabling debug info.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D123048
2022-04-04 11:15:06 -07:00
Siva Chandra Reddy 83f153ce34 [libc] Add pthread_mutexattr_t type and its setters and getters.
A simple implementation of the getters and setters has been added. More
logic can be added to them in future as required.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D122969
2022-04-04 18:11:12 +00:00
Daniel Grumberg 422d05e792 [clang][extract-api][NFC] Add documentation
Add struct level documentation for MacroDefinitionRecord.

Differential Revision: https://reviews.llvm.org/D122798
2022-04-04 18:59:44 +01:00
Louis Dionne 13796495ec [libc++] Fix std::is_array<T[0]> and add tests
Differential Revision: https://reviews.llvm.org/D122810
2022-04-04 13:55:18 -04:00
Aaron Ballman 5d90004874 Require C99 for these tests; NFC intended
The tests are doing -verify and testing a diagnostic behavior, but that
behavior is changing. This ensures the tests continue to run and check
the diagnostic.

The behavior of the tests is expected to remain identical as before.
2022-04-04 13:43:27 -04:00
Johannes Doerfert 79962df386 [Attributor] Allow to reproduce instructions for simplification
When simplify values we might end up with an instruction from a
different scope or just one that does not dominate the use. If the
instruction can be reproduced without side-effect (incl. UB) we can
now do that. For now this is mostly used for speculatable (intrinsic)
calls but as we learn to make things like arguments or loads available
this will become more powerful.

This will also allow us to remove dead stores more easily in a follow
up.
2022-04-04 12:28:08 -05:00
antonio-cortes-perez c2a8a104ec [MLIR][NFC] Remove unnecessary cast.
I was reading this post:
https://www.fluentcpp.com/2017/05/19/crtp-helper/

And I noticed that most likely this cast is not needed.
Unless it is needed by some compiler versions.
I tested it with:
cmake --build . --target check-mlir

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D121555
2022-04-04 09:46:24 -07:00
Florian Hahn 368d35a894
[LV] Add addiitonal tests for pointer difference memory checks.
Additional tests for D119078.
2022-04-04 17:58:48 +01:00