Commit Graph

430612 Commits

Author SHA1 Message Date
Augusto Noronha 1d057a6d43 Revert "[libc++] Use uninitialized algorithms for vector"
This reverts commit 23cf42e706.
2022-07-21 14:19:20 -07:00
LLVM GN Syncbot 31049b3d2b [gn build] Port 1dad6247d2 2022-07-21 20:54:39 +00:00
Daniel Thornburgh cc0a1078f5 Fix use after free in MarkupFilter.cpp 2022-07-21 13:52:24 -07:00
Chi Chun Chen ccc12a2376 [OpenMP][NFC] Claim iterators in 'map' clause and motion clauses 2022-07-21 15:50:22 -05:00
Joseph Huber 3e8d46921f [Libomptarget] Stop testing CPU offloading with LTO
Summary:
Some of the buildbots don't find the libraries because they don't build
for the GPU. Although it should always be there it's unclear why these
buildbots are having problemsd. LTO is only interesting on the GPU and
these tests take extra time anyway so I'm just going to disable them for
now.
2022-07-21 16:47:41 -04:00
Teresa Johnson 1dad6247d2 [MemProf] Add memprof metadata related analysis utilities
Adds a number of utilities that are used to help create and update
memprof related metadata. These will be used during profile matching
and annotation, as well as by the inliner when updating the metadata.
Also adds unit tests for the utilities.

See also related RFCs:
RFC: Sanitizer-based Heap Profiler [1]
RFC: A binary serialization format for MemProf [2]
RFC: IR metadata format for MemProf [3]
(Note that the IR metadata format has changed from the RFC during
implementation, as described in the preceeding patch adding the basic
metadata and verification support.)

Depends on D128141.

Differential Revision: https://reviews.llvm.org/D128854
2022-07-21 13:46:01 -07:00
Sam McCall 3132e9cd7c [pseudo] Key guards by RuleID, add guards to literals (and 0).
After this, NUMERIC_CONSTANT and strings should parse only one way.

There are 8 types of literals, and 24 valid (literal, TokenKind) pairs.
This means adding 8 new named guards (or 24, if we want to assert the token).

It seems fairly clear to me at this point that the guard names are unneccesary
indirection: the guards are in fact coupled to the rule signature.

(Also add the zero guard I forgot in the previous patch.)

Differential Revision: https://reviews.llvm.org/D130066
2022-07-21 22:42:31 +02:00
Ziqing Luo b17baa1db6 [ASTMatchers] Adding a new matcher for callee declarations of Obj-C
message expressions

For an Obj-C message expression `[o m]`, the adding matcher will match
the declaration of the method `m`.  This commit overloads the existing
`callee` ASTMatcher, which originally was only for C/C++ nodes but
also applies to Obj-C messages now.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D129398
2022-07-21 13:35:31 -07:00
Siva Chandra Reddy 7c666c14f8 [libc] Add a convenience class and function for integer to string conversion.
Printf's integer converter has been modified to use the new converter. In
future, it will be used to implement other parts of the libc.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D130227
2022-07-21 20:18:59 +00:00
Martin Storsjö 606348cc72 [MinGW] Don't currently set visibility=hidden when building for MinGW
If we build the Target libraries with -fvisibility=hidden, then
LLVM_EXTERNAL_VISIBILITY must also be able to override it back
to default visibility.

Currently, the LLVM_EXTERNAL_VISIBILITY define is a no-op for
mingw targets, thus set CMAKE_CXX_VISIBILITY_PRESET correspondingly.

This unbreaks the mingw dylib build, if the compiler actually
takes hidden visiblity into account (e.g. after D130121).

(Later, once hidden visiblity can be used for MinGW targets, we
can make LLVM_EXTERNAL_VISIBILITY and LLVM_LIBRARY_VISIBILITY expand
to actual attributes, and reverse this commit.)

Differential Revision: https://reviews.llvm.org/D130200
2022-07-21 23:16:33 +03:00
Philip Reames 83993d666b [LV][SVE] Autogen a test for ease of update 2022-07-21 13:12:53 -07:00
Jacques Pienaar 72686d68c1 [mlir] Explicitly mark dialect prefixing
Missed previously and needed to flip the default. Most of these just
flipped to _Raw to retain existing state/keep this small except for TOSA
dialect which got flipped to _Both as no further change was needed..
2022-07-21 12:58:19 -07:00
Augie Fackler a4ee8a31ce [bazel] add headers now required after 17e4c217b6 2022-07-21 15:39:29 -04:00
Augie Fackler bd6aa67e02 BuildLibCalls: move inference of freeing memory later
This probably should have been part of D123089, but the effects of it
don't show up until we start removing functions from the table in
D130107. Oops.

