platform/upstream/llvm.git
2 years ago[clang][tests] Add test for C++ DR2406
Timm Bäder [Tue, 8 Feb 2022 09:36:43 +0000 (10:36 +0100)]
[clang][tests] Add test for C++ DR2406

Clang already handles this fine, so add a test case to let the
make_cxx_dr_status script pick it up.

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

2 years ago[mlir][linalg] Fold tensor.pad(linalg.fill) with the same value
Lei Zhang [Thu, 10 Feb 2022 13:18:00 +0000 (08:18 -0500)]
[mlir][linalg] Fold tensor.pad(linalg.fill) with the same value

Reviewed By: mravishankar

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

2 years ago[mlir][vector] Add helper that builds a scalar reduction according to CombiningKind
Matthias Springer [Thu, 10 Feb 2022 13:21:34 +0000 (22:21 +0900)]
[mlir][vector] Add helper that builds a scalar reduction according to CombiningKind

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

2 years ago[clang-tidy] add option performance-move-const-arg.CheckMoveToConstRef
Greg Miller [Thu, 10 Feb 2022 13:19:22 +0000 (13:19 +0000)]
[clang-tidy] add option performance-move-const-arg.CheckMoveToConstRef

This option allows callers to disable the warning from
https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html
that would warn on the following

```
void f(const string &s);
string s;
f(std::move(s));  // ALLOWED if performance-move-const-arg.CheckMoveToConstRef=false
```

The reason people might want to disable this check, is because it allows
callers to use `std::move()` or not based on local reasoning about the
argument, and without having to care about how the function `f` accepts
the argument. Indeed, `f` might accept the argument by const-ref today,
but change to by-value tomorrow, and if the caller had moved the
argument that they were finished with, the code would work as
efficiently as possible regardless of how `f` accepted the parameter.

Reviewed By: ymandel

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

2 years ago[InstCombine] Extend fold (icmp sgt smin(PosA, B) 0) -> (icmp sgt B 0) to support...
Simon Pilgrim [Thu, 10 Feb 2022 13:28:15 +0000 (13:28 +0000)]
[InstCombine] Extend fold (icmp sgt smin(PosA, B) 0) -> (icmp sgt B 0) to support smin intrinsic

Replace matchSelectPattern pattern match with the more general m_SMin so that it can handle smin intrinsics as well as the icmp+select pattern

Noticed while reviewing regressions from D98152

2 years ago[InstCombine] Add test showing failure to fold (icmp sgt smin(PosA, B) 0) -> (icmp...
Simon Pilgrim [Thu, 10 Feb 2022 13:20:49 +0000 (13:20 +0000)]
[InstCombine] Add test showing failure to fold (icmp sgt smin(PosA, B) 0) -> (icmp sgt B 0) with smin intrinsic

Noticed while reviewing regressions from D98152

2 years ago[InstCombine] reduce mul operands based on undemanded high bits
Sanjay Patel [Thu, 10 Feb 2022 12:43:23 +0000 (07:43 -0500)]
[InstCombine] reduce mul operands based on undemanded high bits

We already do this in SDAG, but mul was left out of the fold
for unused high bits in IR.

The high bits of a mul's operands do not change the low bits
of the result:
https://alive2.llvm.org/ce/z/XRj5Ek

Verify some test diffs to confirm that they are correct:
https://alive2.llvm.org/ce/z/y_W8DW
https://alive2.llvm.org/ce/z/7DM5uf
https://alive2.llvm.org/ce/z/GDiHCK

This gets a fold that was presumed not possible in D114272:
https://alive2.llvm.org/ce/z/tAN-WY

Removing nsw/nuw is needed for general correctness (and is
also done in the codegen version), but we might be able to
recover more of those with better analysis.

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

2 years ago[FastISel] Remove redundant reg class check (NFC)
Nikita Popov [Thu, 10 Feb 2022 13:09:00 +0000 (14:09 +0100)]
[FastISel] Remove redundant reg class check (NFC)

SrcVT and DstVT are the same in this branch, as such their register
classes will also be the same.

2 years ago[CodeGen] Regenerate test checks (NFC)
Nikita Popov [Thu, 10 Feb 2022 11:58:35 +0000 (12:58 +0100)]
[CodeGen] Regenerate test checks (NFC)

2 years ago[MLIR][Presburger] Factor out space information to PresburgerSpace
Groverkss [Thu, 10 Feb 2022 12:54:40 +0000 (18:24 +0530)]
[MLIR][Presburger] Factor out space information to PresburgerSpace

This patch factors out space information from IntegerPolyhedron, PresburgerSet
and PWMAFunction to PresburgerSpace and its extension with local variables,
PresburgerLocalSpace.

Generally any new data structure additions in Presburger library will require
space information. This patch removes the need to duplicate the space
information.

Reviewed By: arjunp

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

2 years ago[clang][NFC] Standard substitution checking cleanup
Nathan Sidwell [Wed, 9 Feb 2022 14:09:35 +0000 (06:09 -0800)]
[clang][NFC] Standard substitution checking cleanup

In preparing for module mangling changes I noticed some issues with
the way we check for std::basic_string instantiations and friends.

*) there's a single routine for std::basic_{i,o,io}stream but it is
 templatized on the length of the name.  Really?  just use a
 StringRef, rather than clone the entire routine just for
 'basic_iostream'.

*) We have a helper routine to check for char type, and call it from
 several places.  But given all the instantiations are of the form
 TPL<char, Other<char> ...> we could just check the first arg is char
 and the later templated args are instantiating that same type.  A
 simpler type comparison.

*) Because basic_string has a third allocator parameter, it is open
 coded, which I found a little confusing.  But otherwise it's exactly
 the same pattern as the iostream ones.  Just tell that checker about
 whether there's an expected allocator argument.[*]

*) We may as well return in each block of mangleStandardSubstitution
 once we determine it is not one of the entities of interest -- it
 certainly cannot be one of the other kinds of entities.

FWIW this shaves about 500 bytes off the executable.

[*] I suppose we could also have this routine a tri-value, with one to
indicat 'it is this name, but it's not the one you're looking for', to
avoid later calls trying different names?

