platform/upstream/llvm.git
2 years ago[flang] Add missing CFI case for REAL and COMPLEX
Valentin Clement [Wed, 9 Feb 2022 09:07:21 +0000 (10:07 +0100)]
[flang] Add missing CFI case for REAL and COMPLEX

ISO_Fortran_binding.h was updated with missing entries for CFI
types for REAL and COMPLEX kinds 2,3,10,16. This patch updates TypeCode.h
to use these new types.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D119283

2 years agoRevert "[sanitizers] Avoid macro clash in SignalContext::WriteFlag (NFC)"
Nikita Popov [Wed, 9 Feb 2022 09:06:56 +0000 (10:06 +0100)]
Revert "[sanitizers] Avoid macro clash in SignalContext::WriteFlag (NFC)"

This reverts commit fda29264f360820859587acdfb0ad9392c944bd6.

This breaks the sanitizer build on windows, will reapply with
additional changes.

2 years ago[NFC] Fix SSE3 intrinsics test for PowerPC
Qiu Chaofan [Wed, 9 Feb 2022 08:46:51 +0000 (16:46 +0800)]
[NFC] Fix SSE3 intrinsics test for PowerPC

Previous test in ppc-pmmintrin.c did not check IR of intrinsic function
definition. Add them and simplify.

These tests shouldn't be auto-generated, because we don't want to check
wrapper functions.

2 years ago[clang-cl] Bump default -fms-compatibility-version to 19.14
Muhammad Omair Javaid [Tue, 8 Feb 2022 15:25:41 +0000 (20:25 +0500)]
[clang-cl] Bump default -fms-compatibility-version to 19.14

clang-cl MSVC required version is 19.20 now. Update the default
-fms-compatibility-version to 19.14.

Differential Revision: https://reviews.llvm.org/D114639

2 years ago[Support] Fix for two issues with clearing of the internal storage for cl::bits
RVP [Tue, 8 Feb 2022 15:06:53 +0000 (16:06 +0100)]
[Support] Fix for two issues with clearing of the internal storage for cl::bits

This patch fixes two issues with clearing of the internal storage for cl::bits

1. The internal bits storage for cl::bits is uninitialized. This is a problem if a cl::bits option is not defined with static lifetime.
2. ResetAllOptionOccurrences does not reset cl::bits options.

The latter is also discussed in:

https://lists.llvm.org/pipermail/llvm-dev/2021-February/148299.html

Differential Revision: https://reviews.llvm.org/D119066

2 years ago[sanitizers] Avoid macro clash in SignalContext::WriteFlag (NFC)
Nikita Popov [Wed, 2 Feb 2022 14:06:01 +0000 (15:06 +0100)]
[sanitizers] Avoid macro clash in SignalContext::WriteFlag (NFC)

D116208 may cause a macro clash on older versions of linux, where
fs.h defines a READ macro. This is resolved by switching to a more
typical casing style for non-macro symbols.

Differential Revision: https://reviews.llvm.org/D118783

2 years ago[NVPTX] Remove image/sampler special case in call lowering
Nikita Popov [Tue, 8 Feb 2022 11:20:08 +0000 (12:20 +0100)]
[NVPTX] Remove image/sampler special case in call lowering

I suspect that this is dead code. There is no test coverage for
this special case, and the struct type names this checks against
don't seem to match what OpenCL actually generates (which would be
%opencl.sampler_t rather than %struct._sampler_t for example).

Motivation for this change is that this code is incompatible with
opaque pointers -- simply deleting it is the simplest way of
making it compatible :)

Differential Revision: https://reviews.llvm.org/D119229

2 years ago[flang][driver] Add support for `-emit-mlir`
Andrzej Warzynski [Thu, 3 Feb 2022 17:00:27 +0000 (17:00 +0000)]
[flang][driver] Add support for `-emit-mlir`

This patch adds support for generating MLIR files in Flang's frontend
driver (i.e. `flang-new -fc1`). `-emit-fir` is added as an alias for
`-emit-mlir`. We may want to decide to split the two in the future.

A new parent class for code-gen frontend actions is introduced:
`CodeGenAction`. We will be using this class to encapsulate logic shared
between all code-generation actions, but not required otherwise. For
now, it will:
 * run prescanning, parsing and semantic checks,
 * lower the input to MLIR.
`EmitObjAction` is updated to inherit from this class. This means that
the behaviour of `flang-new -fc1 -emit-obj` is also updated (previously,
it would just exit immediately). This change required
`flang/test/Driver/syntax-only.f90` to be updated.

For `-emit-fir`, a specialisation of `CodeGenAction` is introduced:
`EmitMLIRAction`. The key logic for this class is implemented in
`EmitMLIRAction::ExecuteAction`.

Differential Revision: https://reviews.llvm.org/D118985

2 years ago[ArgPromotion] Make implementation offset based
Nikita Popov [Fri, 28 Jan 2022 16:22:58 +0000 (17:22 +0100)]
[ArgPromotion] Make implementation offset based

This rewrites ArgPromotion to be based on offsets rather than GEP
structure. We inspect all loads at constant offsets and remember
which types are loaded at which offsets. Then we promote based on
those types.

This generalizes ArgPromotion to work with bitcasted loads, and
is compatible with opaque pointers.

This patch also fixes incorrect handling of alignment during
argument promotion. Previously, the implementation only checked
that the pointer is dereferenceable, but was happy to speculate
overaligned loads. (I would have fixed this separately in advance,
but I found this hard to do with the previous implementation
approach).

Differential Revision: https://reviews.llvm.org/D118685

2 years ago[flang] catch implicit interface incompatibility with global scope symbol
Jean Perier [Wed, 9 Feb 2022 08:28:27 +0000 (09:28 +0100)]
[flang] catch implicit interface incompatibility with global scope symbol

Previously, when calling a procedure implicitly for which a global scope
procedure symbol with the same name existed, semantics resolved the
procedure name in the call to the global symbol without checking that
the symbol interface was compatible with the implicit interface of the
call.
This could cause expression rewrite and lowering to later badly process
the implicit call assuming a different result type or an explicit
interface. This could lead to lowering crash in case the actual argument
were incompatible with the dummies from the explicit interface.

Emit errors in the following problematic cases:
- If the result type from the symbol did not match the one from the
  implicit interface.
- If the symbol requires an explicit interface.

This patch still allows calling an F77 like procedure with different
actual argument types than the one it was defined with because it is
correctly supported in lowering and is a feature in some program
(it is a pointer cast). The two cases that won't be accepted have
little chance to make much sense. Results returning ABIs may differ
depending on the return types, and function that requires explicit
interface usually requires descriptors or specific processing that
is incompatible with implicit interfaces.