Differential Revision: https://reviews.llvm.org/D130184
2022-07-21 15:31:16 -04:00
Augie Fackler 62f48cadfd MemoryBuiltins: accept non-TLI funcs with attribs as allocator funcs
This allows us to accept annotations from out-of-tree languages (the
example test is derived from Rust) so they can enjoy the benefits of
LLVM's optimizations without requiring LLVM to have language-specific
knowledge.

Differential Revision: https://reviews.llvm.org/D123091
2022-07-21 15:31:16 -04:00
Augie Fackler 5a3e3675f6 MemoryBuiltins: start using properties of functions
Prior to this change, we relied on the hard-coded list for all of the
information performed by MemoryBuiltins. With this change, we're able to
start relying on properites of functions described in attributes, which
opens the door to out-of-tree compilers being able to describe their
allocator functions to LLVM's optimizer logic without having to register
their implementation details with LLVM.

Differential Revision: https://reviews.llvm.org/D123090
2022-07-21 15:31:15 -04:00
Sanjay Patel 78c09f0f24 [PatternMatch][InstCombine] match a vector with constant expression element(s) as a constant expression
The InstCombine test is reduced from issue #56601. Without the more
liberal match for ConstantExpr, we try to rearrange constants in
Negator forever.

Alternatively, we could adjust the definition of m_ImmConstant to be
more conservative, but that's probably a larger patch, and I don't
see any downside to changing m_ConstantExpr. We never capture and
modify a ConstantExpr; transforms just want to avoid it.

