platform/upstream/llvm.git
2 years ago[LoongArch] Add earlyclobber of destination register to atomic instructions
gonglingqin [Wed, 12 Oct 2022 12:43:22 +0000 (20:43 +0800)]
[LoongArch] Add earlyclobber of destination register to atomic instructions

If the AM* atomic memory access instruction has the same register number as
rd and rj, the execution will trigger an Instruction Non-defined Exception.
If the AM* atomic memory access instruction has the same register number as
rd and rk, the execution result is uncertain.

Reference: https://github.com/loongson/LoongArch-Documentation

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

2 years agoFix false positive related to handling of [[noreturn]] function pointers
Arseniy Zaostrovnykh [Wed, 12 Oct 2022 12:46:32 +0000 (14:46 +0200)]
Fix false positive related to handling of [[noreturn]] function pointers

Before this change, the `NoReturnFunctionChecker` was missing function pointers
with a `[[noreturn]]` attribute, while `CFG` was constructed taking that into
account, which leads CSA to take impossible paths. The reason was that the
`NoReturnFunctionChecker` was looking for the attribute in the type of the
entire call expression rather than the type of the function being called.

This change makes the `[[noreturn]]` attribute of a function pointer visible
to `NoReturnFunctionChecker`. This leads to a more coherent behavior of the
CSA on the AST involving.

Reviewed By: xazax.hun

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

2 years ago[flang][NFC] Fix FIRTypes.td
Peixin Qiao [Wed, 12 Oct 2022 12:25:34 +0000 (20:25 +0800)]
[flang][NFC] Fix FIRTypes.td

Fix two typos and remove the incorrectly added `extraClassDeclaration` in
`FIRTypes.td`.

Reviewed By: clementval

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

2 years ago[PowerPC][NFC] refactor some test cases.
Chen Zheng [Wed, 12 Oct 2022 12:15:15 +0000 (12:15 +0000)]
[PowerPC][NFC] refactor some test cases.

2 years ago[lldb] Fix member access in GetExpressionPath
Tonko Sabolčec [Wed, 12 Oct 2022 11:46:23 +0000 (11:46 +0000)]
[lldb] Fix member access in GetExpressionPath

This change fixes two issues in ValueObject::GetExpressionPath method:

 1. Accessing members of struct references used to produce expression
    paths such as "str.&str.member" (instead of the expected
    "str.member"). This is fixed by assigning the flag tha the child
    value is a dereference when calling Dereference() on references
    and adjusting logic in expression path creation.

 2. If the parent of member access is dereference, the produced
    expression path was "*(ptr).member". This is incorrect, since it
    dereferences the member instead of the pointer. This is fixed by
    wrapping dereference expression into parenthesis, resulting with
    "(*ptr).member".

Reviewed By: werat, clayborg

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

2 years ago[mlir][Bazel] Port 8446f24ef03928f511ab59dae17a8aa581b0ab62
Adrian Kuegel [Wed, 12 Oct 2022 12:07:31 +0000 (14:07 +0200)]
[mlir][Bazel] Port 8446f24ef03928f511ab59dae17a8aa581b0ab62

2 years ago[mlir][Linalg] Add MapOp to Linalg structured ops.
Adrian Kuegel [Wed, 12 Oct 2022 08:18:38 +0000 (10:18 +0200)]
[mlir][Linalg] Add MapOp to Linalg structured ops.

This will allow to model elementwise ops with this special op instead of using
GenericOp.
Also allow MapOp and ReduceOp to have no result if the output type is not a tensor.
This is needed for buffer semantics.

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

2 years ago[VPlan] Remove dead recipes before sinking.
Florian Hahn [Wed, 12 Oct 2022 11:47:18 +0000 (12:47 +0100)]
[VPlan] Remove dead recipes before sinking.

optimizeInductions may leave dead recipes which can prevent sinking.
Sinking on the other hand should not introduce new dead recipes, so
clean up dead recipes before sinking.

Reviewed By: Ayal

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

2 years ago[mlir][Linalg] NFC - Drop filter from LinalgGeneralizationPattern
Nicolas Vasilache [Wed, 12 Oct 2022 11:14:33 +0000 (04:14 -0700)]
[mlir][Linalg] NFC - Drop filter from LinalgGeneralizationPattern

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

2 years ago[mlir][Linalg] NFC - Drop CodegenStrategy and remaining strategy passes
Nicolas Vasilache [Wed, 12 Oct 2022 10:26:55 +0000 (03:26 -0700)]
[mlir][Linalg] NFC - Drop CodegenStrategy and remaining strategy passes

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

2 years ago[mlir][llvm] Tablegen based operation import from LLVM IR.
Tobias Gysi [Wed, 12 Oct 2022 11:23:10 +0000 (14:23 +0300)]
[mlir][llvm] Tablegen based operation import from LLVM IR.

The revision uses tablegen generated builders to convert the most common
LLVM IR instructions to MLIR LLVM dialect operations. All instructions
with special handlers, except for alloca and fence, still use manual
handlers. The revision also introduces an additional "instructions.ll"
test file to test the import of instructions that have tablegen builders
(except for the resume instruction whose test remains untouched). A part
of the test cases are new, for example the integer instruction test,
while others are migrated from the "basic.ll" test file.

Reviewed By: ftynse

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

2 years ago[NFC] Perform all legality checks for non-trivial unswitch in one function
Max Kazantsev [Wed, 12 Oct 2022 11:14:06 +0000 (18:14 +0700)]
[NFC] Perform all legality checks for non-trivial unswitch in one function

They have been scattered over the code. For better structuring, perform
them in one place. Potential CT drop is possible because we collect exit
blocks twice, but it's small price to pay for much better code structure.

2 years agoDon't widen shuffle element with AVX512
Luo, Yuanke [Wed, 12 Oct 2022 10:42:32 +0000 (18:42 +0800)]
Don't widen shuffle element with AVX512

Fix crash issue of D129537 and reopen it.

Currently the X86 shuffle lowering would widen the element type for
shuffle if the mask element value is adjacent. For below example

  %t2 = add nsw <16 x i32> %t0, %t1
  %t3 = sub nsw <16 x i32> %t0, %t1
  %t4 = shufflevector <16 x i32> %t2, <16 x i32> %t3,
                      <16 x i32> <i32 16, i32 17, i32 2, i32 3, i32 4,
                       i32 5, i32 6, i32 7, i32 8, i32 9, i32 10,
                       i32 11, i32 12, i32 13, i32 14, i32 15>

  ret <16 x i32> %t4