Note that this patch is not making a deep analysis, and it will only
catch mistakes if a global symbol and an implicit interface are
involved. Cases where the user provided a conflicting explicit
interface would still require a pass after name resolution to study
conflicts more deeply. But these cases will not crash lowering or
trigger expression rewrite to do weird things.

Differential Revision: https://reviews.llvm.org/D119274

2 years ago[Sanitizers][test] XFAIL long double tests on Solaris/sparc
Rainer Orth [Wed, 9 Feb 2022 08:20:21 +0000 (09:20 +0100)]
[Sanitizers][test] XFAIL long double tests on Solaris/sparc

As reported in Issue #41838, `clang` doesn't correctly implement `long
double` on 32-bit Solaris/SPARC: the psABI requires this to be an 128-bit
type.  Four sanitizer tests currently `FAIL` for this reason.

While there is a WIP patch to fix `clang` (D89130
<https://reviews.llvm.org/D89130>), it isn't complete yet and I've hit so
many brick walls while trying to finish it that I'm unsure if I ever will.

This patch therefore `XFAIL`s those tests in the meantime.

Tested on `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D119016

2 years ago[pseudo] Add first and follow set computation in Grammar.
Haojian Wu [Fri, 4 Feb 2022 12:54:55 +0000 (13:54 +0100)]
[pseudo] Add first and follow set computation in Grammar.

These will be used when building parsing table for LR parsers.

Separate from https://reviews.llvm.org/D118196.

Differential Revision: https://reviews.llvm.org/D118990

2 years ago[sanitizer_common] Don't try to unmap unaligned memory
Rainer Orth [Wed, 9 Feb 2022 08:15:41 +0000 (09:15 +0100)]
[sanitizer_common] Don't try to unmap unaligned memory