Differential Revision: https://reviews.llvm.org/D130286
2022-07-21 15:23:57 -04:00
Sanjay Patel b03891268c [PatternMatch] add tests for constant expression matcher; NFC 2022-07-21 15:23:57 -04:00
Arthur Eubanks 04d398db46 [LoopAccessAnalysis] Simplify D119047
No need to add checks for every type per pointer that we couldn't create
a check for the first time around, just the types that weren't
successful.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D119376
2022-07-21 12:16:02 -07:00
Philip Reames 27945f9282 [RISCV][LV] Split coverage of uniform load with outside use
Turns out this has a large effect of tail folding, so split out a single test to cover that case and remove it from the others.
2022-07-21 12:07:26 -07:00
John Ericson 07b749800c [cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore
First of all, `LLVM_TOOLS_INSTALL_DIR` put there breaks our NixOS
builds, because `LLVM_TOOLS_INSTALL_DIR` defined the same as
`CMAKE_INSTALL_BINDIR` becomes an *absolute* path, and then when
downstream projects try to install there too this breaks because our
builds always install to fresh directories for isolation's sake.

Second of all, note that `LLVM_TOOLS_INSTALL_DIR` stands out against the
other specially crafted `LLVM_CONFIG_*` variables substituted in
`llvm/cmake/modules/LLVMConfig.cmake.in`.

@beanz added it in d0e1c2a550 to fix a
dangling reference in `AddLLVM`, but I am suspicious of how this
variable doesn't follow the pattern.

Those other ones are carefully made to be build-time vs install-time
variables depending on which `LLVMConfig.cmake` is being generated, are
carefully made relative as appropriate, etc. etc. For my NixOS use-case
they are also fine because they are never used as downstream install
variables, only for reading not writing.

To avoid the problems I face, and restore symmetry, I deleted the
exported and arranged to have many `${project}_TOOLS_INSTALL_DIR`s.
`AddLLVM` now instead expects each project to define its own, and they
do so based on `CMAKE_INSTALL_BINDIR`. `LLVMConfig` still exports
`LLVM_TOOLS_BINARY_DIR` which is the location for the tools defined in
the usual way, matching the other remaining exported variables.

For the `AddLLVM` changes, I tried to copy the existing pattern of
internal vs non-internal or for LLVM vs for downstream function/macro
names, but it would good to confirm I did that correctly.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D117977
2022-07-21 19:04:00 +00:00
Jacques Pienaar a1ec0d8bdc [mlir] Flip dialects to _Prefixed
At least two weeks passed since flipped to _Both. Made some additional
NFC changes in .td files that were not converted earlier.
2022-07-21 12:03:07 -07:00
Daniel Thornburgh 6605187103 [NFC] Fix compiler warning in MarkupFilter 2022-07-21 12:00:29 -07:00
Slava Zakharin 9c0acc42e8 [flang] Run algebraic simplification optimization pass.
Try 2 to merge 4fbd1d6c87.

Flang algebraic simplification pass will run algebraic simplification
rewrite patterns for Math/Complex/etc. dialects. It is enabled
under opt-for-speed optimization levels (i.e. for O1/O2/O3; Os/Oz will not
enable it).

With this change the FIR/MLIR optimization pipeline becomes affected
by the -O* optimization level switches. Until now these switches
only affected the middle-end and back-end.

Differential Revision: https://reviews.llvm.org/D130035
2022-07-21 11:43:39 -07:00
George Petterson a935a0bf50 Adding a new variant of DepthwiseConv2D
This is the same as the existing multiplier-1 variant of DepthwiseConv2D, but in PyTorch dim order.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D128575
2022-07-21 14:36:57 -04:00
Daniel Thornburgh 17e4c217b6 [Symbolizer] Implement contextual symbolizer markup elements.
This change implements the contextual symbolizer markup elements: reset,
module, and mmap. These provide information about the runtime context of
the binary necessary to resolve addresses to symbolic values.

Summary information is printed to the output about this context.
Multiple mmap elements for the same module line are coalesced together.
The standard requires that such elements occur on their own lines to
allow for this; accordingly, anything after a contextual element on a
line is silently discarded.

Implementing this cleanly requires that the filter drive the parser;
this allows skipped sections to avoid being parsed. This also makes the
filter quite a bit easier to use, at the cost of some unused
flexibility.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D129519
2022-07-21 11:29:19 -07:00
Zequan Wu 4979b16db1 [llvm-cov] Improve error message by printing the object file name that produces error
If error occurs on constructing coverage info for one of the object files, it prints the name of the object file, so that users know which one is the cause of error.

Differential Revision: https://reviews.llvm.org/D130196
2022-07-21 11:26:51 -07:00
Zequan Wu d870a57563 [SemaCXX] Set promotion type for enum if its type is promotable to integer type even if it has no definition.
EnumDecl's promotion type is set either to the parsed type or calculated type
after completing its definition. When it's bool type and has no definition,
its promotion type is bool which is not allowed by clang.

Fixes #56560.

Differential Revision: https://reviews.llvm.org/D130210
2022-07-21 11:23:21 -07:00
Philip Reames bb5dc2918f {RISCV][LV] Add tail folding coverage of uniform load store cases 2022-07-21 11:15:36 -07:00
Philip Reames 56a25ed208 {RISCV][LV] Add a test for uniform store of a loop varying value 2022-07-21 11:15:36 -07:00
Anubhab Ghosh ab3650d80d [NFC] Empty commit to test commit access 2022-07-21 23:31:28 +05:30
Jez Ng ec315a5fa1 [lld-macho] Fix LOH parsing segfault
`advanceSubsection()` didn't account for the possibility that a section
could have no subsections.

Reviewed By: #lld-macho, thakis, BertalanD

Differential Revision: https://reviews.llvm.org/D130288
2022-07-21 13:59:39 -04:00
Javed Absar 56094296f5 Fix type in documentation
Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D130274
2022-07-21 18:42:31 +01:00
Philip Reames 0ae46693f0 {RISCV][LV] Split out and expand tests for uniform loads and stores 2022-07-21 10:42:18 -07:00
Johannes Doerfert 48d6f52401 [CUDA][FIX] Make shfl[_sync] for unsigned long long non-recursive
A copy-paste error caused UB in the definition of the unsigned long long
versions of the shfl intrinsics. Reported and diagnosed by @trws.

Differential Revision: https://reviews.llvm.org/D129536
2022-07-21 12:36:54 -05:00
Johannes Doerfert d150152615 [OpenMP] Introduce more fine-grained control over the thread state use
We can help optimizations by making sure we use the team state whenever
it is clear there is no thread state. To this end we introduce a new
state flag (`state::HasThreadState`) and explicit control for the
`state::ValueRAII` helpers, including a dedicated "assert equal".

Differential Revision: https://reviews.llvm.org/D130113
2022-07-21 12:30:38 -05:00
Johannes Doerfert 7472b42b78 [OpenMP] Use Undef instead of null as pointer for inactive lanes
Our conditional writes in the runtime look like this:
```
  if (active)
    *ptr = value;
```
In the RAII we need to assign `ptr` which comes from a lookup call.
If a thread that is not the main thread calls lookup with the intention
to write the pointer, we'll create a new thread state. As such, we need
to avoid calling lookup for inactive threads. We used to use `nullptr`
as their `ptr` value but that can cause pessimistic reasoning. We now
use `undef` instead.

Differential Revision: https://reviews.llvm.org/D130114
2022-07-21 12:28:45 -05:00
Johannes Doerfert a42361dc1c [OpenMP] Expose the state in the header to allow non-lto optimizations
We used to inline the `lookup` calls such that the runtime had "known"
access offsets when it was shipped. With the new static library build it
doesn't as the lookup is an indirection we cannot look through. This
should help us optimize the code better until we can do LTO for the
runtime again.

Differential Revision: https://reviews.llvm.org/D130111
2022-07-21 12:28:44 -05:00
Joseph Huber e01ce4e88a [Libomptarget] Add checks for CUDA subarchitecture using new info
This patch extends the `is_valid_binary` routine to also check if the
binary's architecture string matches the one parsed from the runtime.
This should allow us to only use the binary whose compute capability
matches, allowing us to support basic multi-architecture binaries for
CUDA.

Depends on D127432

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D127505
2022-07-21 13:20:06 -04:00
Joseph Huber fbcb1ee7f3 [Libomptarget] Add support for offloading binaries in libomptarget
The previous path changed the linker wrapper to embed the offloading
binary format inside the target image instead. This will allow us to
more generically bundle metadata with these images, such as requires
clauses or the target architecture it was compiled for.

I wasn't sure how to handle this best, so I introduced a new type that
replaces the old `__tgt_device_image` struct that we can expand inside
the runtime library. I made the new `__tgt_device_binary` struct pretty
much the same for now. In the future we could change this struct to
pretty much be the `OffloadBinary` class in the future.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D127432
2022-07-21 13:20:04 -04:00
Joseph Huber 080022d8ed [LinkerWrapper] Embed OffloadBinaries for OpenMP offloading images
The OpenMP offloading runtine currently uses an array of linked
offloading images. One downside to this is that we cannot know the
architecture or triple associated with the given image. In this patch,
instead of embedding the image itself, we embed an offloading binary
instead. This binary is simply a binary format that wraps around the
original linked image to provide some additional metadata. This will
allow us to support offloading to multiple architecture, or performing
future JIT compilation inside of the runtime, more clearly.
Additionally, these can be placed at a special section such that the
supported architectures can be identified using objdump with the support
from D126904. This needs to be stored in a new section name
`.llvm.offloading.images` because the `.llvm.offloading` section
implicitly uses the `SHF_EXCLUDE` flag and will always be stripped.

This patch does not contain the necessary code to parse these in
libomptarget.

Depends on D127246

Reviewed By: saiislam

Differential Revision: https://reviews.llvm.org/D127304
2022-07-21 13:20:01 -04:00
Pengxuan Zheng 53d7bf3052 [llvm-lib] Ignore /VERBOSE flag
Ignore the flag for now, but we can start using it for verbose output if needed.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D130202
2022-07-21 10:06:13 -07:00
Jakub Kuderski 52b630da02 [mlir][spirv] Rename spv.GLSL ops to spv.GL. NFC.
This is to improve consistency within the SPIR-V dialect and make these ops a bit shorter.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D130280
2022-07-21 13:03:30 -04:00
Louis Dionne 448220a884 [libc++] Reorganize release notes
In particular, create sections for deprecations and removals, and also
for announcing upcoming deprecations/removals.
2022-07-21 12:57:27 -04:00
Abraham Corea Diaz 119d22310b [clang] Add -fdiagnostics-format=sarif option for future SARIF output
Adds `sarif` option to the existing `-fdiagnostics-format` flag
for intended future work with SARIF diagnostics. Currently issues a warning
against the use of diagnostics in SARIF mode, then defaults to clang style for
diagnostics.

Reviewed By: cjdb, denik, aaron.ballman

Differential Revision: https://reviews.llvm.org/D129886
2022-07-21 16:51:15 +00:00
Louis Dionne 66e01f47e4 [libc++][NFC] Fix weird unicode character in release notes 2022-07-21 12:47:47 -04:00
Tarun Prabhu b6fef08853 [flang] Lower F08 merge_bits intrinsic.
Lower F08 merge_bits intrinsic.

Differential Revision: https://reviews.llvm.org/D129779
2022-07-21 10:42:25 -06:00
Christopher Bate 297ba167de [mlir][linalg] Add tile_size option to `structured.tile_to_foreach_thread_op`
This change modifies `structured.tile_to_foreach_thread_op` so that
it accepts either `tile_sizes` or `num_threads` parameters. If
`tile_sizes` are specified, then the number of threads required is
derived the tile sizes rather than the other way around. In both cases,
more aggressive folding of loop parameters is enabled during the
transformation, allowing for the potential elimination of `affine.min`
and `affine.max` operations in the static shape case when calculating
the final adjusted tile size.

Differential Revision: https://reviews.llvm.org/D130139
2022-07-21 10:32:01 -06:00
Tarun Prabhu 9e16fb72dd [flang][NFC] Test folding of F08 merge_bits intrinsic.
Test compile-time folding of the F2008 merge_bits intrinsic.

Differential Revision: https://reviews.llvm.org/D129780
2022-07-21 10:30:51 -06:00
Jorge Gorbe Moya fa3a2e611d [lldb][NFCI] Refactor regex filtering logic in CommandObjectTypeFormatterList
Extract a bit of copy/pasted regex filtering logic into a separate
function and simplify it a little bit.

Differential Revision: https://reviews.llvm.org/D130219
2022-07-21 09:22:40 -07:00