Compiler would transform the shuffle to
  %t4 = shufflevector <8 x i64> %t2, <8 x i64> %t3,
                      <8 x i64> <i32 8, i32 1, i32 2, i32 3, i32 4,
                                 i32 5, i32 6, i32 7>
This may lose the oppotunity to let ISel select mask instruction when
avx512 is enabled.

This patch is to prevent the tranform when avx512 feature is enabled.
Thank Simon for the idea.

Reviewed By: RKSimon

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

2 years ago[Dexter] Ignore step information in __libc_start_call_main
OCHyams [Wed, 12 Oct 2022 11:11:50 +0000 (12:11 +0100)]
[Dexter] Ignore step information in __libc_start_call_main

The test dexter/feature_tests/commands/perfect/expect_step_kind/direction.cpp
was failing on a machine because __libc_start_call_main was not identified as a
"frame below main" (a frame we don't want to gather information from), causing
dexter to count one more step than expected in the test.

Add __libc_start_call_main to the list of "frames below main". There may
be a more robust way of doing this but this is a pragmatic solution we can
use for now.

2 years ago[VPlan] Add test for sinking pointer induction increments.
Florian Hahn [Wed, 12 Oct 2022 11:06:40 +0000 (12:06 +0100)]
[VPlan] Add test for sinking pointer induction increments.

Extra test for D133762.

2 years ago[mlir][doc] move transform dialect docs to .md, NFC
Alex Zinenko [Wed, 12 Oct 2022 11:02:01 +0000 (11:02 +0000)]
[mlir][doc] move transform dialect docs to .md, NFC

The description of the Transform dialect has become quite lengthy to be
kept as a Tablegen string literal. Move it to a proper Markdown file.

2 years ago[mlir] document transform dialect types
Alex Zinenko [Wed, 12 Oct 2022 10:55:54 +0000 (10:55 +0000)]
[mlir] document transform dialect types

2 years ago[test][DebugInfo] Convert some test cases to opaque pointers. NFC
Bjorn Pettersson [Wed, 12 Oct 2022 10:00:25 +0000 (12:00 +0200)]
[test][DebugInfo] Convert some test cases to opaque pointers. NFC

Conversion performed using the script at:
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34

2 years ago[mlir] Apply ClangTidyLegacy findings.
Adrian Kuegel [Wed, 12 Oct 2022 10:45:35 +0000 (12:45 +0200)]
[mlir] Apply ClangTidyLegacy findings.

Use '= default' to define a trivial default constructor.

2 years ago[llvm-objdump] Support nonzero section addresses in addSymbolizer
Pierre van Houtryve [Fri, 7 Oct 2022 08:12:36 +0000 (08:12 +0000)]
[llvm-objdump] Support nonzero section addresses in addSymbolizer

The previous calculations seem to have assumed that the section address would be zero.
This is true for relocatable object files, but certainly not for linked files like shared libraries.

Fixed the calculations to make them identical to the "real" `getInstruction` call below & added a regression test.

Reviewed By: scott.linder, simon_tatham

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

2 years agoRevert "[AArch64] Add support for 128-bit non temporal loads."
David Green [Wed, 12 Oct 2022 10:11:32 +0000 (11:11 +0100)]
Revert "[AArch64] Add support for 128-bit non temporal loads."

This reverts commit 661403b85c219a83baa37335a870d4d93dc4b1c3 as the
custom lowering of loads prevents expanding unaligned loads with
strict-align.

2 years ago[AArch64] Exclude instructions after setting the FP from SEH prologues
Martin Storsjö [Tue, 11 Oct 2022 12:11:39 +0000 (15:11 +0300)]
[AArch64] Exclude instructions after setting the FP from SEH prologues

After setting up the FP, the rest of the prologue doesn't need to
be replayed for unwinding the stack frame.

This allows reverting the functional parts of
2f7fbf837625267193351cc334e506a3a9161958 (but fixing inconsistent
duplicate setting of HasWinCFI).

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

2 years ago[LLDB] Fix x86_64 build
David Spickett [Wed, 12 Oct 2022 09:19:29 +0000 (09:19 +0000)]
[LLDB] Fix x86_64 build

28e65a6a63ab39be97d1a88fe7b4d0fa2f532643 changed the parameter
type of SetType but I forgot to build on x86 as well as arm64.

2 years ago[AArch64][SVE] Add instcombine for PTEST_ANY(X=OP(PG,...), X) -> PTEST_ANY(PG, X))
Cullen Rhodes [Wed, 12 Oct 2022 08:36:03 +0000 (08:36 +0000)]
[AArch64][SVE] Add instcombine for PTEST_ANY(X=OP(PG,...), X) -> PTEST_ANY(PG, X))

Given this is an OR reduction the two are equivalent and later
optimizations (AArch64InstrInfo::optimizePTestInstr) may rewrite the
sequence to use the flag-setting variant of instruction X, to remove the
PTEST altogether.

Reviewed By: paulwalker-arm, bsmith

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

2 years ago[AArch64][SVE] NFC: auto-generate llvm/test/Transforms/InstCombine/AArch64/sve-intrin...
Cullen Rhodes [Fri, 7 Oct 2022 14:29:17 +0000 (14:29 +0000)]
[AArch64][SVE] NFC: auto-generate llvm/test/Transforms/InstCombine/AArch64/sve-intrinsics-ptest.ll

2 years ago[CMake] Add option LLVM_FORCE_CREATE_SYMLINKS
Tobias Hieta [Wed, 12 Oct 2022 08:04:21 +0000 (10:04 +0200)]
[CMake] Add option LLVM_FORCE_CREATE_SYMLINKS

On Windows we don't create symlinks for the binaries (clang++, clang-cl)
since the support requires special setup (group policy settings and
you need to know exactly our distribution story). But if you know
about these things and have a controlled environment there is a lot
of storage to be saved, so let's add a manual opt-in for using symlinks
on Windows with LLVM_FORCE_CREATE_SYMLINKS=ON.

Reviewed By: phosek

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

2 years ago[clang-tidy] Dump effective diagnostics level in YAML output
Dmitry Polukhin [Thu, 6 Oct 2022 14:56:19 +0000 (07:56 -0700)]
[clang-tidy] Dump effective diagnostics level in YAML output