Enabling `sanitizer_common` tests on Solaris (D91606
<https://reviews.llvm.org/D91606>) and SPARC (D91608
<https://reviews.llvm.org/D91608>) uncovered a sparcv9 failure

  SanitizerCommon-Unit :: ./Sanitizer-sparcv9-Test/CompactRingBuffer.int64

like this:

  [ RUN      ] CompactRingBuffer.int64
  ==24576==ERROR: SanitizerTool failed to deallocate 0x2000 (8192) bytes at address 0xffffffff7f59b000
  ==24576==Sanitizer CHECK failed: /vol/llvm/src/llvm-project/local/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp:61 (("unable to unmap" && 0)) != (0) (0, 0)

The problem is that the original allocation via
`MmapAlignedOrDieOnFatalError` is for 4 kB, but the Solaris/sparcv9
pagesize is 8 kB.  So the initial allocation is for 12 kB, rounded to a
multiple of the pagesize.  Afterwards, the unneeded rest is unmapped again,
but this fails since the address is not pagesize-aligned.

This patch avoids this by aligning the end of the mapping to the pagesize.

With D91827 <https://reviews.llvm.org/D91827> added, the test `PASS`es on
`sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D91615

2 years ago[sanitizer_common] Fix DenseMapCustomTest.DefaultMinReservedSizeTest on SPARC
Rainer Orth [Wed, 9 Feb 2022 08:12:02 +0000 (09:12 +0100)]
[sanitizer_common] Fix DenseMapCustomTest.DefaultMinReservedSizeTest on SPARC

As described in Issue #53523, the
`DenseMapCustomTest.DefaultMinReservedSizeTest` test FAILs on Solaris/SPARC
(both 32 and 64-bit):

  /vol/llvm/src/llvm-project/local/compiler-rt/lib/sanitizer_common/tests/sanitizer_dense_map_test.cpp:399:
Failure
  Expected: (MemorySize) != (Map.getMemorySize()), actual: 8192 vs 8192

This happens because SPARC, unlike many other CPUs, uses an 8 kB pagesize.

Fixed by incorporating the pagesize into the calculations of
`ExpectedInitialBucketCount` and derived values.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D118771

2 years ago[llvm-rc]: Find <target>-clang over just clang
Tobias Hieta [Tue, 8 Feb 2022 08:26:09 +0000 (09:26 +0100)]
[llvm-rc]: Find <target>-clang over just clang

This patch makes llvm-rc/windres prefer <target>-clang over
clang when doing it's preprocessing. This is so that we can
have a .cfg file for <target> and configure sysroot and other
important flags.

Config files not picked up with clang --target=<target>
automatically.

We only look for <target>-clang in the same dir as llvm-windres
and not for all PATHs to minimize the change.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D119219

2 years ago[RISCV] Select unmasked RVV pseudos in a DAG post-process
Fraser Cormack [Tue, 1 Feb 2022 14:22:33 +0000 (14:22 +0000)]
[RISCV] Select unmasked RVV pseudos in a DAG post-process

This patch drops TableGen patterns matching all-ones masked RVV pseudos
in the case where there are fallback patterns matching the generic
masked forms to "_MASK" pseudos. This optimization is now performed with
a SelectionDAG post-processing step which peephole-optimizes these same
pseudos with all-ones masks and swaps them out to their unmasked
pseudos.

This cuts our generated ISel table down by around ~5% (~110kB) in lieu
of a far smaller auto-generated table to help with the peephole.

This only targets our custom RISCVISD::*_VL binary operator nodes, which
use the one form for both masked and unmasked variants. A similar
approach could be used for our intrinsics but we'd need to do some work,
e.g., to represent unmasked intrinsics as true-masked intrinsics at the
IR or ISel level. At a rough estimate, this could save us a further 9%
on the size of our ISel table for the binary intrinsic patterns alone.

There is no observable impact on our tests.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D118810

2 years ago[OpenMP][Clang] Move partial support of reverse offload to a future version
Saiyedul Islam [Tue, 8 Feb 2022 16:30:09 +0000 (16:30 +0000)]
[OpenMP][Clang] Move partial support of reverse offload to a future version

OpenMP Spec 5.2 requires unimplemented requires clauses to produce
compile time error termination. Moving current partial support of
reverse_offload to a distant future version 9.9 so that existing
code can be tested and maintained until a complete implementation
is available.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D119256

2 years ago[ELF] --warn-backrefs: suppress warnings for backward references within the archive
Fangrui Song [Wed, 9 Feb 2022 05:45:55 +0000 (21:45 -0800)]
[ELF] --warn-backrefs: suppress warnings for backward references within the archive

2 years ago[llvm] Recognize arm64 as target-aarch64 in lit
Jonas Devlieghere [Tue, 8 Feb 2022 21:27:29 +0000 (13:27 -0800)]
[llvm] Recognize arm64 as target-aarch64 in lit

Recognize arm64 triples as AArch64 so we can XFAIL/skip tests using
target-aarch64.

Differential revision: https://reviews.llvm.org/D119169

2 years ago[docs] Re-generate ClangCommandLineReference.rst
Fangrui Song [Wed, 9 Feb 2022 04:54:52 +0000 (20:54 -0800)]
[docs] Re-generate ClangCommandLineReference.rst

2 years ago[AMDGPU] [NFC] Fix incorrect use of bitwise operator.
Sameer Sahasrabuddhe [Wed, 9 Feb 2022 03:12:54 +0000 (22:12 -0500)]
[AMDGPU] [NFC] Fix incorrect use of bitwise operator.

Differential Revision: https://reviews.llvm.org/D119308

2 years ago[HIP] Emit amdgpu_code_object_version module flag
Yaxun (Sam) Liu [Fri, 4 Feb 2022 19:19:23 +0000 (14:19 -0500)]
[HIP] Emit amdgpu_code_object_version module flag

code object version determines ABI, therefore should not be mixed.

This patch emits amdgpu_code_object_version module flag in LLVM IR
based on code object version (default 4).

The amdgpu_code_object_version value is code object version times 100.

LLVM IR with different amdgpu_code_object_version module flag cannot
be linked.

The -cc1 option -mcode-object-version=none is for ROCm device library use
only, which supports multiple ABI.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D119026

2 years ago[RISCV][NFC] Refactor RISCVISAInfo.
Zakk Chen [Tue, 8 Feb 2022 15:42:48 +0000 (07:42 -0800)]
[RISCV][NFC] Refactor RISCVISAInfo.

1. Remove computeDefaultABIFromArch and add computeDefaultABI in
RISCVISAInfo.
2. Add parseFeatureBits which may used in D118333.

Differential Revision: https://reviews.llvm.org/D119250

2 years ago[RISCV] Add patterns for vector widening floating-point fused multiply-add instructions
jacquesguan [Tue, 18 Jan 2022 08:56:06 +0000 (16:56 +0800)]
[RISCV] Add patterns for vector widening floating-point fused multiply-add instructions

Add patterns for vector widening floating-point fused multiply-add instructions.

Differential Revision: https://reviews.llvm.org/D117546

2 years ago[docs] Document -ffinite-math-only, -fhonor-{infinities,infinites,nans}
Jon Roelofs [Wed, 9 Feb 2022 02:09:52 +0000 (18:09 -0800)]
[docs] Document -ffinite-math-only, -fhonor-{infinities,infinites,nans}

2 years ago[X86] Implement -fzero-call-used-regs option
Bill Wendling [Wed, 9 Feb 2022 01:40:59 +0000 (17:40 -0800)]
[X86] Implement -fzero-call-used-regs option

The "-fzero-call-used-regs" option tells the compiler to zero out
certain registers before the function returns. It's also available as a
function attribute: zero_call_used_regs.

The two upper categories are:

  - "used": Zero out used registers.
  - "all": Zero out all registers, whether used or not.

The individual options are:

  - "skip": Don't zero out any registers. This is the default.
  - "used": Zero out all used registers.
  - "used-arg": Zero out used registers that are used for arguments.
  - "used-gpr": Zero out used registers that are GPRs.
  - "used-gpr-arg": Zero out used GPRs that are used as arguments.
  - "all": Zero out all registers.
  - "all-arg": Zero out all registers used for arguments.
  - "all-gpr": Zero out all GPRs.
  - "all-gpr-arg": Zero out all GPRs used for arguments.

This is used to help mitigate Return-Oriented Programming exploits.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D110869

2 years ago[cxx_status] Add a couple of Feb 2022 library papers that need compiler support.
Richard Smith [Wed, 9 Feb 2022 01:25:06 +0000 (17:25 -0800)]
[cxx_status] Add a couple of Feb 2022 library papers that need compiler support.

2 years ago[gn build] Port 216575e58102
LLVM GN Syncbot [Wed, 9 Feb 2022 01:18:18 +0000 (01:18 +0000)]
[gn build] Port 216575e58102

2 years ago[gn build] (manually) port 216575e5810
Nico Weber [Wed, 9 Feb 2022 01:17:32 +0000 (20:17 -0500)]
[gn build] (manually) port 216575e5810

2 years ago[gn build] (manually) port 4a6553f4c2be some more
Nico Weber [Wed, 9 Feb 2022 01:16:19 +0000 (20:16 -0500)]
[gn build] (manually) port 4a6553f4c2be some more

2 years ago[nfc][mlgo][regalloc] Add the url to a reference pre-trained model
Mircea Trofin [Wed, 9 Feb 2022 00:53:36 +0000 (16:53 -0800)]
[nfc][mlgo][regalloc] Add the url to a reference pre-trained model

2 years ago[gn build] (manually) port 817d897b57c7 (LIBCXX_ABI_UNSTABLE)
Nico Weber [Wed, 9 Feb 2022 00:55:18 +0000 (19:55 -0500)]
[gn build] (manually) port 817d897b57c7 (LIBCXX_ABI_UNSTABLE)

2 years ago[BOLT][DWARF] Remove caching of ranges/abbrevs
Alexander Yermolovich [Tue, 8 Feb 2022 23:24:29 +0000 (15:24 -0800)]
[BOLT][DWARF] Remove caching of ranges/abbrevs

Removing caching of ranges/abbrevs to simplify the code.
Before we were doing it to get around a gdb limitation.
FBD34015613

Reviewed By: Amir, maksfb

Differential Revision: https://reviews.llvm.org/D119276

2 years agoGlobalISel: Constant fold G_PTR_ADD
Matt Arsenault [Sat, 15 Aug 2020 16:07:29 +0000 (12:07 -0400)]
GlobalISel: Constant fold G_PTR_ADD

Some globals lower to literal addresses on AMDGPU.

This may be wrong for non-integral address spaces. I'm wondering if we
should just allow regular G_ADD to use pointer types, and reserve
G_PTR_ADD for non-integral address spaces.

2 years ago[LLD] Fix issue in HIP due to unspecified order of evaluation of the function object
Alexandre Ganea [Tue, 8 Feb 2022 22:39:13 +0000 (17:39 -0500)]
[LLD] Fix issue in HIP due to unspecified order of evaluation of the function object

This fixes the issue raised in https://reviews.llvm.org/D108850#3303452

Before C++17, the function object is evaluated in a unspecified order. In the following example: https://godbolt.org/z/8ao4vdsr7 the function object is either evaluated before or after the arguments, depending on the compiler. With MSVC and /std:c++14 the function object is evaluated after the arguments; with clang and gcc, it is evaluated before. With C++17, the function object is guaranteed to be evaluated before the arguments, see: https://riptutorial.com/cplusplus/example/19369/evaluation-order-of-function-arguments

In our case, the issue was that the `args` conversion to `ArrayRef` was evaluated before the lambda call `link`, which internally was calling `parseFlavor()`, which in turned modified `args`. We ended with an `ArrayRef` argument that reflected the previous contents of `args`.

Add coverage for `-flavor` which we didn't have before.

Differential Revision: https://reviews.llvm.org/D119278

2 years ago[MLIR] Temporary workaround for calling the LLD ELF driver as-a-lib
Alexandre Ganea [Tue, 8 Feb 2022 22:36:14 +0000 (17:36 -0500)]
[MLIR] Temporary workaround for calling the LLD ELF driver as-a-lib

This fixes the situation described in https://github.com/llvm/llvm-project/issues/53475 with a repro exposed by https://github.com/ROCmSoftwarePlatform/D108850-lld-bug-reproduction

This is purposely just a workaround to unblock users. This could be transplanted to the release/14.x branch if need be. A proper fix will later be provided in https://reviews.llvm.org/D119049.

Differential Revision: https://reviews.llvm.org/D119277

2 years agoRevert "[AArch64] ACLE feature macro for Armv8.8-A MOPS"
tyb0807 [Wed, 9 Feb 2022 00:08:18 +0000 (00:08 +0000)]
Revert "[AArch64] ACLE feature macro for Armv8.8-A MOPS"

This reverts commit d379ec99085e33ace51740f2b93bda5e5c72326f.

2 years ago[libc++] Remove outdated synopsis parts in experimental/functional
Joe Loser [Tue, 8 Feb 2022 00:53:45 +0000 (19:53 -0500)]
[libc++] Remove outdated synopsis parts in experimental/functional

Remove mentions of `experimental::function`, its operators, etc. They are no
longer in `experimental/functional`.

Differential Revision: https://reviews.llvm.org/D119204

2 years ago[memprof] Add LLVM_DEBUG for unused var in RawMemProfReader.cpp.
Snehasish Kumar [Tue, 8 Feb 2022 23:45:34 +0000 (15:45 -0800)]
[memprof] Add LLVM_DEBUG for unused var in RawMemProfReader.cpp.

The ContainingSegment variable is only used to check whether we found
the address at this time. When building without Asserts this emits a
warning. So for now wrap this code in LLVM_DEBUG to avoid the warning.

2 years agoGlobalISel: Constant fold FP bin ops in MIRBuilder
Matt Arsenault [Sun, 21 Mar 2021 00:13:01 +0000 (20:13 -0400)]
GlobalISel: Constant fold FP bin ops in MIRBuilder

Might as well handle these if we're going to handle the integer ops
here.

2 years agoGlobalISel: Constant fold integer min/max opcodes
Matt Arsenault [Sat, 20 Mar 2021 23:01:08 +0000 (19:01 -0400)]
GlobalISel: Constant fold integer min/max opcodes

2 years ago[Hexagon] Fix operation actions for v128f16
Krzysztof Parzyszek [Tue, 8 Feb 2022 23:26:12 +0000 (15:26 -0800)]
[Hexagon] Fix operation actions for v128f16

There were more cases of operations that should have been "Custom" for
v128f16, but ended up "Legal" (e.g. load and store).

2 years ago[mlir][ods] Attribute and type formats: support whitespaces
Mogball [Tue, 8 Feb 2022 23:03:23 +0000 (23:03 +0000)]
[mlir][ods] Attribute and type formats: support whitespaces

Supports whitespace elements: ` ` and `\\n` as well as the "empty" whitespace `` that removes an otherwise printed space.

Depends on D118208

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D118210

2 years agoGlobalISel: Add FoldBinOpIntoSelect combine
Matt Arsenault [Sat, 20 Mar 2021 15:25:49 +0000 (11:25 -0400)]
GlobalISel: Add FoldBinOpIntoSelect combine

This will do the combine in cases that should fold, but don't
now. e.g. we're relying on the CSEMIRBuilder's incomplete constant
folding. For instance it doesn't handle FP operations or vectors (and
we don't have separate constant folding combines either to catch
them).

2 years agoAMDGPU/GlobalISel: Add baseline test for binop fold into select combine
Matt Arsenault [Sat, 20 Mar 2021 22:19:09 +0000 (18:19 -0400)]
AMDGPU/GlobalISel: Add baseline test for binop fold into select combine

2 years ago[Symbolizer] Add Build ID flag to llvm-symbolizer.
Daniel Thornburgh [Fri, 21 Jan 2022 00:13:52 +0000 (00:13 +0000)]
[Symbolizer] Add Build ID flag to llvm-symbolizer.

This adds a --build-id=<hex build ID> flag to llvm-symbolizer. If --obj
is unspecified, this will attempt to look up the provided build ID using
whatever mechanisms are available to the Symbolizer (typically,
debuginfod). The semantics are then as if the found binary were given
using the --obj flag.

Reviewed By: jhenderson, phosek

Differential Revision: https://reviews.llvm.org/D118633

2 years ago[mlir][math] Expand coverage of atan2 expansion
Jacques Pienaar [Tue, 8 Feb 2022 23:00:39 +0000 (15:00 -0800)]
[mlir][math] Expand coverage of atan2 expansion

Reuse the higher precision F32 approximation for the F16 one (by expanding and
truncating). This is partly RFC as I'm not sure what the expectations are here
(e.g., these are only for F32 and should not be expanded, that reusing
higher-precision ones for lower precision is undesirable due to increased
compute cost and only approximations per exact type is preferred, or this is
appropriate [at least as fallback] but we need to see how to make it more
generic across all the patterns here).

Differential Revision: https://reviews.llvm.org/D118968

2 years ago[libcxx][test] Disable bad unique_ptr<T[]> to shared_ptr<U[]> conversion test cases
Casey Carter [Thu, 30 Dec 2021 00:02:45 +0000 (16:02 -0800)]
[libcxx][test] Disable bad unique_ptr<T[]> to shared_ptr<U[]> conversion test cases

for non-libc++. I've reported allowance of these conversions as a bug at https://llvm.org/PR53368.

Differential Revision: https://reviews.llvm.org/D117996

2 years ago[libcxx][test] tests for strengthened `noexcept` are non-portable
Casey Carter [Sat, 22 Jan 2022 20:41:30 +0000 (12:41 -0800)]
[libcxx][test] tests for strengthened `noexcept` are non-portable

Differential Revision: https://reviews.llvm.org/D117966

2 years ago[sanitizer] Guard the whole ThreadDescriptorSize block with #if !SANITIZER_GO after...
Fangrui Song [Tue, 8 Feb 2022 22:48:34 +0000 (14:48 -0800)]
[sanitizer] Guard the whole ThreadDescriptorSize block with #if !SANITIZER_GO after D119007

The SANITIZER_GO code path reports an undefined symbol error for dlsym.

```
FAILED: projects/compiler-rt/lib/tsan/rtl/CMakeFiles/GotsanRuntimeCheck /tmp/RelA/projects/compiler-rt/lib/tsan/rtl/CMakeFiles/GotsanRuntimeCheck
```

2 years ago[libc++] Prepare string.{access, capacity, cons} tests for constexpr
Nikolas Klauser [Mon, 7 Feb 2022 20:54:49 +0000 (21:54 +0100)]
[libc++] Prepare string.{access, capacity, cons} tests for constexpr

Reviewed By: ldionne, #libc

Spies: libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D119123

2 years ago[clang] Document objc_unsafeClaimAutoreleasedReturnValue.
Ahmed Bougacha [Tue, 8 Feb 2022 21:33:39 +0000 (13:33 -0800)]
[clang] Document objc_unsafeClaimAutoreleasedReturnValue.

This has been added a few years ago but wasn't listed here.

2 years ago[clang][Driver] Use a VersionTuple for darwin linker version checks.
Ahmed Bougacha [Tue, 8 Feb 2022 21:29:49 +0000 (13:29 -0800)]
[clang][Driver] Use a VersionTuple for darwin linker version checks.

This unifies a couple spots that did it manually by checking the
flag directly.

It does mean that we're now dropping the 5th component, but that's
not used in any of these checks, and to my knowledge it's never been
used in ld64.

2 years ago[bazel] Port 216575e58102
Benjamin Kramer [Tue, 8 Feb 2022 22:01:04 +0000 (23:01 +0100)]
[bazel] Port 216575e58102

2 years ago[libc][Obvious] Fix typo in mkdir and mkdirat implementations.
Siva Chandra Reddy [Tue, 8 Feb 2022 17:09:12 +0000 (17:09 +0000)]
[libc][Obvious] Fix typo in mkdir and mkdirat implementations.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D119265

2 years agoREADME: Point to the discourse & discord forums
Sylvestre Ledru [Tue, 8 Feb 2022 20:54:32 +0000 (21:54 +0100)]
README: Point to the discourse & discord forums

Differential Revision: https://reviews.llvm.org/D119279

2 years agoRevert "Revert "[ProfileData] Read and symbolize raw memprof profiles.""
Snehasish Kumar [Fri, 4 Feb 2022 19:11:47 +0000 (11:11 -0800)]
Revert "Revert "[ProfileData] Read and symbolize raw memprof profiles.""

This reverts commit dbf47d227d080e4eb7239b589660f51d7b08afa9.

Reapply https://reviews.llvm.org/D116784 now that
https://reviews.llvm.org/D118413 has landed with a couple of fixes:
* fix raw profile reader unaligned access identified by ubsan
* fix windows build by using MOCK_CONST_METHOD3 instead of MOCK_METHOD.

2 years ago[test] Remove -fno-experimental-new-pass-manager -O1 from sanitize-address-field...
Arthur Eubanks [Thu, 3 Feb 2022 19:56:20 +0000 (11:56 -0800)]
[test] Remove -fno-experimental-new-pass-manager -O1 from sanitize-address-field-padding.cpp

-O1 doesn't seem necessary here.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D118936

2 years ago[clang] Properly cache member pointer LLVM types
Arthur Eubanks [Tue, 8 Feb 2022 05:56:28 +0000 (21:56 -0800)]
[clang] Properly cache member pointer LLVM types

When not going through the main Clang->LLVM type cache, we'd
accidentally create multiple different opaque types for a member pointer
type.

This allows us to remove the -verify-type-cache flag now that
check-clang passes with it on. We can do the verification in expensive
builds. Previously microsoft-abi-member-pointers.cpp was failing with
-verify-type-cache.

I suspect that there may be more issues when we have multiple member
pointer types and we clear the cache, but we can leave that for later.

Followup to D118744.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D119215

2 years ago[LV] Move buildScalarSteps out of ILV (NFC).
Florian Hahn [Tue, 8 Feb 2022 21:18:40 +0000 (21:18 +0000)]
[LV] Move buildScalarSteps out of ILV (NFC).

This makes the function independent of shared state in ILV (ensures no
new dependencies on things like the cost model are introduced) and allows
for use directly in recipe's ::execute functions.

2 years ago[mlir][ods] NFC fix tblgen crash with empty assembly format
Mogball [Tue, 8 Feb 2022 21:13:58 +0000 (21:13 +0000)]
[mlir][ods] NFC fix tblgen crash with empty assembly format

2 years ago[AArch64] ACLE feature macro for Armv8.8-A MOPS
tyb0807 [Tue, 25 Jan 2022 22:51:49 +0000 (22:51 +0000)]
[AArch64] ACLE feature macro for Armv8.8-A MOPS

This introduces the new __ARM_FEATURE_MOPS ACLE feature test macro,
which signals the availability of the new Armv8.8-A/Armv9.3-A
instructions for standardising memcpy, memset and memmove operations.

This patch supersedes the one from https://reviews.llvm.org/D116160.

Differential Revision: https://reviews.llvm.org/D118199

2 years ago[Hexagon] Fix crash with shuffle_vector of v128f16
Krzysztof Parzyszek [Sat, 5 Feb 2022 00:14:13 +0000 (16:14 -0800)]
[Hexagon] Fix crash with shuffle_vector of v128f16

2 years ago[Debuginfod][Symbolizer] Cut dependency cycle after 4a6553f4c2be
Benjamin Kramer [Tue, 8 Feb 2022 20:53:30 +0000 (21:53 +0100)]
[Debuginfod][Symbolizer] Cut dependency cycle after 4a6553f4c2be

2 years ago[sanitizer] Use _thread_db_sizeof_pthread to obtain struct pthread size
Florian Weimer [Tue, 8 Feb 2022 20:46:41 +0000 (12:46 -0800)]
[sanitizer] Use _thread_db_sizeof_pthread to obtain struct pthread size

This symbol has been exported (as an internal GLIBC_PRIVATE symbol) from libc.so.6 starting with glibc 2.34. glibc uses it internally for its libthread_db implementation to enable thread debugging on GDB, so it is unlikely to go away for now.

Fixes #52989.

Reviewed By: #sanitizers, MaskRay, vitalybuka

Differential Revision: https://reviews.llvm.org/D119007

2 years ago[libc] Replace type punning with bit_cast
Guillaume Chatelet [Mon, 7 Feb 2022 15:40:28 +0000 (15:40 +0000)]
[libc] Replace type punning with bit_cast

Although type punning is defined for union in C, it is UB in C++.
This patch introduces a bit_cast function to convert between types in a safe way.

This is necessary to get llvm-libc compile with GCC.
This patch is extracted from D119002.

Differential Revision: https://reviews.llvm.org/D119145

2 years ago[BOLT][TEST] Add .so instrumentation test
Amir Ayupov [Tue, 8 Feb 2022 05:14:32 +0000 (21:14 -0800)]
[BOLT][TEST] Add .so instrumentation test

Summary: Shared object instrumentation test

Test Plan: bin/llvm-lit -a bolt/test/X86/internal-call-instrument-so.s

Reviewers: rafauler

FBD34064557

2 years agoFix a typo (occured => occurred)
Sylvestre Ledru [Tue, 8 Feb 2022 20:33:01 +0000 (21:33 +0100)]
Fix a typo (occured => occurred)

Reported:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005195

2 years ago[flang][codegen] Keep primitive type for extractvalue and insertvalue
Valentin Clement [Tue, 8 Feb 2022 20:26:16 +0000 (21:26 +0100)]
[flang][codegen] Keep primitive type for extractvalue and insertvalue

llvm.insertvalue and llvm.extractvalue need LLVM primitive type
for the indexing operands. While upstreaming the TargetRewrite pass the change
was made from i32 to index without knowing this restriction. This patch reverts
back the types used for indexing in the two ops created in this pass.

the error you will receive when lowering to LLVM IR with the current code
is the following:

```
 'llvm.insertvalue' op operand #1 must be primitive LLVM type, but got 'index'
```

Reviewed By: jeanPerier, schweitz

Differential Revision: https://reviews.llvm.org/D119253

2 years ago[libc++] Remove _LIBCPP_ABI_UNSTABLE
Louis Dionne [Mon, 7 Feb 2022 19:52:17 +0000 (14:52 -0500)]
[libc++] Remove _LIBCPP_ABI_UNSTABLE

Previously, _LIBCPP_ABI_UNSTABLE would be used interchangeably with
_LIBCPP_ABI_VERSION >= 2. This was confusing and creating unnecessary
complexity.

This patch removes _LIBCPP_ABI_UNSTABLE -- instead, the LIBCXX_ABI_UNSTABLE
CMake option will result in the LIBCXX_ABI_VERSION being set to '2', the
current unstable ABI. As a result, in the code, we only have _LIBCPP_ABI_VERSION
to check in order to query the current ABI version.

As a fly-by, this also defines the ABI namespace during CMake configuration
to reduce complexity in __config. I believe it was previously done this
way because we used to try to use __config_site as seldom as possible.
Now that we always ship a __config_site, it doesn't really matter and
I think being explicit about how the library is configured in the __config_site
is actually a feature.

Differential Revision: https://reviews.llvm.org/D119173

2 years ago[libc++] Fix modules and benchmarks CI builds when incomplete features are disabled
Louis Dionne [Fri, 4 Feb 2022 20:37:01 +0000 (15:37 -0500)]
[libc++] Fix modules and benchmarks CI builds when incomplete features are disabled

Differential Revision: https://reviews.llvm.org/D119036

2 years ago[mlir][ods] Optional Attribute or Type Parameters
Mogball [Tue, 8 Feb 2022 16:59:57 +0000 (16:59 +0000)]
[mlir][ods] Optional Attribute or Type Parameters

Implements optional attribute or type parameters, including support for such parameters in the assembly format `struct` directive. Also implements optional groups.

Depends on D117971

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D118208

2 years agoAdd case to handle 0-D vectors in FlattenContiguousRowMajorTransferWritePattern and...
harsh [Tue, 8 Feb 2022 19:50:00 +0000 (19:50 +0000)]
Add case to handle 0-D vectors in FlattenContiguousRowMajorTransferWritePattern and FlattenContiguousRowMajorTransferReadPattern.

For 0-D as well as 1-D vectors, both these patterns should
return a failure as there is no need to collapse the shape
of the source. Currently, only 1-D vectors were handled. This
patch handles the 0-D case as well.

Reviewed By: Benoit, ThomasRaoux

Differential Revision: https://reviews.llvm.org/D119202

2 years ago[clang] [MinGW] Recognize -lcrtdll as a library replacing -lmsvcrt
Martin Storsjö [Tue, 8 Feb 2022 08:48:32 +0000 (10:48 +0200)]
[clang] [MinGW] Recognize -lcrtdll as a library replacing -lmsvcrt

Differential Revision: https://reviews.llvm.org/D119234

2 years agoRevert "[Clang] Propagate guaranteed alignment for malloc and others"
James Y Knight [Mon, 7 Feb 2022 16:31:22 +0000 (11:31 -0500)]
Revert "[Clang] Propagate guaranteed alignment for malloc and others"

The above change assumed that malloc (and friends) would always
allocate memory to getNewAlign(), even for allocations which have a
smaller size. This is not actually required by spec (a 1-byte
allocation may validly have 1-byte alignment).

Some real-world malloc implementations do not provide this guarantee,
and thus this optimization is breaking programs.

Fixes #53540

This reverts commit c2297544c04764237cedc523083c7be2fb3833d4.

Differential Revision: https://reviews.llvm.org/D118804

2 years ago[gn build] Port 4a6553f4c2be
LLVM GN Syncbot [Tue, 8 Feb 2022 19:21:13 +0000 (19:21 +0000)]
[gn build] Port 4a6553f4c2be

2 years ago[Debuginfod] [Symbolizer] Break debuginfod out of libLLVM.
Daniel Thornburgh [Tue, 25 Jan 2022 22:23:38 +0000 (22:23 +0000)]
[Debuginfod] [Symbolizer] Break debuginfod out of libLLVM.

Debuginfod can pull in libcurl as a dependency, which isn't appropriate
for libLLVM. (See
https://gitlab.freedesktop.org/mesa/mesa/-/issues/5732).

This change breaks out debuginfod into a separate non-component library
that can be used directly in llvm-symbolizer. The tool can inject
debuginfod into the Symbolizer library via an abstract DebugInfoFetcher
interface, breaking the dependency of Symbolizer on debuinfod.

See https://github.com/llvm/llvm-project/issues/52731

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D118413

2 years ago[clang][ARM] Re-word PACBTI warning.
Amilendra Kodithuwakku [Tue, 8 Feb 2022 19:11:49 +0000 (19:11 +0000)]
[clang][ARM] Re-word PACBTI warning.

The original warning added in D115501 when pacbti is used with an
incompatible architecture was not exactly correct because it was
not really ignored and can affect codegen.

Therefore reword to say that the pacbti option is incompatible with
the given architecture.

Reviewed By: chill

Differential Revision: https://reviews.llvm.org/D119166

2 years ago[clang][Fuchsia] Ensure static sanitizer libs are only linked in after the -nostdlib...
Leonard Chan [Tue, 8 Feb 2022 18:51:53 +0000 (10:51 -0800)]
[clang][Fuchsia] Ensure static sanitizer libs are only linked in after the -nostdlib check

Differential Revision: https://reviews.llvm.org/D119201

2 years agoAllow parameter pack expansions and initializer lists in annotate attribute
Steffen Larsen [Tue, 8 Feb 2022 18:27:52 +0000 (13:27 -0500)]
Allow parameter pack expansions and initializer lists in annotate attribute

These changes make the Clang parser recognize expression parameter pack
expansion and initializer lists in attribute arguments. Because
expression parameter pack expansion requires additional handling while
creating and instantiating templates, the support for them must be
explicitly supported through the AcceptsExprPack flag.

Handling expression pack expansions may require a delay to when the
arguments of an attribute are correctly populated. To this end,
attributes that are set to accept these - through setting the
AcceptsExprPack flag - will automatically have an additional variadic
expression argument member named DelayedArgs. This member is not
exposed the same way other arguments are but is set through the new
CreateWithDelayedArgs creator function generated for applicable
attributes.

To illustrate how to implement support for expression pack expansion
support, clang::annotate is made to support pack expansions. This is
done by making handleAnnotationAttr delay setting the actual attribute
arguments until after template instantiation if it was unable to
populate the arguments due to dependencies in the parsed expressions.

2 years ago[libc][NFC] Remove all Linux specific code to respective linux/ directories
Alex Brachet [Tue, 8 Feb 2022 18:32:18 +0000 (18:32 +0000)]
[libc][NFC] Remove all Linux specific code to respective linux/ directories

These were all the non OS agnostic implementations I could find in general directories.

Currently none of these functions are actually enabled, but for when they do it makes sense that they be in linux/ specific directories.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D119164

2 years ago[SimplifyCFG] 'merge compatible invokes': fully support indirect invokes
Roman Lebedev [Tue, 8 Feb 2022 18:17:23 +0000 (21:17 +0300)]
[SimplifyCFG] 'merge compatible invokes': fully support indirect invokes

As long as *all* the invokes in the set are indirect,
we can merge them, but don't merge direct invokes into the set,
even though it would be legal to do.

2 years ago[SimplifyCFG] 'merge compatible invokes': don't create trivial PHI's with all-identic...
Roman Lebedev [Tue, 8 Feb 2022 18:16:39 +0000 (21:16 +0300)]
[SimplifyCFG] 'merge compatible invokes': don't create trivial PHI's with all-identical incoming values

2 years ago[NFC][SimplifyCFG] 'merge compatible invokes': tests for indirect invokes.
Roman Lebedev [Tue, 8 Feb 2022 17:43:26 +0000 (20:43 +0300)]
[NFC][SimplifyCFG] 'merge compatible invokes': tests for indirect invokes.

2 years ago[AMDGPU] Select VGPR versions of MFMA if possible
Stanislav Mekhanoshin [Thu, 13 Jan 2022 00:03:16 +0000 (16:03 -0800)]
[AMDGPU] Select VGPR versions of MFMA if possible

We can select _vgprcd versions of MAI instructions and have no
AGPRs with the whole budget left for VGPRs if:

1. This is a kernel;
2. It has no calls;
3. It runs at least on 2 waves thus having not more that 256 VGPRs.
4. There is no inline asm requesting AGPRs.

Differential Revision: https://reviews.llvm.org/D117253

2 years ago[mlir][Linalg] NFC: Combine elementwise fusion test passes.
Mahesh Ravishankar [Mon, 7 Feb 2022 17:45:28 +0000 (17:45 +0000)]
[mlir][Linalg] NFC: Combine elementwise fusion test passes.

There are a few different test passes that check elementwise fusion in
Linalg. Consolidate them to a single pass controlled by different pass
options (in keeping with how `TestLinalgTransforms` exists).

2 years ago[flang] Upstream partial lowering of GET_ENVIRONMENT_VARIABLE intrinsic
Josh Mottley [Thu, 3 Feb 2022 21:54:56 +0000 (21:54 +0000)]
[flang] Upstream partial lowering of GET_ENVIRONMENT_VARIABLE intrinsic

This patch adds partial lowering of the "GET_ENVIRONMENT_VARIABLE" intrinsic
to the backend runtime hook implemented in patches D111394 and D112698.
It also renames the `isPresent` lambda to `isAbsent` and moves it out to
its own function in `Command.cpp`. Corresponding comment fixes for this
are also modified. Lastly it adds the i1 type to
`RuntimeCallTestBash.h`.

Differential Revision: https://reviews.llvm.org/D118984

2 years ago[X86] Update register RCL/RCR by 1 and immediate scheduling for Intel CPUs
Craig Topper [Tue, 8 Feb 2022 17:20:19 +0000 (09:20 -0800)]
[X86] Update register RCL/RCR by 1 and immediate scheduling for Intel CPUs

Most Intel CPU scheduler files lumped the immediate and 1 instructions
together, but uops.info shows they are quite different.

For the most part the by 1 instructions were pretty accurate to the uops.info
data except the latency was 3 instead of 2 as uops.info indicates.

The by immediate instructions need 7 or 8 uops and have higher latency.

It looks like the 8-bit by immediate instructions may need even more
uops, but I just lumped them with the 16/32/64.

Noticed while checking out PR53648. So mostly I cared about the by 1
instructions.

Reviewed By: RKSimon, pengfei

Differential Revision: https://reviews.llvm.org/D119217

2 years ago[C++2b] Implement multidimentional subscript operator
Corentin Jabot [Tue, 8 Feb 2022 17:09:03 +0000 (12:09 -0500)]
[C++2b] Implement multidimentional subscript operator

Implement P2128R6 in C++23 mode.

Unlike GCC's implementation, this doesn't try to recover when a user
meant to use a comma expression.

Because the syntax changes meaning in C++23, the patch is *NOT*
implemented as an extension. Instead, declaring an array with not
exactly 1 parameter is an error in older languages modes. There is an
off-by-default extension warning in C++23 mode.

Unlike the standard, we supports default arguments;

Ie, we assume, based on conversations in WG21, that the proposed
resolution to CWG2507 will be accepted.

We allow arrays OpenMP sections and C++23 multidimensional array to
coexist:

[a , b] multi dimensional array
[a : b] open mp section
[a, b: c] // error

The rest of the patch is relatively straight forward: we take care to
support an arbitrary number of arguments everywhere.

2 years ago[Attributor] Emit fixed-point remark on function list
Joseph Huber [Tue, 8 Feb 2022 15:43:22 +0000 (10:43 -0500)]
[Attributor] Emit fixed-point remark on function list

This patch replaces the function we emit the remark on when we run into
the fix-point limit. Previously we got a function to emit a remark on
from the worklist's associated function. However, the worklist may not
always have an associated function in the case of global variables.
Replace this with the function set, and if there are no functions don't
emit the remark.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D119248

2 years ago[Libomptarget] Add header files as a dependency to CMake target
Joseph Huber [Tue, 8 Feb 2022 16:35:57 +0000 (11:35 -0500)]
[Libomptarget] Add header files as a dependency to CMake target

This patch manually adds the runtime include files to the list of
dependencies when we build the bitcode runtime library. Previously if
only the header was changed we would not recompile the source files.
The solution used here isn't optimal because every source file not has a
dependency on each header file regardless of if it was actually used by
that file.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D119254

2 years ago[Hexagon] Alter meaning of versionless -mhvx
Krzysztof Parzyszek [Tue, 8 Feb 2022 16:45:40 +0000 (08:45 -0800)]
[Hexagon] Alter meaning of versionless -mhvx

The documentation for the official (downstream) Qualcomm Hexagon Clang
states that -mhvx sets the HVX version to be the same as the CPU version.
The current implementation upstream would use the most recent versioned
-mhvx= flag first (if present), then the CPU version. Change the upstream
behavior to match the documented behavior of the downstream compiler.

2 years ago[NFC] Increase initial size of FoldingSets used in ASTContext and CodeGenTypes
Dawid Jurczak [Tue, 8 Feb 2022 16:23:53 +0000 (17:23 +0100)]
[NFC] Increase initial size of FoldingSets used in ASTContext and CodeGenTypes

Among many FoldingSet users most notable seem to be ASTContext and CodeGenTypes.
The reasons that we spend not-so-tiny amount of time in FoldingSet calls from there, are following:

  1. Default FoldingSet capacity for 2^6 items very often is not enough.
     For PointerTypes/ElaboratedTypes/ParenTypes it's not unlikely to observe growing it to 256 or 512 items.
     FunctionProtoTypes can easily exceed 1k items capacity growing up to 4k or even 8k size.

  2. FoldingSetBase::GrowBucketCount cost itself is not very bad (pure reallocations are rather cheap thanks to BumpPtrAllocator).
     What matters is high collision rate when lot of items end up in same bucket slowing down FoldingSetBase::FindNodeOrInsertPos and trashing CPU cache
     (as items with same hash are organized in intrusive linked list which need to be traversed).

This change address both issues by increasing initial size of FoldingSets used in ASTContext and CodeGenTypes.

Extracted from: https://reviews.llvm.org/D118385

Differential Revision: https://reviews.llvm.org/D118608

2 years ago[MLIR][Presburger] Fix linkage of functions in header
Benjamin Kramer [Tue, 8 Feb 2022 16:50:45 +0000 (17:50 +0100)]
[MLIR][Presburger] Fix linkage of functions in header

Static functions in a header cause spurious unused function warnings.

2 years ago[mlir][bazel] Update post 24a1
Jacques Pienaar [Tue, 8 Feb 2022 16:48:10 +0000 (08:48 -0800)]
[mlir][bazel] Update post 24a1

2 years ago[mlir][taco] Use sparse_tensor.out to write sparse tensors to files.
Bixia Zheng [Fri, 4 Feb 2022 22:21:43 +0000 (14:21 -0800)]
[mlir][taco] Use sparse_tensor.out to write sparse tensors to files.

Add a Python method, output_sparse_tensor, to use sparse_tensor.out to write
a sparse tensor value to a file.

Modify the method that evaluates a tensor expression to return a pointer of the
MLIR sparse tensor for the result to delay the extraction of the coordinates and
non-zero values.

Implement the Tensor to_file method to evaluate the tensor assignment and write
the result to a file.

Add unit tests. Modify test golden files to reflect the change that TNS outputs
now have a comment line and two meta data lines.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D118956

2 years agoRevert "[analyzer] Prevent misuses of -analyze-function"
Balazs Benics [Tue, 8 Feb 2022 16:42:46 +0000 (17:42 +0100)]
Revert "[analyzer] Prevent misuses of -analyze-function"

This reverts commit 841817b1ed26c1fbb709957d54c0e2751624fbf8.

Ah, it still fails on build bots for some reason.
Pinning the target triple was not enough.

2 years ago[libc++][nfc] Use TEST_SAFE_STATIC.
Mark de Wever [Wed, 2 Feb 2022 18:28:03 +0000 (19:28 +0100)]
[libc++][nfc] Use TEST_SAFE_STATIC.

This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D118874

2 years ago[libc++] Removes cpp17_output_iterator's default constructor.
Mark de Wever [Fri, 4 Feb 2022 07:03:50 +0000 (08:03 +0100)]
[libc++] Removes cpp17_output_iterator's default constructor.

This has been suggested in D117950.

Reviewed By: ldionne, #libc, philnik

Differential Revision: https://reviews.llvm.org/D118971

2 years ago[Support] Don't print stacktrace if DbgHelp.dll hasn't been loaded yet
Andy Yankovsky [Mon, 7 Feb 2022 20:37:38 +0000 (20:37 +0000)]
[Support] Don't print stacktrace if DbgHelp.dll hasn't been loaded yet

On Windows certain function from `Signals.h` require that `DbgHelp.dll` is loaded. This typically happens when the main program calls `llvm::InitLLVM`, however in some cases main program doesn't do that (e.g. when the application is using LLDB via `liblldb.dll`). This patch adds a safe guard to prevent crashes. More discussion in
https://reviews.llvm.org/D119009.

Reviewed By: aganea

Differential Revision: https://reviews.llvm.org/D119181