Reviewd By: ChuanqiXu

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

2 years ago[libc++][NFC] Reformat and modernize compressed_pair.h
Nikolas Klauser [Wed, 9 Feb 2022 20:40:11 +0000 (21:40 +0100)]
[libc++][NFC] Reformat and modernize compressed_pair.h

Reviewed By: Quuxplusone, ldionne, Mordante, #libc

Spies: libcxx-commits

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

2 years ago[demangler] Fix new/delete demangling
Nathan Sidwell [Fri, 28 Jan 2022 15:09:38 +0000 (07:09 -0800)]
[demangler] Fix new/delete demangling

I discovered some demangler problems:

a) parsing of new expressions was broken, ignoring any 'gs' prefix
b) (when #a is fixed) badly formatted global new expressions
c) formatting of new and delete failed to correctly add whitespace

(a) happens as parseExpr swallows the 'gs' prefix but doesn't pass it
 to 'parseNewExpr'.  It seems simpler to me to just code the new
 expression parsing directly in parseExpr, as is done for delete
 expressions.

(b) global new should be rendered something like '::new T' not
 '::operator new T'

(c) is resolved by being a bit more careful with whitespace.

Best shown with some examples (don't worry that these symbols are for
impossible instantiations, that's not the point):

Old behaviour:
build/bin/llvm-cxxfilt _ZN2FnIXgsnw_iEEXna_ipiLi4EEEEEvv _ZN2FnIXnwLj4E_iEEXgsnaLj4E_ipiLi4EEEEEvv _ZN2FnIXgsdlLi4EEXdaLi4EEEEvv _ZN2FnIXdlLj4EEXgsdaLj4EEEEvv
void Fn<new int, new[] int(4)>()   // No ::new
void Fn<new (4u)int, new[] (4u)int(4)>() // No ::new, poor whitespace
void Fn<::delete4, delete[] 4>()  // missing necessary space
void Fn<delete4u, ::delete[] 4u>() // missing necessary space

New behaviour:
build/bin/llvm-cxxfilt _ZN2FnIXgsnw_iEEXna_ipiLi4EEEEEvv _ZN2FnIXnwLj4E_iEEXgsnaLj4E_ipiLi4EEEEEvv _ZN2FnIXgsdlLi4EEXdaLi4EEEEvv _ZN2FnIXdlLj4EEXgsdaLj4EEEEvv
void Fn<::new int, new[] int(4)>()
void Fn<new(4u) int, ::new[](4u) int(4)>()
void Fn<::delete 4, delete[] 4>()
void Fn<delete 4u, ::delete[] 4u>()

Binutils' behaviour:
c++filt _ZN2FnIXgsnw_iEEXna_ipiLi4EEEEEvv _ZN2FnIXnwLj4E_iEEXgsnaLj4E_ipiLi4EEEEEvv _ZN2FnIXgsdlLi4EEXdaLi4EEEEvv _ZN2FnIXdlLj4EEXgsdaLj4EEEEvv
void Fn<::new int, new int(4)>()
void Fn<new (4u) int, ::new (4u) int(4)>()
void Fn<::delete (4), delete[] (4)>()
void Fn<delete (4u), ::delete[] (4u)>()

The new and binutils demanglings are the same modulo some whitespace and optional parens.

Reviewed By: ChuanqiXu

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

2 years ago[ConstraintElimination] Remove unnecessary recursion (NFC).
Florian Hahn [Thu, 10 Feb 2022 12:26:35 +0000 (12:26 +0000)]
[ConstraintElimination] Remove unnecessary recursion (NFC).

Perform predicate normalization in a single switch, rather then going
through recursions.

2 years ago[AArch64][SVE] Fix selection failure during lowering of shuffle_vector
Bradley Smith [Tue, 8 Feb 2022 16:01:13 +0000 (16:01 +0000)]
[AArch64][SVE] Fix selection failure during lowering of shuffle_vector

The lowering code for shuffle_vector has a code path that looks through
extract_subvector, this code path did not properly account for the
potential presense of larger than Neon vector types and could produce
unselectable DAG nodes.

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

2 years ago[LoopVectorize] Regenerate reduction-predselect.ll test checks
Simon Pilgrim [Thu, 10 Feb 2022 12:03:10 +0000 (12:03 +0000)]
[LoopVectorize] Regenerate reduction-predselect.ll test checks

2 years ago[Driver] Use libatomic for 32-bit SPARC atomics support
Rainer Orth [Thu, 10 Feb 2022 11:40:32 +0000 (12:40 +0100)]
[Driver] Use libatomic for 32-bit SPARC atomics support

Even after D86621 <https://reviews.llvm.org/D86621>, `clang -m32` on
Solaris/sparcv9 doesn't inline atomics with 8-byte operands, unlike `gcc`.
This leads to many link failures in the testsuite (undefined references to
`__atomic_load_8` and `__sync_val_compare_and_swap_8`.  Until a proper
codegen fix can be implemented, this patch works around the first of those
by linking with `-latomic`.

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

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

2 years ago[DebugInfo][InstrRef] Don't fire assertions if debug-info is faulty
Jeremy Morse [Thu, 10 Feb 2022 11:07:15 +0000 (11:07 +0000)]
[DebugInfo][InstrRef] Don't fire assertions if debug-info is faulty

It's inevitable that optimisation passes will fail to update debug-info:
when that happens, it's best if the compiler doesn't crash as a result.
Therefore, downgrade a few assertions / failure modes that would crash
when illegal debug-info was seen, to instead drop variable locations. In
practice this means that an instruction reference to a nonexistant or
illegal operand should be tolerated.

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

2 years ago[LLParser][OpaquePtr] Support forward reference to unnamed function
Nikita Popov [Thu, 10 Feb 2022 11:20:34 +0000 (12:20 +0100)]
[LLParser][OpaquePtr] Support forward reference to unnamed function

With opaque pointers, we always create forward references as i8
globals, so it will not be Function here.

2 years ago[NVPTX] Use align attribute for kernel pointer arg alignment
Nikita Popov [Tue, 8 Feb 2022 15:24:36 +0000 (16:24 +0100)]
[NVPTX] Use align attribute for kernel pointer arg alignment

Instead of determining the alignment based on the pointer element
type (which is incompatible with opaque pointers), make use of
alignment annotations added by the frontend.

In particular, clang will add alignment attributes to OpenCL kernels
since D118894. Other frontends might need to be adjusted to add
the attribute as well.

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

2 years ago[cross-project-tests] Add REQUIRES: compiler-rt to tests that use asan
OCHyams [Wed, 9 Feb 2022 17:08:43 +0000 (17:08 +0000)]
[cross-project-tests] Add REQUIRES: compiler-rt to tests that use asan

And XFAIL debuginfo-tests/llgdb-tests/asan-deque.cpp on !system-darwin.
On non-darwin systems these tests use gdb and this one fails because gdb
doesn't pretty-print std::deque (the elements of the deque are not printed so
the CHECK lines fail).

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

2 years agoReland "[lldb] Remove non address bits when looking up memory regions"
David Spickett [Wed, 1 Dec 2021 16:14:54 +0000 (16:14 +0000)]
Reland "[lldb] Remove non address bits when looking up memory regions"

This reverts commit 0df522969a7a0128052bd79182c8d58e00556e2f.

Additional checks are added to fix the detection of the last memory region
in GetMemoryRegions or repeating the "memory region" command when the
target has non-address bits.

Normally you keep reading from address 0, looking up each region's end
address until you get LLDB_INVALID_ADDR as the region end address.
(0xffffffffffffffff)

This is what the remote will return once you go beyond the last mapped region:
[0x0000fffffffdf000-0x0001000000000000) rw- [stack]
[0x0001000000000000-0xffffffffffffffff) ---

Problem is that when we "fix" the lookup address, we remove some bits
from it. On an AArch64 system we have 48 bit virtual addresses, so when
we fix the end address of the [stack] region the result is 0.
So we loop back to the start.

[0x0000fffffffdf000-0x0001000000000000) rw- [stack]
[0x0000000000000000-0x0000000000400000) ---

To fix this I added an additional check for the last range.
If the end address of the region is different once you apply
FixDataAddress, we are at the last region.

Since the end of the last region will be the last valid mappable
address, plus 1. That 1 will be removed by the ABI plugin.

The only side effect is that on systems with non-address bits, you
won't get that last catch all unmapped region from the max virtual
address up to 0xf...f.

[0x0000fffff8000000-0x0000fffffffdf000) ---
[0x0000fffffffdf000-0x0001000000000000) rw- [stack]
<ends here>

Though in some way this is more correct because that region is not
just unmapped, it's not mappable at all.

No extra testing is needed because this is already covered by
TestMemoryRegion.py, I simply forgot to run it on system that had
both top byte ignore and pointer authentication.

This change has been tested on a qemu VM with top byte ignore,
memory tagging and pointer authentication enabled.

Reviewed By: omjavaid

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

2 years ago[flang] Add FIRInlinerInterface
Valentin Clement [Thu, 10 Feb 2022 10:37:53 +0000 (11:37 +0100)]
[flang] Add FIRInlinerInterface

This patch introduces the FIRInlinerInterface.
This class defines the interface for handling inlining of FIR calls.

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

Reviewed By: schweitz

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2 years ago[ArgPromotion] Transfer metadata to promoted loads
Nikita Popov [Thu, 10 Feb 2022 10:26:26 +0000 (11:26 +0100)]
[ArgPromotion] Transfer metadata to promoted loads

Also transfer selected non-AA metadata to the promoted load.
Only metadata from guaranteed to execute loads is transferred.

2 years ago[ArgPromotion] Add test for metadata on promoted loads (NFC)
Nikita Popov [Thu, 10 Feb 2022 10:23:09 +0000 (11:23 +0100)]
[ArgPromotion] Add test for metadata on promoted loads (NFC)

2 years ago[LoongArch][test] (6/6) Add encoding and mnemonics tests
Lu Weining [Thu, 10 Feb 2022 09:16:06 +0000 (09:16 +0000)]
[LoongArch][test] (6/6) Add encoding and mnemonics tests

With the benefit of D88392, instruction encoding and mnemonic testing can be
achieved within MIR files before AsmParser is ready. This patch adds such
tests which cover all basic integer instructions we defined in previous patch.
Similarly those tests will be rewrote by .s and moved to test/MC/LoongArch.

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

2 years ago[Utils][LoongArch](5/6) Add a --bits-endian option to extract-section.py
Lu Weining [Thu, 10 Feb 2022 09:15:10 +0000 (09:15 +0000)]
[Utils][LoongArch](5/6) Add a --bits-endian option to extract-section.py

This is a split patch of D115862 which adds a --bits-endian option to
extract-section to make it possible to print bits in specified endianness.
It means that we can print instruction encoding of some targets like LoongArch
as bits[0] to bits[31] from right to left by specifing --bits-endian little.

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

2 years ago[LoongArch 4/6] Add basic tablegen infra for LoongArch
Lu Weining [Thu, 10 Feb 2022 09:14:18 +0000 (09:14 +0000)]
[LoongArch 4/6] Add basic tablegen infra for LoongArch

This patch introduces basic tablegen infra such as
LoongArch{InstrFormats,InstrInfo,RegisterInfo,CallingConv,}.td.

For now, only add instruction definitions for LoongArch basic integer
operations.
Our initial target is a working MC layer rather than codegen,
so appropriate SelectionDAG patterns will come later.

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

2 years ago[LoongArch 3/6] Add target stub for LoongArch
Lu Weining [Thu, 10 Feb 2022 09:12:09 +0000 (09:12 +0000)]
[LoongArch 3/6] Add target stub for LoongArch

This patch registers the 'loongarch32' and 'loongarch64' targets. Also adds a
simple testcase to check the output of llc --vesion containing the targets.

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

2 years ago[LoongArch 2/6] Add ELF machine flag and relocs for upcoming LoongArch target
Lu Weining [Thu, 10 Feb 2022 09:11:11 +0000 (09:11 +0000)]
[LoongArch 2/6] Add ELF machine flag and relocs for upcoming LoongArch target

This patch adds necessary definitions for LoongArch ELF files, including
relocation types. Also adds initial support to ELFYaml, llvm-objdump,
and llvm-readobj in order to work with LoongArch ELFs.

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

2 years ago[LoongArch 1/6] Add triples loongarch{32,64} for the upcoming LoongArch target
Lu Weining [Thu, 10 Feb 2022 09:09:32 +0000 (09:09 +0000)]
[LoongArch 1/6] Add triples loongarch{32,64} for the upcoming LoongArch target

This is the first patch to incrementally add an MC layer for LoongArch to LLVM.
This patch also adds unit testcases for these new triples.

RFC for adding this new backend:
https://lists.llvm.org/pipermail/llvm-dev/2021-December/154371.html

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

2 years ago[mlir][vector][NFC] Use CombiningKindAttr instead of StringAttr
Matthias Springer [Thu, 10 Feb 2022 10:12:46 +0000 (19:12 +0900)]
[mlir][vector][NFC] Use CombiningKindAttr instead of StringAttr

This makes the op consistent with other ops in vector dialect.

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

2 years ago[RISCV] Pre-process FP SPLAT_VECTOR to RISCVISD::VFMV_V_F_VL
Fraser Cormack [Wed, 19 Jan 2022 13:54:11 +0000 (13:54 +0000)]
[RISCV] Pre-process FP SPLAT_VECTOR to RISCVISD::VFMV_V_F_VL

This patch builds on top of D119197 to canonicalize floating-point
SPLAT_VECTOR as RISCVISD::VFMV_V_F_VL as a pre-process ISel step.

This primarily benefits scalable-vector VP code, where our VP patterns
only match VFMV_V_F_VL to reduce the burden on our ISel patterns, but
where at the same time, scalable-vector code doesn't custom-legalize
SPLAT_VECTOR.

Reviewed By: craig.topper

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

2 years ago[ARM] Patterns for vector conversion between half and float
Oliver Stannard [Wed, 9 Feb 2022 17:43:42 +0000 (17:43 +0000)]
[ARM] Patterns for vector conversion between half and float

These patterns were omitted because clang only allows converting between
these types using intrinsics, but other front-ends or optimisation
passes may want to use them.

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

2 years ago[clang-format] Move FormatToken::opensBlockOrBlockTypeList to source file. NFC.
Marek Kurdej [Thu, 10 Feb 2022 09:14:36 +0000 (10:14 +0100)]
[clang-format] Move FormatToken::opensBlockOrBlockTypeList to source file. NFC.

2 years agoRevert "[MLIR] Fix fold-memref-subview-ops for affine.load/store"
Tres Popp [Thu, 10 Feb 2022 09:46:05 +0000 (10:46 +0100)]
Revert "[MLIR] Fix fold-memref-subview-ops for affine.load/store"

This reverts commit ac6cb41303450b4cf8b5c71b971b729990b93a36.

This code has a stack-use-after-scope error that can be seen with asan.

2 years ago[OpenCL] Refactor cl_ext_float_atomics declarations; NFC
Sven van Haastregt [Thu, 10 Feb 2022 09:43:32 +0000 (09:43 +0000)]
[OpenCL] Refactor cl_ext_float_atomics declarations; NFC

Reduce the amount of repetition in the declarations by leveraging more
TableGen constructs.  This is in preparation for adding the OpenCL 3.0
atomics feature optionality.

2 years agoFix incorrect TypeSize->uint64_t cast in InductionDescriptor::isInductionPHI
David Sherwood [Tue, 1 Feb 2022 13:09:54 +0000 (13:09 +0000)]
Fix incorrect TypeSize->uint64_t cast in InductionDescriptor::isInductionPHI

The code was relying upon the implicit conversion of TypeSize to
uint64_t and assuming the type in question was always fixed. However,
I discovered an issue when running the canon-freeze pass with some
IR loops that contains scalable vector types. I've changed the code
to bail out if the size is unknown at compile time, since we cannot
compute whether the step is a multiple of the type size or not.

I added a test here:

  Transforms/CanonicalizeFreezeInLoops/phis.ll

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

2 years ago[llvm] Fix update_analyze_test_checks and add a test to prevent further breakage
Roman Lebedev [Thu, 10 Feb 2022 09:32:55 +0000 (12:32 +0300)]
[llvm] Fix update_analyze_test_checks and add a test to prevent further breakage

2 years ago[GlobalISel] CSE FP constants at -O0
Jay Foad [Wed, 9 Feb 2022 16:03:05 +0000 (16:03 +0000)]
[GlobalISel] CSE FP constants at -O0

At -O0 we claim to CSE constants only. I think this should apply to
G_FCONSTANT as well as G_CONSTANT.

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

2 years agoUpdate bazel after 8d12bf4ac102ea5887705ca467163aecea13b6f1
Tres Popp [Thu, 10 Feb 2022 09:12:04 +0000 (10:12 +0100)]
Update bazel after 8d12bf4ac102ea5887705ca467163aecea13b6f1

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[libcxx] [test] Fix the aligned storage test to work on Windows
Martin Storsjö [Tue, 11 Jan 2022 09:31:14 +0000 (09:31 +0000)]
[libcxx] [test] Fix the aligned storage test to work on Windows

Don't test alignment over 8 KB, which isn't supported on that
platform.

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

2 years ago[clang] [MinGW] Default to DWARF 4
Martin Storsjö [Wed, 9 Feb 2022 13:15:25 +0000 (15:15 +0200)]
[clang] [MinGW] Default to DWARF 4

Neither LLDB nor GDB seem to work with DWARF 5 debug information on
Windows right now.

This applies the same change as in
9c6272861032f511a23784ce0c5cc8f6ac2f625b (Default to DWARFv4 on Windows)
to the MinGW driver too.

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

2 years ago[NVPTX] Eliminate StoreRetval instructions with undef operand
Daniil Kovalev [Thu, 10 Feb 2022 07:17:25 +0000 (10:17 +0300)]
[NVPTX] Eliminate StoreRetval instructions with undef operand

Previously a lot of StoreRetval instructions with undef operand were
generated on NVPTX target when a big struct was returned by value.
It resulted in a lot of unneeded st.param.* instructions in final
assembly. The patch solves the issue by implementing the logic in
NVPTX-specific part of DAG combiner.

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

2 years agotest-release.sh: Remove test-suite from LLVM_ENABLE_PROJECTS
Diana Picus [Wed, 9 Feb 2022 09:22:50 +0000 (10:22 +0100)]
test-release.sh: Remove test-suite from LLVM_ENABLE_PROJECTS

I think this was just being ignored before, but now it crashes because
we're checking if the projects that we're trying to enable are valid.
There is no test-suite project (it's a separate repo with separate
handling), so we should never try to enable it.

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

2 years ago[MLIR] Fix fold-memref-subview-ops for affine.load/store
Uday Bondhugula [Mon, 31 Jan 2022 11:47:10 +0000 (17:17 +0530)]
[MLIR] Fix fold-memref-subview-ops for affine.load/store

Fix fold-memref-subview-ops for affine.load/store. We need to expand out
the affine apply on its operands.

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

2 years ago[OpenMP][IRBuilder] Handle floats for atomic update and fix AllocaIP for update/capture
Shraiysh Vaishay [Thu, 10 Feb 2022 05:08:06 +0000 (10:38 +0530)]
[OpenMP][IRBuilder] Handle floats for atomic update and fix AllocaIP for update/capture

This patch fixes `createAtomicUpdate` for lowering with float types.
Test added for the same.

This patch also changes the alloca argument for createAtomicUpdate and
createAtomicCapture from `Instruction*` to `InsertPointTy`. This is in
line with the other functions of the OpenMPIRBuilder class which take
AllocaIP as an `InsertPointTy`.

Reviewed By: Meinersbur

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

2 years agoFix flang build breakage - trim dependency to AffineUtils
Uday Bondhugula [Thu, 10 Feb 2022 06:01:05 +0000 (11:31 +0530)]
Fix flang build breakage - trim dependency to AffineUtils

There wasn't a need for FIRTransforms to depend on AffineToStandard
conversoin for just an affine utility. The utility was moved to
AffineUtils recently. Fix flang build breakage.

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

2 years ago[CSKY] Add missing header include in cpp files because of LLVM headers refactor work
Zi Xuan Wu [Thu, 10 Feb 2022 05:37:37 +0000 (13:37 +0800)]
[CSKY] Add missing header include in cpp files because of LLVM headers refactor work

2 years ago[gn build] Port 8f1d8785df92
LLVM GN Syncbot [Thu, 10 Feb 2022 04:36:06 +0000 (04:36 +0000)]
[gn build] Port 8f1d8785df92

2 years ago[libc++][ranges] Implement `permutable`.
Konstantin Varlamov [Thu, 10 Feb 2022 04:32:56 +0000 (20:32 -0800)]
[libc++][ranges] Implement `permutable`.

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

2 years ago[MLIR][NFC] Move expandAffineMap/Expr out to Affine utils
Uday Bondhugula [Thu, 10 Feb 2022 04:26:10 +0000 (09:56 +0530)]
[MLIR][NFC] Move expandAffineMap/Expr out to Affine utils

Move expandAffineMap and expandAffineApplyExpr out to AffineUtils. This
is a useful method. The child revision uses it. NFC.

Reviewed By: rriddle

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

2 years ago[llvm-objdump/mac] Silence XAR deprecation warning (NFC)
Keith Smiley [Sun, 30 Jan 2022 18:06:41 +0000 (10:06 -0800)]
[llvm-objdump/mac] Silence XAR deprecation warning (NFC)

If you're building this on macOS 12.x+ this produces a deprecation
warning. I'm not sure what this means for the bitcode format going
forward, but it seems safe to silence for now.

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

2 years ago[AMDGPU] Select no-return atomic ops in FLATInstructions.td.
Abinav Puthan Purayil [Mon, 7 Feb 2022 17:48:10 +0000 (23:18 +0530)]
[AMDGPU] Select no-return atomic ops in FLATInstructions.td.

This change adds the selection for the no-return global_* and flat_*
instructions in tblgen.  The motivation for this is to get the no-return atomic
isel working without relying on post-isel hooks so that GlobalISel can start
selecting them (once GlobalISelEmitter allows no return atomic patterns like
how DAGISel does).

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

2 years ago[AMDGPU] Select no-return ds_* atomic ops in tblgen.
Abinav Puthan Purayil [Mon, 27 Dec 2021 10:46:38 +0000 (16:16 +0530)]
[AMDGPU] Select no-return ds_* atomic ops in tblgen.

SelectionDAG relies on MachineInstr's HasPostISelHook for selecting the
no-return atomic ops. GlobalISel, at the moment, doesn't handle
HasPostISelHook.

This change adds the selection for no-return ds_* atomic ops in tblgen
so that it can work with both GlobalISel and SelectionDAG. I couldn't
add the predicates for GlobalISel in this change since there's a
restriction in GlobalISelEmitter that disallows selecting generic
atomics ops that return with instructions that doesn't return.

We can't remove the HasPostISelHook code that selects the no return
atomic ops in SelectionDAG yet since we still need to cover selections
in FLATInstructions.td, BUFInstructions.td.

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

2 years ago[ORC-RT] Add two new jit-dlopen testcases, and switch to .c for dlopen tests.
Lang Hames [Thu, 10 Feb 2022 02:53:03 +0000 (13:53 +1100)]
[ORC-RT] Add two new jit-dlopen testcases, and switch to .c for dlopen tests.

We don't need precise control over the low-level behavior of these testcases so
C should be preferred for readability.

The new testcases test (1) the base dlopen case (running initializers and
deinitializers), and (2) the serial case of dlopen; dlclose; dlopen; dlclose,
where we expect the initializers and deinitializers to be run twice.

2 years ago[MLIR][NFC] Remove unused argument in affine scalrep helper util
Uday Bondhugula [Thu, 10 Feb 2022 02:36:19 +0000 (08:06 +0530)]
[MLIR][NFC] Remove unused argument in affine scalrep helper util

NFC. Remove unused argument in affine scalrep helper utility.

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

2 years ago[PowerPC] Add custom lowering for SELECT_CC fp128 using xsmaxcqp
Ting Wang [Thu, 10 Feb 2022 02:48:28 +0000 (21:48 -0500)]
[PowerPC] Add custom lowering for SELECT_CC fp128 using xsmaxcqp

Power ISA 3.1 adds xsmaxcqp/xsmincqp for quad-precision type-c max/min selection,
and this opens the opportunity to improve instruction selection on: llvm.maxnum.f128,
llvm.minnum.f128, and select_cc ordered gt/lt and (don't care) gt/lt.

Reviewed By: nemanjai, shchenz, amyk

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

2 years ago[X86] Only force FP usage in the presence of pushf/popf on Win64
Reid Kleckner [Thu, 10 Feb 2022 00:31:38 +0000 (16:31 -0800)]
[X86] Only force FP usage in the presence of pushf/popf on Win64

This ensures that the Windows unwinder will work at every instruction
boundary, and allows other targets to read and write flags without
setting up a frame pointer.

Fixes GH-46875

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

2 years ago[OMPIRBuilder] Remove the support for floating point values for atomic compare operation
Shilei Tian [Thu, 10 Feb 2022 02:15:05 +0000 (21:15 -0500)]
[OMPIRBuilder] Remove the support for floating point values for atomic compare operation

This patch removes the type punning in atomic compare operation for
floating point values because the direct comparison doesn't make too much sense
for floating point values.

Reviewed By: jdoerfert

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

2 years ago[NFC] [Modules] Refactor ODR checking for default template argument in
Chuanqi Xu [Thu, 10 Feb 2022 01:56:44 +0000 (09:56 +0800)]
[NFC] [Modules] Refactor ODR checking for default template argument in
ASTReader

This is a cleanup to reduce the lines of code to handle default template
argument in ASTReader.

Reviewed By: urnathan

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

2 years agoNFC: fix GCC warning -Wcast-qual
Yuanfang Chen [Thu, 10 Feb 2022 02:03:04 +0000 (18:03 -0800)]
NFC: fix GCC warning -Wcast-qual

2 years ago[RISCV] Add support for matching vwmaccsu/vwmaccus from fixed vectors
Chenbing.Zheng [Thu, 10 Feb 2022 01:46:47 +0000 (01:46 +0000)]
[RISCV] Add support for matching vwmaccsu/vwmaccus from fixed vectors

Add pattern to match add and widening mul to vwmacc, and
two multipliers are sext and zext.

Reviewed By: craig.topper

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

2 years ago[mlir][sparse][pytaco] test cleanup
Aart Bik [Wed, 9 Feb 2022 22:23:22 +0000 (14:23 -0800)]
[mlir][sparse][pytaco] test cleanup

removed obsoleted TODO
removed strange Fp precision for coordinates
lined up meta data testing code for readability

Reviewed By: bixia

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

2 years agoFolding in the front end was replacing calls to LEN and dropping
Eric Schweitz [Wed, 9 Feb 2022 21:11:05 +0000 (13:11 -0800)]
Folding in the front end was replacing calls to LEN and dropping
arguments even in situations where the arguments are required to compute
the LEN value at runtime.

Add tests.

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

2 years ago[test] Replace `-analyze -divergence` with `-passes='print<divergence>'`
Arthur Eubanks [Thu, 10 Feb 2022 00:09:14 +0000 (16:09 -0800)]
[test] Replace `-analyze -divergence` with `-passes='print<divergence>'`

2 years ago[test] Remove one more unnecessary -analyze RUN line
Arthur Eubanks [Thu, 10 Feb 2022 00:05:43 +0000 (16:05 -0800)]
[test] Remove one more unnecessary -analyze RUN line

There is a new PM equivalent RUN line.

2 years ago[test] Test domtree validity with -verify-dom-info instead of -analyze
Arthur Eubanks [Wed, 9 Feb 2022 23:59:00 +0000 (15:59 -0800)]
[test] Test domtree validity with -verify-dom-info instead of -analyze

Verified that the test properly crashes without D16893's fix.

2 years agoFix comment after upstream: 9e08e9298059651e4f42eb608c3de9d4ad8004b2 - [ELF] Allow...
Ben Dunbobbin [Mon, 7 Feb 2022 14:34:31 +0000 (14:34 +0000)]
Fix comment after upstream: 9e08e9298059651e4f42eb608c3de9d4ad8004b2 - [ELF] Allow STV_PROTECTED shared definition to set exportDynamic?

2 years ago[test] Replace/remove some 'opt -analyze' RUN lines
Arthur Eubanks [Wed, 9 Feb 2022 23:49:53 +0000 (15:49 -0800)]
[test] Replace/remove some 'opt -analyze' RUN lines

2 years ago[test] Migrate '-analyze -cost-model' to '-passes=print<cost-model>'
Arthur Eubanks [Wed, 9 Feb 2022 23:25:18 +0000 (15:25 -0800)]
[test] Migrate '-analyze -cost-model' to '-passes=print<cost-model>'

2 years ago[ORC] Make LLJIT's destructor virtual.
Lang Hames [Wed, 9 Feb 2022 02:02:48 +0000 (13:02 +1100)]
[ORC] Make LLJIT's destructor virtual.

This allows LLLazyJIT instances to be safely owned by unique_ptr<LLJIT>s.

Reviewed By: lhames

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

2 years ago[gn build] Port 76cad51b
Arthur Eubanks [Wed, 9 Feb 2022 23:16:05 +0000 (15:16 -0800)]
[gn build] Port 76cad51b

2 years agoreplace clang LLVM_ENABLE_PLUGINS -> CLANG_PLUGIN_SUPPORT in tests
Jameson Nash [Mon, 7 Feb 2022 23:46:33 +0000 (18:46 -0500)]
replace clang LLVM_ENABLE_PLUGINS -> CLANG_PLUGIN_SUPPORT in tests

Ensure CLANG_PLUGIN_SUPPORT is compatible with llvm_add_library.
Fixes an issue noted in D111100.

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

2 years ago[DAG] Remove pointless std::function wrapper, NFC
Reid Kleckner [Wed, 9 Feb 2022 22:30:32 +0000 (14:30 -0800)]
[DAG] Remove pointless std::function wrapper, NFC

2 years ago[mlir] Add classes to define new TypeIDs at runtime
Mathieu Fehr [Wed, 9 Feb 2022 22:23:43 +0000 (23:23 +0100)]
[mlir] Add classes to define new TypeIDs at runtime

TypeIDAllocator enables the allocation of new TypeIDs at runtime,
that are unique during the lifetime of the allocator.

NonMovableTypeIDOwner is a class used to define a new TypeID for each instance
of a class, using the instance address. This class cannot be copied or moved.

Reviewed By: rriddle

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

2 years ago[Debuginfod] Flag-determine debuginfod lookups in llvm-symbolizer.
Daniel Thornburgh [Mon, 31 Jan 2022 22:22:22 +0000 (22:22 +0000)]
[Debuginfod] Flag-determine debuginfod lookups in llvm-symbolizer.

This change adds a pair of flags controlling whether llvm-symbolizer
attempts debuginfod lookups. Lookups are attempted if --debuginfod is
passed and disabled if --no-debuginfod is passed.

The default behavior is made more nuanced: debuginfod lookups are now
only attempted if an HTTP client is compiled in and at least one backing
debuginfod URL was configured via environment variable. Previously,
debuginfod lookups would always be attempted, even if there were no
chance that they could succeed.

Reviewed By: phosek

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

2 years agoUse functions with prototypes when appropriate; NFC
Aaron Ballman [Wed, 9 Feb 2022 22:13:53 +0000 (17:13 -0500)]
Use functions with prototypes when appropriate; NFC

A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the sixth batch of tests being updated (there are a significant
number of other tests left to be updated).

2 years ago[Symbolize] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D118633
Fangrui Song [Wed, 9 Feb 2022 22:08:47 +0000 (14:08 -0800)]
[Symbolize] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D118633

2 years ago[libcxx][test] optional's comparisons with optional are not portably constrained
Casey Carter [Wed, 29 Dec 2021 22:12:40 +0000 (14:12 -0800)]
[libcxx][test] optional's comparisons with optional are not portably constrained

so use them as concept test cases only with libc++.

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

2 years agoRevert "[DagCombine] Increase depth by number of operands to avoid a pathological...
Reid Kleckner [Wed, 9 Feb 2022 21:52:26 +0000 (13:52 -0800)]
Revert "[DagCombine] Increase depth by number of operands to avoid a pathological compile time."

Appears to be causing check-llvm to fail

This reverts commit 49ab760090514dcbf84bd9dc7429146c4ca578ef.

2 years ago[DWARFLinker] Include llvm/MC/MCSubtargetInfo.h
Fangrui Song [Wed, 9 Feb 2022 21:49:45 +0000 (13:49 -0800)]
[DWARFLinker] Include llvm/MC/MCSubtargetInfo.h

2 years ago[SCEV] Make SCEVUnionPredicate externally immutable [NFC]
Philip Reames [Wed, 9 Feb 2022 21:15:17 +0000 (13:15 -0800)]
[SCEV] Make SCEVUnionPredicate externally immutable [NFC]

This is the last major stepping stone before being able to allocate the node via the folding set allocator.  That will in turn allow more general SCEV predicate expression trees.

2 years ago[clang-format] Fix formatting of macro definitions with a leading comment.
Marek Kurdej [Mon, 7 Feb 2022 07:51:57 +0000 (08:51 +0100)]
[clang-format] Fix formatting of macro definitions with a leading comment.

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

Reviewed By: HazardyKnusperkeks

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

2 years ago[clang-format] Fix formatting of the array form of delete.
Marek Kurdej [Wed, 9 Feb 2022 21:16:16 +0000 (22:16 +0100)]
[clang-format] Fix formatting of the array form of delete.

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

There was an inconsistency in formatting of delete expressions.

Before:
```
delete (void*)a;
delete[](void*) a;
```

After this patch:
```
delete (void*)a;
delete[] (void*)a;
```

Reviewed By: HazardyKnusperkeks, owenpan

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

2 years ago[DagCombine] Increase depth by number of operands to avoid a pathological compile...
Alina Sbirlea [Thu, 3 Feb 2022 07:31:07 +0000 (23:31 -0800)]
[DagCombine] Increase depth by number of operands to avoid a pathological compile time.

We're hitting a pathological compile-time case, profiled to be in
DagCombiner::visitTokenFactor and many inserts into a SmallPtrSet.
It looks like one of the paths around findBetterNeighborChains is not
capped and leads to this.

This patch resolves the issue. Looking for feedback if this solution
looks reasonable.

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

2 years ago[lldb/crashlog] Fix arm64 register parsing on crashlog.py
Med Ismail Bennani [Tue, 8 Feb 2022 22:44:57 +0000 (14:44 -0800)]
[lldb/crashlog] Fix arm64 register parsing on crashlog.py

This patch fixes the register parser for arm64 crashlogs.

Compared to x86_64 crashlogs, the arm64 crashlogs nests the general
purpose registers into a separate dictionary within `thread_state`
dictionary. It uses the dictionary key as the the register number.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years ago[lldb/test] Split Scripted Process test in multiple tests (NFC)
Med Ismail Bennani [Tue, 8 Feb 2022 22:44:43 +0000 (14:44 -0800)]
[lldb/test] Split Scripted Process test in multiple tests (NFC)

This splits the scripted process tests to be able to run in parallel
since some of test functions can take a very long time to run.

This also disables debug info testing.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years ago[lldb/test] Fix TestScriptedProcess.py timeout on x86_64
Med Ismail Bennani [Tue, 8 Feb 2022 22:43:36 +0000 (14:43 -0800)]
[lldb/test] Fix TestScriptedProcess.py timeout on x86_64

This patch fixes a timeout issue on the ScriptedProcess test that was
happening on intel platforms. The timeout was due to a misreporting of
the StopInfo in the ScriptedThread that caused the ScriptedProcess to
never stop.

To solve this, this patch changes the way a ScriptedThread reports its
stop reason by making it more architecture specific. In order to do so,
this patch also refactors the ScriptedProcess & ScriptedThread
initializer methods to provide an easy access to the target architecture.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years ago[LLDB][NativePDB] fix that FindSymbolScope never finds scope of a symbol if it doesn...
Zequan Wu [Wed, 9 Feb 2022 21:19:29 +0000 (13:19 -0800)]
[LLDB][NativePDB] fix that FindSymbolScope never finds scope of a symbol if it doesn't open a scope

2 years ago[ConstraintElimination] Skip floating point compares. (NFC)
Florian Hahn [Wed, 9 Feb 2022 21:16:49 +0000 (21:16 +0000)]
[ConstraintElimination] Skip floating point compares. (NFC)

The solver only supports integer conditions. Adding floating point
compares to the worklist only adds extra work. Just skip them.

2 years ago[clang-format] Honour "// clang-format off" when using QualifierOrder.
Marek Kurdej [Wed, 9 Feb 2022 20:58:22 +0000 (21:58 +0100)]
[clang-format] Honour "// clang-format off" when using QualifierOrder.

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

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

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

2 years ago[SCEV] Remove a direct call to SCEVUnionPredicate::add [NFC]
Philip Reames [Wed, 9 Feb 2022 21:03:42 +0000 (13:03 -0800)]
[SCEV] Remove a direct call to SCEVUnionPredicate::add [NFC]

2 years ago[MLIR][Presburger] Disambiguate call to floor
Rainer Orth [Wed, 9 Feb 2022 21:01:55 +0000 (22:01 +0100)]
[MLIR][Presburger] Disambiguate call to floor

While testing LLVM 14.0.0 rc1 on Solaris, compilation of `FAIL`ed with

  /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/Analysis/Presburger/Utils.cpp: In lambda function:
  /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/Analysis/Presburger/Utils.cpp:48:58: error: call of overloaded ‘floor(int64_t)’ is ambiguous
     48 |                  [gcd](int64_t &n) { return floor(n / gcd); });
        |                                                          ^
  ...
  /usr/gcc/10/lib/gcc/sparcv9-sun-solaris2.11/10.3.0/include-fixed/iso/math_iso.h:201:21:
note: candidate: ‘long double std::floor(long double)’
    201 |  inline long double floor(long double __X) { return __floorl(__X); }
        |                     ^~~~~
  /usr/gcc/10/lib/gcc/sparcv9-sun-solaris2.11/10.3.0/include-fixed/iso/math_iso.h:165:15:
note: candidate: ‘float std::floor(float)’
    165 |  inline float floor(float __X) { return __floorf(__X); }
        |               ^~~~~
  /usr/gcc/10/lib/gcc/sparcv9-sun-solaris2.11/10.3.0/include-fixed/iso/math_iso.h:78:15:
note: candidate: ‘double std::floor(double)’
     78 | extern double floor __P((double));
        |               ^~~~~

The same issue had already occured in the past, cf. D108750
<https://reviews.llvm.org/D108750>, and the solution is the same: cast the
`floor` arg to `double`.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.

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

2 years ago[libunwind] Avoid a warning in 32 bit builds. NFC.
Martin Storsjö [Wed, 9 Feb 2022 17:36:58 +0000 (19:36 +0200)]
[libunwind] Avoid a warning in 32 bit builds. NFC.

The warning was introduced with the recently merged SPARCv9
support in 2b9554b8850192bdd86c02eb671de1d866df8d87.

The cast matches the existing surrounding cases.

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

2 years ago[mlir][sparse] Rename index_t to index_type again
Rainer Orth [Wed, 9 Feb 2022 20:59:52 +0000 (21:59 +0100)]
[mlir][sparse] Rename index_t to index_type again

While testing LLVM 14.0.0 rc1 on Solaris, I ran into a compile failure:

                   from /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp:22:
  /usr/include/sys/types.h:103:16: error: conflicting declaration ‘typedef short int index_t’
    103 | typedef short  index_t;
        |                ^~~~~~~
  In file included from
/var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/ExecutionEngine/SparseTensorUtils.cpp:17:
  /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/include/mlir/ExecutionEngine/SparseTensorUtils.h:26:7:
note: previous declaration as ‘using index_t = uint64_t’
     26 | using index_t = uint64_t;
        |       ^~~~~~~

The same issue had already occured in the past and fixed in D72619
<https://reviews.llvm.org/D72619>.  More detailed explanation can also be
found there.

Tested on `amd64-pc-solaris2.11` and `sparcv9-solaris2.11`.

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

2 years ago[SCEV] Unwind SCEVUnionPredicate from getPredicatedBackedgeTakenCount [NFC]
Philip Reames [Wed, 9 Feb 2022 20:16:10 +0000 (12:16 -0800)]
[SCEV] Unwind SCEVUnionPredicate from getPredicatedBackedgeTakenCount [NFC]

For those curious, the whole reason for tracking the predicate set seperately as opposed to just immediately registering the dependencies appears to be allowing the printing code to print a result without changing the PSE state.  It's slightly questionable if this justifies the complexity, but since we can preserve it with local ugliness, I did so.

2 years ago[libc] undefined reference in LibcTest.cpp
Guillaume Chatelet [Tue, 8 Feb 2022 14:52:50 +0000 (14:52 +0000)]
[libc] undefined reference in LibcTest.cpp

GCC complains about undefined reference in LibcTest.cpp and indeed the wrong version of the template has been explicitly instanciated.
This is necessary to get llvm-libc compile with GCC.

Mentionning D119002 here for navigability.

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

2 years ago[flang] Upstream runtime changes for inquiry intrinsics
Peter Steinfeld [Wed, 9 Feb 2022 19:17:18 +0000 (11:17 -0800)]
[flang] Upstream runtime changes for inquiry intrinsics

This change adds runtime routines and tests for LBOUND when passed a DIM argument, SIZE, and UBOUND when not passed a DIM argument.

Associated changes for lowering have already been merged into fir-dev.

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