Before this patch YAML output had default diagnostic level instead of effective level reported to the user on stdout. Wrapper scripts for clang-tidy usually use YAML output and they pick wrong diagnostics level without this patch.

Test Plan: check-clang-tools

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

2 years ago[Attributes] Make intrinsic attribute generation more flexible (NFC)
Nikita Popov [Tue, 11 Oct 2022 11:56:06 +0000 (13:56 +0200)]
[Attributes] Make intrinsic attribute generation more flexible (NFC)

Currently attributes for intrinsics are emitted using the
ArrayRef<AttrKind> based constructor for AttributeLists. This works
out fine for simple enum attributes, but doesn't really generalize
to attributes that accept values. We're already doing something
awkward for alignment attributes, and I'd like to have a cleaner
solution to this with
https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579 in mind.

The new generation approach is to instead directly construct
Attributes, giving us access to the full generality of that
interface. To avoid significantly increasing the size of the
generated code, we now also deduplicate the attribute sets. The
code generated per unique AttributeList looks like this:

  case 204: {
    AS[0] = {1, getIntrinsicArgAttributeSet(C, 5)};
    AS[1] = {AttributeList::FunctionIndex, getIntrinsicFnAttributeSet(C, 10)};
    NumAttrs = 2;
    break;
  }

and then the helper functions contain something like

  case 5:
    return AttributeSet::get(C, {
      Attribute::get(C, Attribute::NoCapture),
    });

and

  case 10:
    return AttributeSet::get(C, {
      Attribute::get(C, Attribute::NoUnwind),
      Attribute::get(C, Attribute::ArgMemOnly),
    });

A casualty of this change is the intrin-properties.td test, as I
don't think that FileCheck allows matching this kind of output.

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

2 years ago[LLDB] Change EmulateInstriction::ReadRegister to return Optional
David Spickett [Wed, 28 Sep 2022 15:32:33 +0000 (15:32 +0000)]
[LLDB] Change EmulateInstriction::ReadRegister to return Optional

Making it easier to understand and harder to misuse.
This only applies to the ReadRegister(const RegisterInfo &reg_info) variant.

Depends on D135671

Reviewed By: clayborg

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

2 years ago[AArch64][SVE] Fix BRKNS bug in optimizePTestInstr
Cullen Rhodes [Wed, 12 Oct 2022 08:17:45 +0000 (08:17 +0000)]
[AArch64][SVE] Fix BRKNS bug in optimizePTestInstr

The BRKNS instruction is unlike the other instructions that set flags
since it has an all active implicit predicate, so the existing

  PTEST(PG, BRKN(PG, A, B)) -> BRKNS(PG, A, B)

in AArch64InstrInfo::optimizePTestInstr is incorrect, however

  PTEST(PTRUE_B(31), BRKN(PG, A, B)) -> BRKNS(PG, A, B)

is correct.

Spotted by @paulwalker-arm in D134946.

Reviewed By: paulwalker-arm

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

2 years ago[AArch64] NFC: Auto-generate llvm/test/CodeGen/AArch64/sve-ptest-removal-brk.ll
Cullen Rhodes [Wed, 28 Sep 2022 09:25:21 +0000 (09:25 +0000)]
[AArch64] NFC: Auto-generate llvm/test/CodeGen/AArch64/sve-ptest-removal-brk.ll

2 years ago[LLDB] Change RegisterValue::SetType param to const RegisterInfo&
David Spickett [Wed, 28 Sep 2022 14:52:12 +0000 (14:52 +0000)]
[LLDB] Change RegisterValue::SetType param to const RegisterInfo&

No one was pasing nullptr here.

Depends on D135670

Reviewed By: clayborg

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

2 years ago[LLDB] Pass const RegisterInfo& to RegisterValue::SetValueFromData
David Spickett [Wed, 28 Sep 2022 14:44:17 +0000 (14:44 +0000)]
[LLDB] Pass const RegisterInfo& to RegisterValue::SetValueFromData

Familiar story, callers are either checking upfront that the pointer
wasn't null or not checking at all. SetValueFromData itself didn't
check either.

So make the parameter a ref and fixup the few places where a nullptr
check seems needed.

Depends on D135668

Reviewed By: clayborg

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

2 years ago[mlir] add transform dialect entry point
Alex Zinenko [Tue, 11 Oct 2022 15:23:48 +0000 (15:23 +0000)]
[mlir] add transform dialect entry point

Introduce `transform::applyTransforms` as a top-level entry point to the
Transform dialect-driven transformation infrastructure, by analogy with
`applyFull/PartialConversion`. Clients are expected to use this function
and no longer need to maintain the transformation state. Make the
constructor of the TransformState private for that purpose.

Reviewed By: springerm

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

2 years ago[LLDB] Change RegisterValue::SetFromMemoryData to const RegisterInfo&
David Spickett [Wed, 28 Sep 2022 14:24:57 +0000 (14:24 +0000)]
[LLDB] Change RegisterValue::SetFromMemoryData to const RegisterInfo&

All callers were either assuming their pointer was not null before calling
this, or checking beforehand.

Reviewed By: clayborg

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

2 years ago[LLD] [MinGW] Look for libs named "<libname>.lib" even with -static
Martin Storsjö [Tue, 11 Oct 2022 08:11:31 +0000 (11:11 +0300)]
[LLD] [MinGW] Look for libs named "<libname>.lib" even with -static

This matches how ld.bfd works in practice; this fixes
https://github.com/mstorsjo/llvm-mingw/issues/305.

