platform/upstream/llvm.git
2 years ago[AST] Consider QualifiedTemplateName in TemplateName::getAsUsingDecl().
Haojian Wu [Tue, 26 Apr 2022 07:34:46 +0000 (09:34 +0200)]
[AST] Consider QualifiedTemplateName in TemplateName::getAsUsingDecl().

If the underlying template name of a qualified template name is a using
decl, TemplateName::getAsUsingDecl() will return it.

This will make the UsingTemplateName consumer life easier.

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

2 years ago[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]
Chris Jackson [Wed, 27 Apr 2022 12:08:03 +0000 (13:08 +0100)]
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]

This relands commit 8f550368b169b0a3d4ebc3e65efec49ec1e0798a.

The test is amended with REQUIRES: x86-registered-target, in line with
the other debuginfo-scev-salvage tests.

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

2 years agoRevert [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics[2/2]
Chris Jackson [Wed, 27 Apr 2022 12:06:03 +0000 (13:06 +0100)]
Revert [Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics[2/2]

This reverts commit 8f550368b169b0a3d4ebc3e65efec49ec1e0798a.

2 years ago[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]
Chris Jackson [Wed, 27 Apr 2022 11:38:12 +0000 (12:38 +0100)]
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]

Second of two patches to extend SCEV-based salvaging to dbg.value
intrinsics that have multiple location ops pre-LSR. This second patch
adds the core implementation.

Reviewers: @StephenTozer, @djtodoro

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

2 years agoRevert "[Driver] Support for compressed debug info on Fuchsia"
Tom Weaver [Wed, 27 Apr 2022 11:29:04 +0000 (12:29 +0100)]
Revert "[Driver] Support for compressed debug info on Fuchsia"

This reverts commit 19190cc651ef153c308d23fb56f064223b144488.

Causes test failures on following build bot:

http://lab.llvm.org:8011/#/builders/216

2 years ago[AArch64] Use PerfectShuffle costs in AArch64TTIImpl::getShuffleCost
David Green [Wed, 27 Apr 2022 11:09:01 +0000 (12:09 +0100)]
[AArch64] Use PerfectShuffle costs in AArch64TTIImpl::getShuffleCost

Given a shuffle with 4 elements size 16 or 32, we can use the costs
directly from the PerfectShuffle tables to get a slightly more accurate
cost for the resulting shuffle.

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

2 years ago[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [1/2] [NFC]
Chris Jackson [Wed, 27 Apr 2022 10:27:10 +0000 (11:27 +0100)]
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [1/2] [NFC]

First of two patches that extends SCEV-based salvaging to enable
salvaging of dbg.value instrinsics that have multiple locations ops
before the Loop Strength Reduction pass.

The existing single-op SCEV-based salvaging can generate variadic
dbg.value intrinsics in order to salvage a dbg.value that has a single
location op. If a dbg.value has multiple location ops before LSR, and
LSR optimises away one or more of the location operands, then currently
no salvaging will be attempted.

Salvaging can now be added, but first this patch cleans up consistency
in both the code and comments, and applies some refactoring to make
application of the new salvaging implementation more straightforward.

- Use SCEVDbgValueBuilder for both types of recovery expressions:
  IV-offset based and iteration count based.
- Combine the functions that write the final DIExpression.
- Move some static functions into member functions.

Reviewers: @Orlando

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

2 years ago[mlir][bazel] Add suport for PDLL tests.
Stephan Herhut [Wed, 27 Apr 2022 10:11:03 +0000 (12:11 +0200)]
[mlir][bazel] Add suport for PDLL tests.

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

2 years ago[libc++] Implement P0980R1 (constexpr std::string)
Nikolas Klauser [Wed, 27 Apr 2022 08:11:44 +0000 (10:11 +0200)]
[libc++] Implement P0980R1 (constexpr std::string)

Reviewed By: #libc, ldionne

Spies: daltenty, sdasgup3, ldionne, arichardson, MTC, ChuanqiXu, mehdi_amini, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes, tatianashp, rdzhabarov, teijeong, cota, dcaballe, Chia-hungDuan, wrengr, wenzhicui, arphaman, Mordante, miscco, Quuxplusone, smeenai, libcxx-commits

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

2 years ago[GVN][NewGVN] Regenerate no_speculative_loads_with_asan.ll tests
Simon Pilgrim [Wed, 27 Apr 2022 09:45:39 +0000 (10:45 +0100)]
[GVN][NewGVN] Regenerate no_speculative_loads_with_asan.ll tests

As discussed on D124284 - ensure we actually checking the codegen not just a label + return

2 years ago[flang][driver] NFC: Make code more in line with LLVM style
Andrzej Warzynski [Fri, 22 Apr 2022 10:59:31 +0000 (10:59 +0000)]
[flang][driver] NFC: Make code more in line with LLVM style

This patch basically implements [1] in ExecuteCompilerInvocation.cpp. It
also:
  * replaces `CreateFrontendBaseAction` with `CreateFrontendAction`
    (only one method is needed ATM, this change removes the extra
    indirection)
  * removes `InvalidAction` from the `ActionKind` enum (I don't think it
    adds much and keeping it would mean adding a new void case in
    `CreateFrontendAction`)
  * sets the default frontend action in FrontendOptions.h to
    `ParseSyntaxOnly` (note that this is still overridden independently
    in `ParseFrontendArg` in CompilerInvocation.cpp)

No new functionality is added, hence no tests.

[1] https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations

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

2 years ago[MIPS][SelectionDAG] Enable TargetLowering::hasBitTest for masks that fit in ANDI.
Liqin.Weng [Wed, 27 Apr 2022 08:05:01 +0000 (08:05 +0000)]
[MIPS][SelectionDAG] Enable TargetLowering::hasBitTest for masks that fit in ANDI.

Reviewed By: sdardis

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

2 years ago[DebugInfo][InstrRef] Describe value sizes when spilt to stack
Jeremy Morse [Wed, 27 Apr 2022 08:40:31 +0000 (09:40 +0100)]
[DebugInfo][InstrRef] Describe value sizes when spilt to stack

InstrRefBasedLDV can track and describe variable values that are spilt to
the stack -- however it does not current describe the size of the value on
the stack. This can cause uninitialized bytes to be read from the stack if
a small register is spilt for a larger variable, or theoretically on
big-endian machines if a large value on the stack is used for a small
variable.

Fix this by using DW_OP_deref_size to specify the amount of data to load
from the stack, if there's any possibility for ambiguity. There are a few
scenarios where this can be omitted (such as when using DW_OP_piece and a
non-DW_OP_stack_value location), see deref-spills-with-size.mir for an
explicit table of inputs flavours and output expressions.

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

2 years ago[CostModel] Add basic fptoi_sat costs
David Green [Wed, 27 Apr 2022 08:30:00 +0000 (09:30 +0100)]
[CostModel] Add basic fptoi_sat costs

This adds some basic fptosi_sat and fptoui_sat target independent cost
modelling. The fptosi_sat is modelled as a fmin/fmax to saturate the
value, followed by a fp convert. The signed values then have an
additional fcmp+select for handling Nan correctly.

The AArch64/Arm costs may be more incorrect, as the instruction exist
natively. This can be fixed with target specific cost updates.

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

2 years agoRevert "[asan] Enable detect_stack_use_after_return=1 by default"
Vitaly Buka [Wed, 27 Apr 2022 07:20:11 +0000 (00:20 -0700)]
Revert "[asan] Enable detect_stack_use_after_return=1 by default"

Temporarily revert the option to fix
https://bugs.chromium.org/p/chromium/issues/detail?id=1319387

This reverts option default and documentation of the commit. Test
changes are not being reverted as they are improvement and break
reliance on option defaults.

Additional memory usage is a problem on mobile devices with low memory.
Even heavy thread desktop programs may need some FakeStack tunning.

This reverts commit 4b4437c084e2b8a2643e97e7aef125c438635a4d.

2 years ago[InstCombine] Combine opaque pointer GEPs with mismatching element types
Nikita Popov [Tue, 26 Apr 2022 12:27:09 +0000 (14:27 +0200)]
[InstCombine] Combine opaque pointer GEPs with mismatching element types

Currently, two GEPs will only be combined if the result element
type of one is the same as the source element type of the other.
However, this means we may miss folding opportunities where the
second GEP could be rewritten using a different element type. This
is especially relevant for opaque pointers, where constant GEPs
often use i8 element type.

Address this by converting GEP indices to offsets, adding them,
and then converting them back to indices. The first (inner) GEP
is allowed to have variable indices as well, in which case only
the constant suffix is converted into an offset.

This should address the regression reported in
https://reviews.llvm.org/D123300#3467615.

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

2 years ago[AsmParser] Automatically declare and lex attribute keywords (NFC)
Nikita Popov [Tue, 26 Apr 2022 16:50:44 +0000 (18:50 +0200)]
[AsmParser] Automatically declare and lex attribute keywords (NFC)

Rather than listing these by hand, include all enum attribute
keywords from Attributes.inc. This reduces the number of places
one has to update whenever an enum attribute is added.

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

2 years ago[RISCV][NFC] Update and add missing closed curly bracket comment in RISCVInstrInfoZb.td
Jim Lin [Wed, 27 Apr 2022 04:57:58 +0000 (12:57 +0800)]
[RISCV][NFC] Update and add missing closed curly bracket comment in RISCVInstrInfoZb.td

2 years ago[Driver] Support for compressed debug info on Fuchsia
Petr Hosek [Wed, 17 Nov 2021 19:06:03 +0000 (11:06 -0800)]
[Driver] Support for compressed debug info on Fuchsia

Pass the --compress-debug-sections=zlib argument to the linker when
the use of compressed debug info is requested.

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

2 years ago[clangd] Output inlay hints with `clangd --check`
Tobias Ribizel [Wed, 27 Apr 2022 06:36:08 +0000 (02:36 -0400)]
[clangd] Output inlay hints with `clangd --check`

With the addition of inlay hints to clangd, it would be useful to output them during verbose `clangd --check`.
This patch adds an output step for inlay hints and unifies the way `--check-lines` are passed around

Reviewed By: nridge

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

2 years ago[FuncSpec] Conditional jump or move depends on uninitialised value(s).
Alexandros Lamprineas [Wed, 27 Apr 2022 06:25:01 +0000 (07:25 +0100)]
[FuncSpec] Conditional jump or move depends on uninitialised value(s).

I found this bug when performing a two-stage build of clang with
Function Specialization enabled and tuned aggressively. The crash
appears only on release builds.

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

Before accessing the contents of the ArgInfo iterator inside
SCCPInstVisitor::markArgInFuncSpecialization, we should be
checking that the iterator is valid.

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

2 years agoRevert "[CMake][compiler-rt] Use COMPILE_OPTIONS and LINK_OPTIONS"
Petr Hosek [Wed, 27 Apr 2022 06:25:38 +0000 (23:25 -0700)]
Revert "[CMake][compiler-rt] Use COMPILE_OPTIONS and LINK_OPTIONS"

This reverts commit d47565ed62a383175ebb5cb5733f169d72715253.

2 years ago[CMake][compiler-rt] Use COMPILE_OPTIONS and LINK_OPTIONS
Petr Hosek [Wed, 30 Mar 2022 17:33:40 +0000 (10:33 -0700)]
[CMake][compiler-rt] Use COMPILE_OPTIONS and LINK_OPTIONS

This avoids the need for string-ification and lets CMake deduplicate
potentially duplicate flags.

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

2 years ago[docs] Fix typos in the 'CodeGenerator' doc
Youngsuk Kim [Wed, 27 Apr 2022 04:46:06 +0000 (21:46 -0700)]
[docs] Fix typos in the 'CodeGenerator' doc

NFC.

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

2 years ago[RISCV][RVV] Select unmasked TU RVV pseudos in a DAG post-process
ShihPo Hung [Tue, 22 Mar 2022 02:58:46 +0000 (19:58 -0700)]
[RISCV][RVV] Select unmasked TU RVV pseudos in a DAG post-process

Following D118810 that reduced the size of ISel table,
this patch optimizes allone-masked RVV pseudos with TU policy and
swap them out to their unmasked TU pseudos.

Since the UNDEF merge operand is not preserved, we turn it into TA
pseudo regardless of the policy operand.

Reviewed By: craig.topper, frasercrmck
Differential Revision: https://reviews.llvm.org/D121881

2 years ago[RISCV] Precommit test for D121881
ShihPo Hung [Fri, 8 Apr 2022 12:56:21 +0000 (05:56 -0700)]
[RISCV] Precommit test for D121881

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

2 years ago[clang-tidy] Modernize-macro-to-enum should skip macros used in other macros
Richard [Sat, 23 Apr 2022 01:35:48 +0000 (19:35 -0600)]
[clang-tidy] Modernize-macro-to-enum should skip macros used in other macros

If a macro is used in the expansion of another macro, that can cause
a compile error if the macro is replaced with an enum.  Token-pasting is
an example where converting a macro defined as an integral constant can
cause code to no longer compile.

This change causes such macros to be skipped from the conversion
process in order to prevent fixits from creating code that no longer
compiles.

A subsequent enhancement will examine macro usage in more detail to
allow more cases to be handled without breaking code.

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

Fixes #54948

2 years ago[mlir] Add extensible dialects
Mathieu Fehr [Wed, 27 Apr 2022 02:48:13 +0000 (19:48 -0700)]
[mlir] Add extensible dialects

Depends on D104534
Add support for extensible dialects, which are dialects that can be
extended at runtime with new operations and types.

These operations and types cannot at the moment implement traits
or interfaces.

Reviewed By: rriddle

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

2 years ago[mlir:PDLL] Use normalized paths in compilation database test
River Riddle [Wed, 27 Apr 2022 02:45:30 +0000 (19:45 -0700)]
[mlir:PDLL] Use normalized paths in compilation database test

This fixes issues with the compilation database when the file path
isn't in the correct form.

2 years ago[mlir:PDLL] Fix build on windows related to different file paths
River Riddle [Wed, 27 Apr 2022 02:40:41 +0000 (19:40 -0700)]
[mlir:PDLL] Fix build on windows related to different file paths

This fixes issues with the compilation database when the file path
isn't in the correct form.

2 years ago[ELF] Prevent LTO stripping of wrapped script-referenced symbols
Shoaib Meenai [Tue, 26 Apr 2022 05:51:10 +0000 (22:51 -0700)]
[ELF] Prevent LTO stripping of wrapped script-referenced symbols

After 1af25a986069f2ae8c724133fa8649bb795a7925, we stop unconditionally
retaining wrapped symbols, which means that LTO's summary-based global
dead stripping can eliminate them even if they'll be referenced by a
linker script after the wrapping is performed. Mark symbols referenced
in linker scripts as `referenced` in addition to `isUsedInRegularObj`,
so that the wrapping logic correctly sets `referencedAfterWrap` for the
symbols which will be referenced after wrapping, which will prevent LTO
from eliminating them.

An alternative would have been to change the `referencedAfterWrap` logic
to look at `isUsedInRegularObj` in addition to `referenced`, but
`isUsedInRegularObj` is also set in other places (e.g. for the entry
symbol), and it's not clear that we want `referencedAfterWrap` to take
all those places into account, so it seemed better to keep that logic
as-is and instead set `referenced` for linker script-referenced symbols.

Reviewed By: MaskRay

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

2 years ago[RISCV][NFC] Add RV64Zbs invalid tests
Ping Deng [Wed, 27 Apr 2022 01:38:21 +0000 (09:38 +0800)]
[RISCV][NFC] Add RV64Zbs invalid tests

Add a new test rv64zbs-invalid.s along with the aleady
existing rv32zbs-invalid.s.

Reviewed By: craig.topper, asb

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

2 years ago[mlir][PDLL-LSP] Add code completion for include file paths
River Riddle [Wed, 20 Apr 2022 18:58:11 +0000 (11:58 -0700)]
[mlir][PDLL-LSP] Add code completion for include file paths

This allows for providing completion results for include directive
file paths by searching the set of include directories for the current
file.

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

2 years ago[mlir][PDLL] Add document link and hover support to mlir-pdll-lsp-server
River Riddle [Wed, 20 Apr 2022 09:14:08 +0000 (02:14 -0700)]
[mlir][PDLL] Add document link and hover support to mlir-pdll-lsp-server

This allows for navigating to included files on click, and also provides hover
information about the include file (similarly to clangd).

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

2 years ago[mlir][PDLL] Add initial support for a PDLL compilation database
River Riddle [Wed, 20 Apr 2022 06:53:42 +0000 (23:53 -0700)]
[mlir][PDLL] Add initial support for a PDLL compilation database

The compilation database acts in a similar way to the compilation database
(compile_commands.json) used by clang-tidy, i.e. it provides additional
information about the compilation of project files to help the language
server. The main piece of information provided by the PDLL compilation
database in this commit is the set of include directories used when processing
the input .pdll file. This allows for the server to properly process .pdll files
that use includes anchored by the include directories set up in the build system.

The structure of the textual form of a compilation database is a yaml file
containing documents of the following form:

```
--- !FileInfo:
  filepath: <string> - Absolute file path of the file.
  includes: <string> - Semi-colon delimited list of include directories.
```

This commit also adds support to cmake for automatically generating
a `pdll_compile_commands.yml` file at the top-level of the build
directory.

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

2 years ago[mlir][PDLL] Add support for generating PDL patterns from PDLL at build time
River Riddle [Wed, 20 Apr 2022 05:46:34 +0000 (22:46 -0700)]
[mlir][PDLL] Add support for generating PDL patterns from PDLL at build time

This essentially sets up mlir-pdll to function in a similar manner to mlir-tblgen. Aside
from the boilerplate of configuring CMake and setting up a basic initial test, two new
options are added to mlir-pdll to mirror options provided by tblgen:

* -d
 This option generates a dependency file (i.e. a set of build time dependencies) while
 processing the input file.

* --write-if-changed
 This option only writes to the output file if the data would have changed, which for
 the build system prevents unnecesarry rebuilds if the file was touched but not actually
 changed.

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

2 years ago[mlir][PDLL] Don't use the result of `Constraint::getDefName()` when uniquing
River Riddle [Wed, 20 Apr 2022 03:34:21 +0000 (20:34 -0700)]
[mlir][PDLL] Don't use the result of `Constraint::getDefName()` when uniquing

In the case of anonymous defs this may return the name of the base def class,
which can lead to two different defs with the same name (which hits an assert).
This commit adds a new `getUniqueDefName` method that returns a unique name
for the constraint.

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

2 years agoDon't push null ExecutionContext on CommandInterp exectx stack
Jason Molenda [Wed, 27 Apr 2022 01:30:18 +0000 (18:30 -0700)]
Don't push null ExecutionContext on CommandInterp exectx stack

The driver can push a null ExecutionContext on to this stack,
and later calls to SBCommandInterpreter::HandleCommand which
don't specify an ExecutionContext can pull an entry from the
stack, resulting in settings that aren't applied.

Differential Revision: https://reviews.llvm.org/D111209
rdar://81489207

2 years agoUpstream test for wide character literals.
Eric Schweitz [Tue, 26 Apr 2022 23:49:01 +0000 (16:49 -0700)]
Upstream test for wide character literals.

Reviewed By: vdonaldson

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

2 years ago[Support] Factor out isCrash from throwIfCrash
Alexander Shaposhnikov [Wed, 27 Apr 2022 00:21:33 +0000 (00:21 +0000)]
[Support] Factor out isCrash from throwIfCrash

This diff factors out the check "isCrash" from the static method "throwIfCrash".
This is a helper function that can be useful in debugging / analysis, in particular,
I'm planning to use it in the future patches for lld-fuzzer.

Test plan:
1/ ninja check-all
2/ export LLD_IN_TEST=5 ninja check-lld

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

2 years ago[AMDGPU] Remove now unused variable HasLdsModifier. NFC.
Stanislav Mekhanoshin [Wed, 27 Apr 2022 00:45:41 +0000 (17:45 -0700)]
[AMDGPU] Remove now unused variable HasLdsModifier. NFC.

2 years ago[CUDA][HIP] Fix linkage of __clang_gpu_used_external
Yaxun (Sam) Liu [Tue, 26 Apr 2022 17:06:53 +0000 (13:06 -0400)]
[CUDA][HIP] Fix linkage of __clang_gpu_used_external

Different TU's may have this globl var. appending linkage can
only be used with lld recognized special variables.

Change it to internal linkage.

Reviewed by: Artem Belevich

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

2 years ago[AMDGPU] Add both mayLoad and mayStore to MUBUF LDS opcodes
Stanislav Mekhanoshin [Tue, 26 Apr 2022 22:00:42 +0000 (15:00 -0700)]
[AMDGPU] Add both mayLoad and mayStore to MUBUF LDS opcodes

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

2 years ago[AMDGPU] Remove vdata from buffer to lds load
Stanislav Mekhanoshin [Tue, 26 Apr 2022 21:58:42 +0000 (14:58 -0700)]
[AMDGPU] Remove vdata from buffer to lds load

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

2 years agoFix [libc] Minor test signedness fixes
Dominic Chen [Wed, 27 Apr 2022 00:14:39 +0000 (17:14 -0700)]
Fix [libc] Minor test signedness fixes

Add namespace specifier

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

2 years ago[libc] Minor test signedness fixes
Dominic Chen [Tue, 26 Apr 2022 17:25:05 +0000 (10:25 -0700)]
[libc] Minor test signedness fixes

Resolve compiler warnings about signed conversion

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

2 years agoFix missing import for test
Jeffrey Tan [Tue, 26 Apr 2022 21:29:10 +0000 (14:29 -0700)]
Fix missing import for test

The last fix missed an import in one test file causing skipIfWindows attribute
can't be recognized.
I feel embarrassed to miss it. I have run all tests on Mac to make sure them
passing in this patch.

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

2 years ago[NFC] Fix argument types in doxygen comment
Warren Ristow [Tue, 26 Apr 2022 23:29:33 +0000 (16:29 -0700)]
[NFC] Fix argument types in doxygen comment

The argument types for _mm_extract_epi16 and _mm_insert_epi16 were
incorrectly identified as '__m256i' instead of '__m128i'.  Introduced
by df08b3493869540bad5d4b040dae814e078b411d, and fixed here.

2 years ago[AIX][XCOFF] error on emit symbol visibility for XCOFF object file
David Tenty [Fri, 22 Apr 2022 18:37:17 +0000 (14:37 -0400)]
[AIX][XCOFF] error on emit symbol visibility for XCOFF object file

This is a follow on to the revert of D84265 to add an error if we'd need
to write a non-zero visibility type in the xcoff object file. We can't
currently do that because we lack the auxilary header to interpret the
bits in XCOFF32. This is important because visibility is being enabled
in the assembly writing path, and without this error the visibility
could be silently ignored.

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

2 years ago[SimplifyLibCalls] avoid slicing 64-bit integers in an ILP32 build (PR #54739)
Martin Sebor [Tue, 26 Apr 2022 22:26:09 +0000 (16:26 -0600)]
[SimplifyLibCalls] avoid slicing 64-bit integers in an ILP32 build (PR #54739)

Reviewed By: nikic

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

2 years ago[BOLT][NFC] Fix warning for unqualified call to std::move
Paul Kirth [Tue, 26 Apr 2022 23:17:26 +0000 (23:17 +0000)]
[BOLT][NFC] Fix warning for unqualified call to std::move

Fixes warning from RetpolineInsertion.cpp:171:44:
warning: unqualified call to std::move [-Wunqualified-std-cast-call]

Reviewed By: maksfb

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

2 years ago[mlir][sparse] support pattern-only matrices from Matrix Market
Aart Bik [Tue, 26 Apr 2022 20:30:57 +0000 (13:30 -0700)]
[mlir][sparse] support pattern-only matrices from Matrix Market

We simply set nonzero entries to the value "1" in this case.

Reviewed By: bixia

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

2 years ago[InstCombine] Fold strnlen of constant strings.
Martin Sebor [Tue, 26 Apr 2022 22:12:57 +0000 (16:12 -0600)]
[InstCombine] Fold strnlen of constant strings.

Reviewed By: nikic

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

2 years agotry to fix check-llvm on windows after 0a27622a1d62
Nico Weber [Tue, 26 Apr 2022 22:00:37 +0000 (18:00 -0400)]
try to fix check-llvm on windows after 0a27622a1d62

2 years ago[NFC] More synching of sources for upstreaming.
Eric Schweitz [Tue, 26 Apr 2022 20:44:34 +0000 (13:44 -0700)]
[NFC] More synching of sources for upstreaming.

Reviewed By: clementval

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

2 years ago[NFC] Cleanup miscellaneous header items
Warren Ristow [Tue, 26 Apr 2022 21:33:14 +0000 (14:33 -0700)]
[NFC] Cleanup miscellaneous header items

- Explain the use of the _MM_SHUFFLE and _MM_SHUFFLE2 macros
- Update some doxygen parameter descriptions to match the implementations
- Add "see also" doxygen tags to some intrinsics
- Minor clang-format changes

Reviewers: RKSimon

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

2 years ago[InstCombine] Update predicate when canonicalizing comparisons in canonicalizeClampLike.
Ricky Zhou [Tue, 26 Apr 2022 21:26:54 +0000 (17:26 -0400)]
[InstCombine] Update predicate when canonicalizing comparisons in canonicalizeClampLike.

canonicalizeClampLike canonicalizes the ule/ugt comparisons to ult/uge,
respectively. However, it does not update the variable holding the
comparison predicate type after doing this. Later code fails to handle
the non-canonical predicate type (specifically, the swap of
ThresholdLowIncl and ThresholdHighExcl when Pred0 has been canonicalized
from ugt to uge). This leads to the miscompile reported in PR53252. Fix
this by updating the comparison predicate after canonicalizing.

Fixes #53252

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

2 years ago[OpenMPIRBuilder] Remove ContinuationBB argument from Body callback.
Michael Kruse [Tue, 26 Apr 2022 18:35:13 +0000 (13:35 -0500)]
[OpenMPIRBuilder] Remove ContinuationBB argument from Body callback.

The callback is expected to create a branch to the ContinuationBB (sometimes called FiniBB in some lambdas) argument when finishing. This creates problems:

 1. The InsertPoint used for CodeGenIP does not need to be the end of a block. If it is not, a naive callback will insert a branch instruction into the middle of the block.

 2. The BasicBlock the CodeGenIP is pointing to may or may not have a terminator. There is an conflict where to branch to if the block already has a terminator.

 3. Some API functions work only with block having a terminator. Some workarounds have been used to insert a temporary terminator that is removed again.

 4. Some callbacks are sensitive to whether the BasicBlock has a terminator or not. This creates a callback ordering problem where different callback may have different behaviour depending on whether a previous callback created a terminator or not. The problem also exists for FinalizeCallbackTy where some callbacks do create branch to another "continue" block, but unlike BodyGenCallbackTy does not receive the target as argument. This is not addressed in this patch.

With this patch, the callback receives an CodeGenIP into a BasicBlock where to insert instructions. If it has to insert control flow, it can split the block at that position as needed but otherwise no separate ContinuationBB is needed. In particular, a callback can be empty without breaking the emitted IR. If the caller needs the control flow to branch to a specific target, it can insert the branch instruction itself and pass an InsertPoint before the terminator to the callback.

Certain frontends such as Clang may expect the current IRBuilder position to be at the end of a basic block. In this case its callbacks must split the block at CodeGenIP before setting the IRBuilder position such that the instructions after CodeGenIP are moved to another basic block and before returning create a new branch instruction to the split block.

Some utility functions such as `splitBB` are supporting correct splitting of BasicBlocks, independent of whether they have a terminator or not, returning/setting the InsertPoint of an IRBuilder to the end of split predecessor block, and optionally omitting creating a branch to the split successor block to be added later.

Reviewed By: kiranchandramohan

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

2 years ago[InstCombine] Add tests reproducing PR53252 (NFC)
Ricky Zhou [Tue, 26 Apr 2022 21:21:27 +0000 (17:21 -0400)]
[InstCombine] Add tests reproducing PR53252 (NFC)

This are baseline tests for D119690 ( #53252 )

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

2 years agoRevert "[compiler-rt] Use C_STANDARD instead of custom logic for adding -std=c11"
Martin Storsjö [Tue, 26 Apr 2022 21:19:14 +0000 (00:19 +0300)]
Revert "[compiler-rt] Use C_STANDARD instead of custom logic for adding -std=c11"

This reverts commit 2f251925db060f83894a4cf5448259b7a1255552.

This was reported to break the Builtins-powerpc64le-linux::qdiv_test.c
test on ppc64le buildbots, e.g. these:

https://lab.llvm.org/buildbot/#/builders/105/builds/24538
https://lab.llvm.org/buildbot/#/builders/121/builds/18755

2 years ago[AMDGPU] Properly mark MUBUF and FLAT LDS DMA instructions. NFC.
Stanislav Mekhanoshin [Tue, 26 Apr 2022 19:34:27 +0000 (12:34 -0700)]
[AMDGPU] Properly mark MUBUF and FLAT LDS DMA instructions. NFC.

Add these bits to the MUBUF and FLAT LDS DMA instructions:

- LGKM_CNT - these operate on LDS;
- VALU - SPG 3.9.8: This instruction acts as both a MUBUF and
VALU instruction;

Codegen currently does not produce any of this, so the change is NFC.

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

2 years agoRecommit "[SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmet...
Vasileios Porpodas [Tue, 26 Apr 2022 18:32:24 +0000 (11:32 -0700)]
Recommit "[SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmeticInstrCost`"

This reverts commit 6a9bbd9f20dcd700e28738788bb63a160c6c088c.

Code review: https://reviews.llvm.org/D124202

2 years ago[PS5] Add debug option testing for the PS5 target
Paul Robinson [Tue, 26 Apr 2022 20:36:22 +0000 (13:36 -0700)]
[PS5] Add debug option testing for the PS5 target

The functionality was added in 7726ad0, catching up on the tests now.

This test mostly runs clang and checks one thing each time, which isn't
very efficient.  I added some -DAG suffixes and combined some checks so
adding PS5 checking didn't actually increase the number of clang runs.

2 years agoDisable symbol on-demand feature for Windows
Jeffrey Tan [Tue, 26 Apr 2022 19:13:49 +0000 (12:13 -0700)]
Disable symbol on-demand feature for Windows

Symbol on-demand feature is never tested on Windows so it is not a surprise
that we are getting Buildbot failure from Windows:
https://lab.llvm.org/buildbot/#/builders/83/builds/18228

This patch disables symbol on-demand feature on Windows. I will find a Windows
machine to test and re-enable symbol on-demand feature as follow-up.

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

2 years agoRevert "[demangler] Simplify OutputBuffer initialization"
Kirill Stoimenov [Tue, 26 Apr 2022 20:24:06 +0000 (20:24 +0000)]
Revert "[demangler] Simplify OutputBuffer initialization"

Reverting due to a bot failure:
https://lab.llvm.org/buildbot/#/builders/5/builds/22738

This reverts commit 5b3ca24a35e91bf9c19af856e7f92c69b17f989e.

2 years ago[InstCombine] Fold memrchr calls with a constant character.
Martin Sebor [Tue, 26 Apr 2022 19:15:03 +0000 (13:15 -0600)]
[InstCombine] Fold memrchr calls with a constant character.

Reviewed By: nikic

Differential Revision: //reviews.llvm.org/D123629

2 years ago[InstCombine] Fold memrchr calls with constant size, bail on excessive.
Martin Sebor [Tue, 26 Apr 2022 17:52:15 +0000 (11:52 -0600)]
[InstCombine] Fold memrchr calls with constant size, bail on excessive.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D123626
Differential Revision: https://reviews.llvm.org/D123628

2 years ago[InstCombine] Fold strnlen with a bound of zero and one.
Martin Sebor [Tue, 26 Apr 2022 17:48:43 +0000 (11:48 -0600)]
[InstCombine] Fold strnlen with a bound of zero and one.

Reviewed By: nikic

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

2 years ago[InstCombine] add a strnlen handler stub.
Martin Sebor [Tue, 26 Apr 2022 17:35:59 +0000 (11:35 -0600)]
[InstCombine] add a strnlen handler stub.

Reviewed By: nikic

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

2 years ago[NVPTX] Temporary disable dwarf-file-dir.ll on Windows
Andrew Savonichev [Tue, 26 Apr 2022 19:22:38 +0000 (22:22 +0300)]
[NVPTX] Temporary disable dwarf-file-dir.ll on Windows

The test was added in D121299 and it fails on Windows:

    error: CHECK-NODIR: expected string
    not found in input
    ; CHECK-NODIR: .file {{[0-9]+}} "/tmp/dbginfo/a/a.cpp"
   ^
    <stdin>:1:1: note: scanning from here
    //
    ^
    <stdin>:25:2: note: possible intended match here
     .file 1 "/tmp/dbginfo/a\\a.cpp"

2 years ago[NFC] Fix order of initialization in MCTargetOptions
Andrew Savonichev [Tue, 26 Apr 2022 19:05:32 +0000 (22:05 +0300)]
[NFC] Fix order of initialization in MCTargetOptions

This patch fixes a compiler warning after D121299:

field 'MCUseDwarfDirectory' will be initialized after field
'MCIncrementalLinkerCompatible'

2 years ago[EarlyCSE] Add tests demonstrating missed opportunitites
Artur Pilipenko [Tue, 26 Apr 2022 18:58:08 +0000 (11:58 -0700)]
[EarlyCSE] Add tests demonstrating missed opportunitites

Add tests demonstrating missed opportunitites around
invariant.start intrinsic.

NFC.

2 years ago[NVPTX] Disable DWARF .file directory for PTX
Andrew Savonichev [Tue, 26 Apr 2022 15:45:09 +0000 (18:45 +0300)]
[NVPTX] Disable DWARF .file directory for PTX

Default behavior for .file directory was changed in D105856, but
ptxas (CUDA 11.5 release) refuses to parse it:

    $ llc -march=nvptx64 llvm/test/DebugInfo/NVPTX/debug-file-loc.ll
    $ ptxas debug-file-loc.s
    ptxas debug-file-loc.s, line 42; fatal   : Parsing error near
    '"foo.h"': syntax error

Added a new field to MCAsmInfo to control default value of
UseDwarfDirectory. This value is used if -dwarf-directory command line
option is not specified.

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

2 years ago[InstCombine] try to fold icmp with mismatched extended operands
Sanjay Patel [Tue, 26 Apr 2022 18:22:16 +0000 (14:22 -0400)]
[InstCombine] try to fold icmp with mismatched extended operands

If a value is known to be non-negative and zexted,
that's the same thing as sexted.

So for the purpose of looking past the casts with
an icmp, treat it as if it was a sext:
https://alive2.llvm.org/ce/z/_BDsGV

This is necessary, but not enough to solve the
motivating problem:
https://github.com/llvm/llvm-project/issues/55013

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

2 years agoRevert "[SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmetic...
Vasileios Porpodas [Tue, 26 Apr 2022 18:24:48 +0000 (11:24 -0700)]
Revert "[SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmeticInstrCost`"

This reverts commit 55ce296d6f217fd0defed2592ff7b74b79b2c1f0.

2 years ago[InstCombine] fold freeze of partial undef/poison vector constants
Sanjay Patel [Tue, 26 Apr 2022 17:59:32 +0000 (13:59 -0400)]
[InstCombine] fold freeze of partial undef/poison vector constants

We can always replace the undef elements in a vector constant
with regular constants to get rid of the freeze:
https://alive2.llvm.org/ce/z/nfRb4F

The select diffs show that we might do better by adjusting the
logic for a frozen select condition. We may also want to refine
the vector constant replacement to consider forming a splat.

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

2 years ago[RISCV] Add more out of range immediate tests to rv64zbp-invalid.s. NFC
Craig Topper [Tue, 26 Apr 2022 18:02:34 +0000 (11:02 -0700)]
[RISCV] Add more out of range immediate tests to rv64zbp-invalid.s. NFC

This tests the Zbp instructions that change immediate range between
riscv32 and riscv64. We were only testing them for riscv32 before.

2 years ago[SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmeticInstrCost`
Vasileios Porpodas [Thu, 21 Apr 2022 17:39:08 +0000 (10:39 -0700)]
[SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmeticInstrCost`

Before this patch `Args` was used to pass a broadcat's arguments by SLP.
This patch changes this. `Args` is now used for passing the operands of
the shuffle.

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

2 years agoAttributes: add a new `allocptr` attribute
Augie Fackler [Thu, 24 Feb 2022 15:40:20 +0000 (10:40 -0500)]
Attributes: add a new `allocptr` attribute

This continues the push away from hard-coded knowledge about functions
towards attributes. We'll use this to annotate free(), realloc() and
cousins and obviate the hard-coded list of free functions.

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

2 years ago[RISCV] Add out of range immediate tests for shifts and rotates on rv64.
Craig Topper [Tue, 26 Apr 2022 17:42:58 +0000 (10:42 -0700)]
[RISCV] Add out of range immediate tests for shifts and rotates on rv64.

We were only testing the shared instruction mnemonics in rv32 tests.

Reviewed By: reames

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

2 years ago[flang] Fix crash from PDT component init in module file
Peter Klausler [Mon, 25 Apr 2022 23:00:01 +0000 (16:00 -0700)]
[flang] Fix crash from PDT component init in module file

Semantics now needs to preserve the parse trees from module files,
in case they contain parameterized derived type definitions with
component initializers that may require re-analysis during PDT
instantiation.  Save them in the SemanticsContext.

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

2 years ago[AMDGPU] Precommit a test case for D124450
Jay Foad [Tue, 26 Apr 2022 16:01:02 +0000 (17:01 +0100)]
[AMDGPU] Precommit a test case for D124450

2 years ago[gn build] Port 7b81192d462b
LLVM GN Syncbot [Tue, 26 Apr 2022 17:42:25 +0000 (17:42 +0000)]
[gn build] Port 7b81192d462b

2 years agoIntroduce new symbol on-demand for debug info
Jeffrey Tan [Wed, 20 Apr 2022 14:30:53 +0000 (07:30 -0700)]
Introduce new symbol on-demand for debug info

This diff introduces a new symbol on-demand which skips
loading a module's debug info unless explicitly asked on
demand. This provides significant performance improvement
for application with dynamic linking mode which has large
number of modules.
The feature can be turned on with:
"settings set symbols.load-on-demand true"

The feature works by creating a new SymbolFileOnDemand class for
each module which wraps the actual SymbolFIle subclass as member
variable. By default, most virtual methods on SymbolFileOnDemand are
skipped so that it looks like there is no debug info for that module.
But once the module's debug info is explicitly requested to
be enabled (in the conditions mentioned below) SymbolFileOnDemand
will allow all methods to pass through and forward to the actual SymbolFile
which would hydrate module's debug info on-demand.

In an internal benchmark, we are seeing more than 95% improvement
for a 3000 modules application.

Currently we are providing several ways to on demand hydrate
a module's debug info:
* Source line breakpoint: matching in supported files
* Stack trace: resolving symbol context for an address
* Symbolic breakpoint: symbol table match guided promotion
* Global variable: symbol table match guided promotion

In all above situations the module's debug info will be on-demand
parsed and indexed.

Some follow-ups for this feature:
* Add a command that allows users to load debug info explicitly while using a
  new or existing command when this feature is enabled
* Add settings for "never load any of these executables in Symbols On Demand"
  that takes a list of globs
* Add settings for "always load the the debug info for executables in Symbols
  On Demand" that takes a list of globs
* Add a new column in "image list" that shows up by default when Symbols On
  Demand is enable to show the status for each shlib like "not enabled for
  this", "debug info off" and "debug info on" (with a single character to
  short string, not the ones I just typed)

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

2 years ago[AArch64][NFC] Deleted llvm/test/Analysis/CostModel/AArch64/splat-load.ll test
Vasileios Porpodas [Tue, 26 Apr 2022 14:33:42 +0000 (07:33 -0700)]
[AArch64][NFC] Deleted llvm/test/Analysis/CostModel/AArch64/splat-load.ll test

This test is no longer necessary as it is a subset of:
llvm/test/Analysis/CostModel/AArch64/shuffle-load.ll

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

2 years agollvm-reduce: Simplify virtual register cloning
Matt Arsenault [Sat, 16 Apr 2022 23:42:23 +0000 (19:42 -0400)]
llvm-reduce: Simplify virtual register cloning

Just clone all the virtual registers instead of looking for def
operands. This preserves the register values used, simplifying the
rest of the code. This avoids needing to expose the register map to
target code.

2 years agollvm-reduce: Preserve frame index values when cloning function
Matt Arsenault [Sat, 16 Apr 2022 21:17:41 +0000 (17:17 -0400)]
llvm-reduce: Preserve frame index values when cloning function

Previously the specific values used for fixed frame indexes was in
reverse order in the cloned function from the original, and a map was
used to adjust all frame indexes to the potentially new values. Insert
the fixed objects in reverse to avoid this. This simplifies other
code, since now we don't need to track down all frame indexes. This
will allow targets that store frame indexes in MachineFunctionInfo to
simply copy the values.

Note this isn't directly observable in the test since the resulting
MIR print/parse can shuffle the IDs around (in particular the final
serialization implicitly strips out dead objects).

2 years agoSupport non identity layout map for reshape ops in MemRefToLLVM lowering
Yi Zhang [Tue, 19 Apr 2022 00:50:30 +0000 (20:50 -0400)]
Support non identity layout map for reshape ops in MemRefToLLVM lowering

This change borrows the ideas from `computeExpanded/CollapsedLayoutMap`
and computes the dynamic strides at runtime for the memref descriptors.

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

2 years ago[flang] Get ppc64le build bot back up
Peter Klausler [Tue, 26 Apr 2022 00:36:05 +0000 (17:36 -0700)]
[flang] Get ppc64le build bot back up

A recent change assumed that the native C++ "long double" maps to
a Fortran data type; but this turns out to not be true for ppc64le,
which uses "double-double" for "long double".

This is a quick patch to get the ppc64le flang build bot back up.
A better fix that either uses HostTypeExists<> or replaces "long double"
with "ieee128_t" (or some other solution) is expected to follow soon.

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

2 years agoConsistently use the same apostrophe in these docs.
Tanya Lattner [Tue, 26 Apr 2022 16:29:44 +0000 (09:29 -0700)]
Consistently use the same apostrophe in these docs.

2 years ago[NFC][RISCV][CodeGen] Use ArrayRef in TargetLowering functions
Shao-Ce SUN [Tue, 26 Apr 2022 15:36:42 +0000 (23:36 +0800)]
[NFC][RISCV][CodeGen] Use ArrayRef in TargetLowering functions

Based on D123467.

Reviewed By: reames

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

2 years ago[NFC][libc++] Fixes some tests on Linux.
Mark de Wever [Sat, 23 Apr 2022 16:19:58 +0000 (18:19 +0200)]
[NFC][libc++] Fixes some tests on Linux.

The tests are adapted to the output produced on Linux.

Reviewed By: #libc, philnik, ldionne

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

2 years ago[InstCombine] Add extra use tests for GEP of GEP fold (NFC)
Nikita Popov [Tue, 26 Apr 2022 15:36:39 +0000 (17:36 +0200)]
[InstCombine] Add extra use tests for GEP of GEP fold (NFC)

2 years ago[TableGen] Dump RC.AllocationPriority with -register-info-debug
Jay Foad [Tue, 26 Apr 2022 15:29:06 +0000 (16:29 +0100)]
[TableGen] Dump RC.AllocationPriority with -register-info-debug

2 years ago[SPIRV][NFC] Remove unused variable
Chris Bieneman [Tue, 26 Apr 2022 14:58:16 +0000 (09:58 -0500)]
[SPIRV][NFC] Remove unused variable

This removes an unused local variable that was causing a warning to be
emitted.

2 years ago[SystemZ] Fix C++ ABI for passing args of structs containing zero width bitfield.
Jonas Paulsson [Thu, 24 Mar 2022 11:41:34 +0000 (12:41 +0100)]
[SystemZ] Fix C++ ABI for passing args of structs containing zero width bitfield.

A struct like { float a; int :0; } should per the SystemZ ABI be passed in a
GPR, but to match a bug in GCC it has been passed in an FPR (see 759449c).

GCC has now corrected the C++ ABI for this case, and this patch for clang
follows suit.

Reviewed By: Ulrich Weigand

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

2 years ago[InstCombine] Add tests for GEP of GEP with opaque pointers (NFC)
Nikita Popov [Tue, 26 Apr 2022 15:04:25 +0000 (17:04 +0200)]
[InstCombine] Add tests for GEP of GEP with opaque pointers (NFC)

Test cases with element type mismatch, some of which can still
be combined.

2 years ago[SPIRV][NFC] Fix warnings for switch cases
Chris Bieneman [Tue, 26 Apr 2022 14:46:50 +0000 (09:46 -0500)]
[SPIRV][NFC] Fix warnings for switch cases

Switch statements that cover all cases should not have a `default`
case. When a switch covers all cases and includes a `default` case,
clang emits a diagnostic. Omitting the `default` case allows the
compiler to instead emit a diagnostic on unhandled enum values.

This change removes default cases from all the places that they
shouldn't be, and adds a missing enum case for one switch statement
that wasn't covering all values.

2 years ago[SPIRV][NFC] Fix warning on class/struct mismatch
Chris Bieneman [Tue, 26 Apr 2022 14:46:07 +0000 (09:46 -0500)]
[SPIRV][NFC] Fix warning on class/struct mismatch

Clang issues a warning on class/struct mismatch because the MSVC ABI
varries for classes and structs.

2 years ago[OpenMP] Fix incorrect path taken when searching for LLD for offloading
Joseph Huber [Tue, 26 Apr 2022 14:49:31 +0000 (10:49 -0400)]
[OpenMP] Fix incorrect path taken when searching for LLD for offloading

Summary:
A previous patch updated the path searching in the linker wrapper. I
made an error and caused `lld`, which is necessary to link AMDGPU
images, to not be found on some systems. This patch fixes this by
correctly searching that linker-wrapper's binary path first again.