Adding a test for the new lib name combination that this allows, but
also adding a few negative tests for combinations that aren't
matched when -static is specified (because this change in itself
didn't break any of the existing tests either).

The logic in how ld.bfd looks for various libraries based on
an -l<libname> argument is rather complex; the
ldemul_open_dynamic_archive function looks for various combinations:
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/emultempl/pep.em;h=e68d1e69f17ad73af065b6bed19ae89ded913172;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l2066
This function is only called if looking for dynamic libraries
(i.e. if -static wasn't specified):
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/ldfile.c;h=731ae5f7aedcf921bd36a1b32a3e0f5bfa189071;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l365

However even this function is skipped, it still looks for libraries
in the form of "lib<libname>.a" (this is what lld did before):
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/ldfile.c;h=731ae5f7aedcf921bd36a1b32a3e0f5bfa189071;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l440
But it also calls a format specific function called
ldemul_find_potential_libraries, which for PE targets looks for
files named "<libname>.lib":
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/emultempl/pep.em;h=e68d1e69f17ad73af065b6bed19ae89ded913172;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l2175

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

2 years ago[MC] [Win64EH] Generate ARM64 packed unwind info with signed return addresses
Martin Storsjö [Tue, 11 Oct 2022 11:29:36 +0000 (14:29 +0300)]
[MC] [Win64EH] Generate ARM64 packed unwind info with signed return addresses

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

2 years ago[AArch64] Add support for the SEH opcode for return address signing
Martin Storsjö [Wed, 5 Oct 2022 10:42:46 +0000 (13:42 +0300)]
[AArch64] Add support for the SEH opcode for return address signing

This was documented upstream in
https://github.com/MicrosoftDocs/cpp-docs/pull/4202.

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

2 years ago[runtimes] Use a response file for runtimes test suites
Petr Hosek [Thu, 18 Aug 2022 08:25:13 +0000 (08:25 +0000)]
[runtimes] Use a response file for runtimes test suites

We don't know which test suites are going to be included by runtimes
builds so we cannot include those before running the sub-build, but
that's not possible during the LLVM build configuration. We instead use
a response file that's populated by the runtimes build as a level of
indirection.

This addresses the issue described in:
https://discourse.llvm.org/t/cmake-regeneration-is-broken/62788

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

2 years ago[mlir][Math] Change regex to match fp value on different target.
jacquesguan [Thu, 29 Sep 2022 03:19:25 +0000 (11:19 +0800)]
[mlir][Math] Change regex to match fp value on different target.

Link: https://github.com/llvm/llvm-project/issues/58048
Reviewed By: ftynse, Mogball

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

2 years agoRevert "Fix locating of COMPILER_RT_LIBCXX_PATH"
Vitaly Buka [Wed, 12 Oct 2022 06:24:13 +0000 (23:24 -0700)]
Revert "Fix locating of COMPILER_RT_LIBCXX_PATH"

clang-aarch64-sve-vla crashes in msan
clang-s390x-linux-lnt fails to compile libcxx

This reverts commit 14b2b67cd7d5e439c4bc5c8051f68a5fbb683480.

2 years ago[SimpleLoopUnswitch][NFC] Separate legality checks from cost computation
Max Kazantsev [Wed, 12 Oct 2022 06:17:28 +0000 (13:17 +0700)]
[SimpleLoopUnswitch][NFC] Separate legality checks from cost computation

These are semantically two different stages, but were entwined in the
old implementation. Now cost computation does not do legality checks,
and they all are done beforehead.

2 years ago[NFC] Factor out computation of best unswitch cost candidate
Max Kazantsev [Wed, 12 Oct 2022 05:21:29 +0000 (12:21 +0700)]
[NFC] Factor out computation of best unswitch cost candidate

Split out a major peice of this method to make code more readable.

2 years ago[llvm] [cmake] Support finding both static and shared zstd via FindZstd
Michał Górny [Fri, 7 Oct 2022 16:42:27 +0000 (18:42 +0200)]
[llvm] [cmake] Support finding both static and shared zstd via FindZstd

Improve the logic in FindZstd to support finding both shared and static
variants of the zstd library simultaneously.  Otherwise, if the shared
library is installed, zstd::libzstd_static is not declared at all
and CMake fails if LLVM_USE_STATIC_ZSTD is used.

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

2 years ago[clang] Do not override libclang.so's SOVERSION if CLANG_FORCE_MATCHING_LIBCLANG_SOVE...
Michał Górny [Tue, 11 Oct 2022 18:01:11 +0000 (20:01 +0200)]
[clang] Do not override libclang.so's SOVERSION if CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION

Instead of setting libclang.so's SOVERSION to CLANG_MAJOR_VERSION
when CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION is enabled, do not override
it and let LLVM set the correct SOVERSION.  This fixes libclang.so
missing LLVM_VERSION_SUFFIX, and harmonizes the SOVERSION with other
shared libraries.

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

2 years ago[mlir][async] Fix missing dialect dependency in async-to-async-runtime
rkayaith [Tue, 11 Oct 2022 20:46:26 +0000 (16:46 -0400)]
[mlir][async] Fix missing dialect dependency in async-to-async-runtime

The specific case I hit this was when lowering an `async.execute` that's
not inside a `func.func` op, e.g.:
```
llvm.func @foo() {
  %token = async.execute {
    async.yield
  }
  llvm.return
}
```

Reviewed By: bondhugula

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

2 years agoApply clang-tidy fixes for performance-unnecessary-value-param in TileUsingInterface...
Mehdi Amini [Thu, 6 Oct 2022 19:19:41 +0000 (19:19 +0000)]
Apply clang-tidy fixes for performance-unnecessary-value-param in TileUsingInterface.cpp (NFC)

2 years agoApply clang-tidy fixes for performance-for-range-copy in TileUsingInterface.cpp ...
Mehdi Amini [Thu, 6 Oct 2022 19:19:08 +0000 (19:19 +0000)]
Apply clang-tidy fixes for performance-for-range-copy in TileUsingInterface.cpp (NFC)

2 years agoFix typo in tablegen option: '-gen-typedef-docs' -> '-gen-typedef-doc'
Mehdi Amini [Wed, 12 Oct 2022 05:03:05 +0000 (05:03 +0000)]
Fix typo in tablegen option: '-gen-typedef-docs' -> '-gen-typedef-doc'

2 years agoFix locating of COMPILER_RT_LIBCXX_PATH
Vitaly Buka [Thu, 29 Sep 2022 01:53:39 +0000 (18:53 -0700)]
Fix locating of COMPILER_RT_LIBCXX_PATH

COMPILER_RT_LIBCXX_PATH is required for msan unittests.

2 years agoFix assert in generated `direct` property getter/setters due to removal of `_cmd...
Michael Wyman [Tue, 11 Oct 2022 21:32:21 +0000 (14:32 -0700)]
Fix assert in generated `direct` property getter/setters due to removal of `_cmd` parameter.

This fixes a bug from https://reviews.llvm.org/D131424 that removed the implicit `_cmd` parameter as an argument to `objc_direct` method implementations. In many cases the generated getter/setter will call `objc_getProperty` or `objc_setProperty`, both of which require the selector of the getter/setter; since `_cmd` didn't automatically have backing storage, attempting to load the address asserted.

For direct property generated getters/setters, this now passes an undefined/uninitialized/poison value as the `_cmd` argument to `objc_getProperty`/`objc_setProperty`. Prior to removing the `_cmd` argument from the ABI of direct methods, it was left uninitialized/undefined; although references within hand-implemented methods would load the selector in the method prologue, generated getters/setters never did and just forwarded the undefined value that was passed as the argument.

This change keeps the generated code mostly similar to before, passing an uninitialized/undefined/poison value; for setters, the value argument may be moved to another register.

Added a test that triggers the assert prior to the implementation code.

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

2 years ago[lld-macho] Canonicalize personality pointers in EH frames
Jez Ng [Wed, 12 Oct 2022 03:50:46 +0000 (23:50 -0400)]
[lld-macho] Canonicalize personality pointers in EH frames

We already do this for personality pointers referenced from compact
unwind entries; this patch extends that behavior to personalities
referenced via EH frames as well.

This reduces the number of distinct personalities we need in the final
binary, and helps us avoid hitting the "too many personalities" error.

I renamed `UnwindInfoSection::prepareRelocations()` to simply `prepare`
since we now do some non-reloc-specific stuff within.

Fixes #58277.

Reviewed By: #lld-macho, oontvoo

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

2 years ago[AArch64][Windows] Check sret attribute also for inreg attribute
chenglin.bi [Wed, 12 Oct 2022 01:57:35 +0000 (09:57 +0800)]
[AArch64][Windows] Check sret attribute also for inreg attribute

Fix the issue: #57684

Reviewed By: efriedma

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

2 years ago[RISCV] Add isel patterns for vmacc, vnmsac.
Yeting Kuo [Wed, 5 Oct 2022 15:34:37 +0000 (23:34 +0800)]
[RISCV] Add isel patterns for vmacc, vnmsac.

The patch selects VSELECT/VP_MERGE_VL which uses fmadd/fnmsub as true operand
and the adden of the fmadd/fnmsub as false operand.

Reviewed By: craig.topper

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

2 years agoApply clang-tidy fixes for readability-simplify-boolean-expr in BufferizableOpInterfa...
Mehdi Amini [Thu, 6 Oct 2022 19:16:56 +0000 (19:16 +0000)]
Apply clang-tidy fixes for readability-simplify-boolean-expr in BufferizableOpInterfaceImpl.cpp (NFC)

2 years agoApply clang-tidy fixes for llvm-else-after-return in MultiBuffer.cpp (NFC)
Mehdi Amini [Thu, 6 Oct 2022 19:13:00 +0000 (19:13 +0000)]
Apply clang-tidy fixes for llvm-else-after-return in MultiBuffer.cpp (NFC)

2 years ago[RISCV] Use mask/tail agnostic if tied source is IMPLICIT_DEF regardless of the polic...
Craig Topper [Tue, 11 Oct 2022 23:36:21 +0000 (16:36 -0700)]
[RISCV] Use mask/tail agnostic if tied source is IMPLICIT_DEF regardless of the policy operand.

If the source is implicit_def, the register allocator won't have
any constraint on what register it picks for the destination. This
doesn't give the user much control of what register is being used.

So in my mind that means the only reason to honor the policy operand
is to control what policy is used in vsetvli to maybe avoid a vtype
change. Given the other optimizations we do on the policy field, I
don't think allowing the user this control is reliable.

Therefore, I think we should use agnostic policies if the source is
undef.

This should give better performance on some CPUs for VP intrinsics where
there is no merge operand and the backend adds IMPLICIT_DEF to the instruction.

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

2 years agoRevert "[DAGCombiner] Fold (mul (sra X, BW-1), Y) -> (neg (and (sra X, BW-1), Y))"
Craig Topper [Tue, 11 Oct 2022 23:30:40 +0000 (16:30 -0700)]
Revert "[DAGCombiner] Fold (mul (sra X, BW-1), Y) -> (neg (and (sra X, BW-1), Y))"

This reverts commit 0148df8157f05ecf3b1064508e6f012aefb87dad.

Getting a lit test failures on AMDGPU but I can't reproduce it so far.
Reverting to investigate.

2 years ago[RISCV] Remove unused SchedClass WriteVFCvtFToFV. NFC
Craig Topper [Tue, 11 Oct 2022 23:25:28 +0000 (16:25 -0700)]
[RISCV] Remove unused SchedClass WriteVFCvtFToFV. NFC

This isn't bound to any instruction. From the section comment it
was for single-width F-to-F conversions, but those don't exist.

2 years ago[llvm-ocaml] Replace all typed pointer functions with opaque pointer functions
Alan Hu [Tue, 11 Oct 2022 23:25:29 +0000 (16:25 -0700)]
[llvm-ocaml] Replace all typed pointer functions with opaque pointer functions

Reviewed By: aeubanks

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

2 years ago[mlir][sparse] Add MLIR interface for sparse tensor file input and output.
bixia1 [Tue, 11 Oct 2022 22:28:20 +0000 (15:28 -0700)]
[mlir][sparse] Add MLIR interface for sparse tensor file input and output.

Reviewed By: aartbik, wrengr

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

2 years ago[DAGCombiner] Fold (mul (sra X, BW-1), Y) -> (neg (and (sra X, BW-1), Y))
Craig Topper [Tue, 11 Oct 2022 23:05:04 +0000 (16:05 -0700)]
[DAGCombiner] Fold (mul (sra X, BW-1), Y) -> (neg (and (sra X, BW-1), Y))

(sra X, BW-1) is either 0 or -1. So the multiply is a conditional
negate of Y.

This pattern shows up when type legalizing wide multiplies involving
a sign extended value.

Fixes PR57549.

Reviewed By: RKSimon

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

2 years ago[lld-macho] Add --ignore-auto-link-option
Keith Smiley [Sun, 9 Oct 2022 04:28:02 +0000 (21:28 -0700)]
[lld-macho] Add --ignore-auto-link-option

This provides a workaround for a small difference in ld64 behavior where
ld64 ignores invalid LC_LINKER_OPTIONS unless the link fails. Instead of
fully adopting that behavior, this provides an escape hatch by allowing
users to specify `--ignore-auto-link-option` passing the invalid library
or framework name

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

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

2 years ago[clang][deps] Prevent emitting diagnostics outside of source file
Jan Svoboda [Tue, 11 Oct 2022 22:38:48 +0000 (15:38 -0700)]
[clang][deps] Prevent emitting diagnostics outside of source file

The dependency scanner needs to report the module map file describing the module whose implementation is being compiled (see D134222). However, calling `Preprocessor::getCurrentModuleImplementation()` in the scanner might cause a diagnostic during module map parsing and emitting a diagnostic without being "in" a source file is illegal (e.g. in `TextDiagnosticPrinter`). This patch ensures the module map parse is triggered while the compiler is still "in" a source file, avoiding the failure case.

Reviewed By: Bigcheese

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

2 years ago[clang][deps] Remove more codegen options
Jan Svoboda [Tue, 11 Oct 2022 22:38:41 +0000 (15:38 -0700)]
[clang][deps] Remove more codegen options

Codegen options are typically unused by modules. Reset some of them to increase sharing between TUs with different flags.

Reviewed By: Bigcheese

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

2 years ago[Clang] Do not build the OffloadActionBuilder when using the new driver
Joseph Huber [Tue, 11 Oct 2022 21:11:21 +0000 (16:11 -0500)]
[Clang] Do not build the OffloadActionBuilder when using the new driver

The Offloading toolchain currently has two methods for construction the
requires actions. The "new" driver and the old `OffloadActionBuilder`.
Using either one is mutually exclusive, so we should not initialize this
when using the new driver. This was causing some error messages to be
printed multiple times because we were checking them in both the old and
the new driver.

Reviewed By: tra

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

2 years agoPrevent lldb-vscode tests from source lldbinit file
Jeffrey Tan [Fri, 30 Sep 2022 19:11:58 +0000 (12:11 -0700)]
Prevent lldb-vscode tests from source lldbinit file

lldb-vscode is hard-coded to source .lldbinit file which causes some tests to
fail on my machine.
This patch adds a new option to control this:
1. vscode.py and lldb-vscode tests will not source .lldbinit by default
2. lldb-vscode will source .lldbinit in production if not specified otherwise

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

2 years ago[GlobalISel] Allow vectors in redundant or + add combines
Jessica Paquette [Tue, 11 Oct 2022 21:49:41 +0000 (14:49 -0700)]
[GlobalISel] Allow vectors in redundant or + add combines

We support KnownBits for vectors, so we can enable these.

https://godbolt.org/z/r9a9W4Gj1

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

2 years ago[llvm] Update WPD tests to use opaque pointers
Leonard Chan [Tue, 11 Oct 2022 21:10:07 +0000 (21:10 +0000)]
[llvm] Update WPD tests to use opaque pointers

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

2 years ago[LTO] Make local linkage GlobalValue in non-prevailing COMDAT available_externally
Fangrui Song [Tue, 11 Oct 2022 22:30:07 +0000 (15:30 -0700)]
[LTO] Make local linkage GlobalValue in non-prevailing COMDAT available_externally

For a local linkage GlobalObject in a non-prevailing COMDAT, it remains defined while its
leader has been made available_externally. This violates the COMDAT rule that
its members must be retained or discarded as a unit.

To fix this, update the regular LTO change D34803 to track local linkage
GlobalValues, and port the code to ThinLTO (GlobalAliases are not handled.)

This fixes two problems.

(a) `__cxx_global_var_init` in a non-prevailing COMDAT group used to
linger around (unreferenced, hence benign), and is now correctly discarded.
```
int foo();
inline int v = foo();
```

(b) Fix https://github.com/llvm/llvm-project/issues/58215:
as a size optimization, we place private `__profd_` in a COMDAT with a
`__profc_` key. When FuncImport.cpp makes `__profc_` available_externally due to
a non-prevailing COMDAT, `__profd_` incorrectly remains private. This change
makes the `__profd_` available_externally.

```
cat > c.h <<'eof'
extern void bar();
inline __attribute__((noinline)) void foo() {}
eof
cat > m1.cc <<'eof'
int main() {
  bar();
  foo();
}
eof
cat > m2.cc <<'eof'
__attribute__((noinline)) void bar() {
  foo();
}
eof

clang -O2 -fprofile-generate=./t m1.cc m2.cc -flto -fuse-ld=lld -o t_gen
rm -fr t && ./t_gen && llvm-profdata show -function=foo t/default_*.profraw

clang -O2 -fprofile-generate=./t m1.cc m2.cc -flto=thin -fuse-ld=lld -o t_gen
rm -fr t && ./t_gen && llvm-profdata show -function=foo t/default_*.profraw
```

Reviewed By: tejohnson

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

2 years ago[mlir][sparse] Add rewriting rules for the sparse_tensor.new operator.
bixia1 [Tue, 11 Oct 2022 20:47:45 +0000 (13:47 -0700)]
[mlir][sparse] Add rewriting rules for the sparse_tensor.new operator.

Reviewed By: aartbik

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

2 years ago[MC] .addrsig_sym: ignore unregistered symbols
Fangrui Song [Tue, 11 Oct 2022 22:07:14 +0000 (15:07 -0700)]
[MC] .addrsig_sym: ignore unregistered symbols

.addrsig_sym forces registering the symbol regardless whether it is otherwise
registered. This creates an undefined symbol which is inconvenient/undesired:

* `extern int x; void f() { (void)x; }` has inconsistent behavior whether `x` is emitted as an undefined symbol.
  `-O0 -faddrsig` makes `x` undefined while other -O levels and -fno-addrsig eliminate the symbol.
* In ThinLTO, after a non-prevailing linkonce_odr definition is converted to available_externally, and then a declaration,
  the addrsig code emits a symbol while the symbol is otherwise unseen.

D135427 fixed a bug that a non-prevailing `__cxx_global_var_init` was
incorrectly retained. However, the IR declaration causes an undesired
`.addrsig_sym __cxx_global_var_init`. This can be addressed in a way similar
to D101512 (`isTransitiveUsedByMetadataOnly`) but the increased
`OutStreamer->emitAddrsigSym(getSymbol(&GV));` complexity makes me nervous.
Just ignoring unregistered symbols circumvents the problem.

Reviewed By: rnk

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

2 years ago[mlir][sparse] Renaming mlir_sparse_tensor_utils library to SparseTensorRuntime
wren romano [Mon, 10 Oct 2022 20:41:58 +0000 (13:41 -0700)]
[mlir][sparse] Renaming mlir_sparse_tensor_utils library to SparseTensorRuntime

The "mlir_xxx_utils" naming scheme is reserved/intended for shared libraries, whereas this library must be static due to issues of linking DLLs on Windows.  So we rename the library to avoid any potential confusion.   In addition we also rename the ExecutionEngine/SparseTensorUtils.{h,cpp} files to match the new library name.

Reviewed By: aartbik, stella.stamenova

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

2 years ago[CallGraph] Port -print-callgraph-sccs to new pass manager
Arthur Eubanks [Fri, 7 Oct 2022 21:08:43 +0000 (14:08 -0700)]
[CallGraph] Port -print-callgraph-sccs to new pass manager

And remove the legacy opt-specific pass.

Reviewed By: asbirlea

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

2 years ago[mlir][sparse] Move a few routines to CodegenUtils.
bixia1 [Tue, 11 Oct 2022 20:22:14 +0000 (13:22 -0700)]
[mlir][sparse] Move a few routines to CodegenUtils.

Move a few supporting routines for generating function calls to CodegenUtils so
that they can be used by the codegen path for sparse tensor file input and
output.

Reviewed By: aartbik

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

2 years ago[flang] Use the ShapedType::kDynamicSize constant instead of hardcoding it.
Alexander Belyaev [Tue, 11 Oct 2022 14:26:42 +0000 (16:26 +0200)]
[flang] Use the ShapedType::kDynamicSize constant instead of hardcoding it.

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

2 years ago[SystemZ][NFC] Opaque pointer migration.
Kai Nacke [Tue, 11 Oct 2022 20:59:16 +0000 (20:59 +0000)]
[SystemZ][NFC] Opaque pointer migration.

The LIT test cases were migrated with the script provided by
Nikita Popov.

No manual changes were made. Committed without review since
no functional changes, after consultation with uweigand.

2 years ago[mlir][sparse] Converting SparseTensorCOO to use standard C++-style iterators.
wren romano [Fri, 7 Oct 2022 21:21:02 +0000 (14:21 -0700)]
[mlir][sparse] Converting SparseTensorCOO to use standard C++-style iterators.

This differential comprises three related changes: (1) it gives SparseTensorCOO standard C++-style iterators; (2) it removes the old iterator stuff from SparseTensorCOO; and (3) it introduces SparseTensorIterator which behaves like the old SparseTensorCOO iterator stuff used to.

The SparseTensorIterator class is needed because the MLIR codegen cannot easily use the C++-style iterators (hence why SparseTensorCOO had the old iterator stuff).  Distinguishing SparseTensorIterator from SparseTensorCOO also helps improve API hygiene since these two classes are used for distinct purposes.  And having SparseTensorIterator as its own class enables changing the underlying implementation in the future, without needing to worry about updating all the codegen tests etc.

Reviewed By: aartbik

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

2 years ago[clang][codegen] Don't emit atomic loads for threadsafe init if they aren't inline
Eli Friedman [Tue, 11 Oct 2022 21:00:33 +0000 (14:00 -0700)]
[clang][codegen] Don't emit atomic loads for threadsafe init if they aren't inline

Performing a load before calling __cxa_guard_acquire is supposed to be
an optimization, but it isn't much of one if we're just going to emit a
call to __atomic_load_1 instead.  Instead, just skip the load, and
let __cxa_guard_acquire do whatever it wants.

(In practice, on such targets, the C++ library is just built with
threading turned off, so the result isn't actually threadsafe, but
there's not really anything clang can do about that.)

The alternative here is that we try to define some ABI for threadsafe
init that allows the speculative load without full atomics.  Almost any
target without full atomics has a load that's s "atomic enough" for this
purpose. But it's not clear how we emit an "atomic enough" load in LLVM
IR, and there isn't any ABI document we can refer to.

Or I guess we could turn off -fthreadsafe-statics by default on
Cortex-M0, but that seems like it would be surprising.

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

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

2 years ago[clang/Sema] Follow-up for fix of non-deterministic order of `-Wunused-variable`...
Argyrios Kyrtzidis [Fri, 7 Oct 2022 20:51:00 +0000 (13:51 -0700)]
[clang/Sema] Follow-up for fix of non-deterministic order of `-Wunused-variable` diagnostic

Commit `371883f46dc23f8464cbf578e2d12a4f92e61917` caused a noticeable compile-time regression (about 0.4% geomean at -O0):
http://llvm-compile-time-tracker.com/compare.php?from=92233159035d1b50face95d886901cf99035bd99&to=371883f46dc23f8464cbf578e2d12a4f92e61917&stat=instructions

To address this switch `Scope::DeclSetTy` back to a `SmallPtrSet` and change `Sema::ActOnPopScope` to explicitly order the diagnostics that this function emits.

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

2 years ago[Sema] Fix `ExtVectorElementExpr` tree transform for the `isArrow` case.
Michele Scandale [Tue, 11 Oct 2022 20:28:59 +0000 (13:28 -0700)]
[Sema] Fix `ExtVectorElementExpr` tree transform for the `isArrow` case.

Make sure we propagate the value for `IsArrow` to
`RebuildExtVectorElementExpr` in order to be able to handle correctly
vector component accesses where the base value is a pointer.

Reviewed By: rjmccall

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

2 years ago[libc++][NFC] Change _VSTD to std as a prereq for D122780
Louis Dionne [Tue, 11 Oct 2022 19:58:35 +0000 (15:58 -0400)]
[libc++][NFC] Change _VSTD to std as a prereq for D122780

2 years ago[MC] [NFC] replace tabs with space in test
Florian Mayer [Tue, 11 Oct 2022 19:37:02 +0000 (12:37 -0700)]
[MC] [NFC] replace tabs with space in test

2 years ago[TokenLexer][NFC] Rename the InstLoc to ExpandLoc
Haojian Wu [Tue, 11 Oct 2022 12:58:22 +0000 (14:58 +0200)]
[TokenLexer][NFC] Rename the InstLoc to ExpandLoc

We don't use the "instantiate" word for the macro expansion in LLVM,
see c9c8419c383d0b53c40973f7587003ef45daf481.

2 years agoReenable gdb pretty printers, and update them.
Sterling Augustine [Mon, 10 Oct 2022 22:26:14 +0000 (15:26 -0700)]
Reenable gdb pretty printers, and update them.

Libcxx gdb pretty printers were disabled due to an old version
of gdb in the release testing. This reenables them, and fixes
various bit rot issues from not running them.

2 years ago[DX] Add analysis and printer for shader flags
Chris Bieneman [Tue, 11 Oct 2022 17:09:30 +0000 (12:09 -0500)]
[DX] Add analysis and printer for shader flags

This adds infrastructural pieces for an analysis to compute the DXIL
shader flags. In this state the analysis can compute two fairly
straightforward feature flags for use of double-precision floating
point values and the DX 11.1 extended double support.

This patch does conflict with D135190, conflicts will be resolved prior
to merging.

Reviewed By: python3kgae

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

# Conflicts:
# llvm/lib/Target/DirectX/CMakeLists.txt
# llvm/lib/Target/DirectX/DirectXTargetMachine.cpp

2 years ago[NFC] Test commit.
Michele Scandale [Tue, 11 Oct 2022 19:26:08 +0000 (12:26 -0700)]
[NFC] Test commit.

2 years ago[runtimes] Add the ability to customize the output name of libc++, libc++abi and...
Louis Dionne [Tue, 11 Oct 2022 14:05:56 +0000 (10:05 -0400)]
[runtimes] Add the ability to customize the output name of libc++, libc++abi and libunwind

We already had the ability to do that for libc++.dylib, so this only adds
consistency for all the runtime libraries. This should allow working around
difficulties on AIX as described in https://llvm.org/D134221.

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

2 years ago[libunwind] Install the headers by default
Louis Dionne [Tue, 11 Oct 2022 13:19:55 +0000 (09:19 -0400)]
[libunwind] Install the headers by default

Just like we install libc++ and libc++abi headers by default when we
install the library, it makes sense to install the libunwind headers
by default when we build libunwind. In the current state of things,
there is an increased risk that folks are using older (previously
installed) libunwind headers along with a recent libunwind dylib,
which is not ideal.

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

2 years ago[OpenMP] Fix `-foffload-lto` for offloading to Nvidia
Joseph Huber [Tue, 11 Oct 2022 18:39:06 +0000 (13:39 -0500)]
[OpenMP] Fix `-foffload-lto` for offloading to Nvidia

Summary:
A previous patch ensured that we can't use `-foffload-lto` with CUDA in
non-RDC mode. This did not correctly check for if we were actually
offloading to CUDA so it ended up preventing us from using LTO for
OpenMP.

2 years ago[OpenMP][Docs] Add documentation for linking OpenMP with CUDA/HIP
Joseph Huber [Tue, 11 Oct 2022 17:00:06 +0000 (12:00 -0500)]
[OpenMP][Docs] Add documentation for linking OpenMP with CUDA/HIP

Summary:
This patch adds an entry to the FAQ that shows how to link CUDA with
OpenMP.

2 years ago[Clang] Fix use of `hasArg` when `hasFlag` should be used instead
Joseph Huber [Tue, 11 Oct 2022 16:42:40 +0000 (11:42 -0500)]
[Clang] Fix use of `hasArg` when `hasFlag` should be used instead

Summary:
This option forwards a clang flag with a `-no` variant to the Clang
compiler. It should use the `hasFlag` so it works properly when the
option is overridden.

2 years ago[OpenMP][Docs] Document multi-architecture binary handling
Joseph Huber [Tue, 11 Oct 2022 16:30:03 +0000 (11:30 -0500)]
[OpenMP][Docs] Document multi-architecture binary handling

Summary:
This patch adds some documentation in the FAQ regarding
multi-architecture binary support using the `--offload-arch` flag.

2 years ago[docs] Fix warning in AMDGPUUsage.rst after 3d9f011a9c624b3128bc6b5e71ed456eb92e268c
Abinav Puthan Purayil [Tue, 11 Oct 2022 18:24:01 +0000 (23:54 +0530)]
[docs] Fix warning in AMDGPUUsage.rst after 3d9f011a9c624b3128bc6b5e71ed456eb92e268c

2 years ago[mlir][arith] Improve EmulateWideInt diagnostics
Jakub Kuderski [Tue, 11 Oct 2022 18:24:38 +0000 (14:24 -0400)]
[mlir][arith] Improve EmulateWideInt diagnostics

Print unsupported types on match failures.

Suggested by @Mogball and @jpienaar in D135204.

Reviewed By: Mogball

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

2 years ago[LLDB] Fix crash when printing a struct with a static wchar_t member
Arthur Eubanks [Fri, 7 Oct 2022 17:08:25 +0000 (10:08 -0700)]
[LLDB] Fix crash when printing a struct with a static wchar_t member

Similar to D135170.

Reviewed By: DavidSpickett

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

2 years ago[AMDGPU] Make the uses_dynamic_stack field in the kernel descriptor and the metadata...
Abinav Puthan Purayil [Tue, 27 Sep 2022 05:36:35 +0000 (11:06 +0530)]
[AMDGPU] Make the uses_dynamic_stack field in the kernel descriptor and the metadata map specific to code object v5 and later

Unfortunately, we have a broken handling of this in the runtime of rocm
5.3. The runtime is expected to handle this correctly when v5 becomes
the default.

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

2 years ago[clang-format] update --files help description
Yuanfang Chen [Tue, 11 Oct 2022 17:18:11 +0000 (10:18 -0700)]
[clang-format] update --files help description

correlates the option with reponse file concept.

Reviewed By: HazardyKnusperkeks

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

2 years ago[PPC] Opaque pointer migration, part 2.
Kai Nacke [Fri, 7 Oct 2022 18:34:40 +0000 (18:34 +0000)]
[PPC] Opaque pointer migration, part 2.

The LIT test cases were migrated with the script provided by
Nikita Popov. Due to the size of the change it is split into
several parts.

Reviewed By: nemanja, nikic

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

2 years ago[PPC] Opaque pointer migration, part 1.
Kai Nacke [Fri, 7 Oct 2022 17:50:35 +0000 (17:50 +0000)]
[PPC] Opaque pointer migration, part 1.

The LIT test cases were migrated with the script provided by
Nikita Popov. Due to the size of the change it is split into
several parts.

Reviewed By: nemanja, amyk, nikic, PowerPC

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