platform/upstream/llvm.git
2 years ago[AMDGPU][DOC][NFC] Added links to MI200 documentation
Dmitry Preobrazhensky [Fri, 18 Mar 2022 10:16:27 +0000 (13:16 +0300)]
[AMDGPU][DOC][NFC] Added links to MI200 documentation

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

2 years ago[flang][lowering] Add support for lowering of the `{l|u}bound` intrinsics
Andrzej Warzynski [Thu, 17 Mar 2022 17:11:35 +0000 (17:11 +0000)]
[flang][lowering] Add support for lowering of the `{l|u}bound` intrinsics

This patch adds support for lowering of the `{l|u}bound` intrinsics from
Fortran to the FIR dialect of MLIR. Note that `ubound` is already
supported, but the test was missing (added here).

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
2 years ago[CodeGen] Store element type in DominatingValue<RValue>
Nikita Popov [Fri, 18 Mar 2022 10:11:00 +0000 (11:11 +0100)]
[CodeGen] Store element type in DominatingValue<RValue>

For aggregate rvalues, we need to store the element type in the
dominating value, so we can recover the element type for the
address.

2 years ago[flang][lowering] Add support for lowering of the `merge` intrinsics
Andrzej Warzynski [Thu, 17 Mar 2022 16:58:40 +0000 (16:58 +0000)]
[flang][lowering] Add support for lowering of the `merge` intrinsics

This patch adds support for lowering of the `merge` intrinsics from
Fortran to the FIR dialect of MLIR.

This is part of the upstreaming effort from the `fir-dev` branch in [1].

[1] https://github.com/flang-compiler/f18-llvm-project

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

Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Mark Leair <leairmark@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2 years ago[CodeGen] Remove some uses of deprecated Address constructor
Nikita Popov [Fri, 18 Mar 2022 09:47:24 +0000 (10:47 +0100)]
[CodeGen] Remove some uses of deprecated Address constructor

2 years ago[bazel] Port a954ade8ed41
Benjamin Kramer [Fri, 18 Mar 2022 09:50:55 +0000 (10:50 +0100)]
[bazel] Port a954ade8ed41

2 years ago[bazel] Sync llvm-config.h after 112aafcaf425dca901690ca823d25607e5795263
Benjamin Kramer [Fri, 18 Mar 2022 09:45:54 +0000 (10:45 +0100)]
[bazel] Sync llvm-config.h after 112aafcaf425dca901690ca823d25607e5795263

2 years ago[InstCombine] Remove integer SPF of SPF folds (NFCI)
Nikita Popov [Thu, 24 Feb 2022 13:33:57 +0000 (14:33 +0100)]
[InstCombine] Remove integer SPF of SPF folds (NFCI)

Now that we canonicalize to intrinsics, these folds should no
longer be needed. Only one fold that also applies to floating-point
min/max is retained.

2 years ago[Flang] Lower the spacing, rrspacing intrinsics
Kiran Chandramohan [Thu, 17 Mar 2022 13:47:28 +0000 (13:47 +0000)]
[Flang] Lower the spacing, rrspacing intrinsics

These intrinsics returns the distance to the nearest real number and
their reciprocal. They are lowered to flang runtime calls.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: clementval

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

Co-authored-by: Mark Leair <leairmark@gmail.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2 years ago[MemorySSA] Don't optimize uses during construction
Nikita Popov [Wed, 9 Mar 2022 15:34:55 +0000 (16:34 +0100)]
[MemorySSA] Don't optimize uses during construction

This changes MemorySSA to be constructed in unoptimized form.
MemorySSA::ensureOptimizedUses() can be called to optimize all
uses (once). This should be done by passes where having optimized
uses is beneficial, either because we're going to query all uses
anyway, or because we're doing def-use walks.

This should help reduce the compile-time impact of MemorySSA for
some use cases (the reason why I started looking into this is
D117926), which can avoid optimizing all uses upfront, and instead
only optimize those that are actually queried.

Actually, we have an existing use-case for this, which is EarlyCSE.
Disabling eager use optimization there gives a significant
compile-time improvement, because EarlyCSE will generally only query
clobbers for a subset of all uses (this change is not included in
this patch).

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

2 years ago[LoopSimplifyCFG] Check predecessors of exits before marking them dead.
Florian Hahn [Fri, 18 Mar 2022 08:54:44 +0000 (08:54 +0000)]
[LoopSimplifyCFG] Check predecessors of exits before marking them dead.

LoopSimplifyCFG may process loops that are not in
loop-simplify/canonical form. For loops not in canonical form, exit
blocks may be reachable from non-loop blocks and we cannot consider them
as dead if they only are not reachable from the loop itself.

Unfortunately the smallest test I could come up with requires running
multiple passes:
    -passes='loop-mssa(loop-instsimplify,loop-simplifycfg,simple-loop-unswitch)'

The reason is that loops are canonicalized at the beginning of loop
pipelines, so a later transform has to break canonical form in a way
that breaks LoopSimplifyCFG's dead-exit analysis.

Alternatively we could try to require all loop passes to maintain
canonical form. That in turn would also require additional verification.

Fixes #54023, #49931.

Reviewed By: nikic

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

2 years ago[BOLT][NFC] Use X86 mnemonic tables
Amir Ayupov [Fri, 18 Mar 2022 08:48:00 +0000 (01:48 -0700)]
[BOLT][NFC] Use X86 mnemonic tables

Remove tables from X86MCPlusBuilder, make use of llvm::X86 mnemonic tables.

Reviewed By: rafauler

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

2 years ago[X86][NFC] Generate mnemonic tables
Amir Ayupov [Fri, 18 Mar 2022 08:45:23 +0000 (01:45 -0700)]
[X86][NFC] Generate mnemonic tables

Produce mnemonic tables, adding the functions to llvm::X86 namespace.

Reviewed By: MaskRay, skan

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

2 years ago[TableGen] X86 mnemonic tables backend
Amir Ayupov [Fri, 18 Mar 2022 08:41:10 +0000 (01:41 -0700)]
[TableGen] X86 mnemonic tables backend

Add tablegen backend that generates X86 mnemonic-based opcode groupings, e.g.
`isADD`, `isTEST`, etc.

Addresses https://lists.llvm.org/pipermail/llvm-dev/2022-January/154526.html

Reviewed By: skan

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

2 years ago[flang][NFC] Move random test in Instriscs folder
Valentin Clement [Fri, 18 Mar 2022 08:25:14 +0000 (09:25 +0100)]
[flang][NFC] Move random test in Instriscs folder

2 years agoRevert "Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assert...
Nikita Popov [Fri, 18 Mar 2022 08:20:44 +0000 (09:20 +0100)]
Revert "Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions are disabled"

This reverts commit 6316129e066e0a252430699f2b41706d4808476c.

This was implemented with inverted logic.

2 years ago[MLIR][Presburger] introduce SetCoalescer
Michel Weber [Fri, 18 Mar 2022 07:58:46 +0000 (07:58 +0000)]
[MLIR][Presburger] introduce SetCoalescer

This patch refactors the current coalesce implementation. It introduces
the `SetCoalescer`, a class in which all coalescing functionality lives.
The main advantage over the old design is the fact that the vectors of
constraints do not have to be passed around, but are implemented as
private fields of the SetCoalescer. This will become especially
important once more inequality types are introduced.

Reviewed By: arjunp

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

2 years ago[mlir][Math] Add constant folder for sqrt.
jacquesguan [Fri, 18 Mar 2022 06:16:47 +0000 (14:16 +0800)]
[mlir][Math] Add constant folder for sqrt.

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

2 years ago[lldb] Fix ^C handling in IOHandlerProcessSTDIO
Pavel Labath [Thu, 17 Mar 2022 14:09:12 +0000 (15:09 +0100)]
[lldb] Fix ^C handling in IOHandlerProcessSTDIO

D120762 accidentally moved the interrupt check into the block which was
reading stdio. This meant that a ^C only took effect after a regular
character has been pressed.

This patch fixes that and adds a (pexpect) test.

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

2 years agoRevert "[lldb] Fix ^C handling in IOHandlerProcessSTDIO"
Pavel Labath [Fri, 18 Mar 2022 07:42:10 +0000 (08:42 +0100)]
Revert "[lldb] Fix ^C handling in IOHandlerProcessSTDIO"

This reverts commit f93d861349f923f6b7ca1a425d3632eec1ff2a72 -- looks
like a bad application of `patch -p<level>`

2 years agoRemove a top-level "using namespace" directive from LegalizationArtifactCombiner.h
Pavel Labath [Tue, 15 Mar 2022 13:05:15 +0000 (14:05 +0100)]
Remove a top-level "using namespace" directive from LegalizationArtifactCombiner.h

The directive pollutes the namespace of all files including that header.
Move the directive into the bodies of functions that need it instead.

2 years ago[lldb] Add more documentation on test variants
Pavel Labath [Thu, 17 Mar 2022 10:41:10 +0000 (11:41 +0100)]
[lldb] Add more documentation on test variants

This formalizes some of the discussion on D121631.

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

2 years ago[lldb] Remove process->LoadModules call from DynamicLoaderPOSIXDYLD
Pavel Labath [Thu, 17 Mar 2022 14:55:26 +0000 (15:55 +0100)]
[lldb] Remove process->LoadModules call from DynamicLoaderPOSIXDYLD

The call is useless, as any modules loaded there will be removed in
ResolveExecutableModule. Modules will be reloaded again through the
GetLoadedModuleList call in DYLDRendezvous.cpp.

2 years ago[flang] Lower more array expression
Valentin Clement [Fri, 18 Mar 2022 07:22:17 +0000 (08:22 +0100)]
[flang] Lower more array expression

This patch adds more lowering for array expressions.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2 years ago[mlir][SymbolDCE] Track the number of symbols DCE'd
Nandor Licker [Thu, 17 Mar 2022 17:04:41 +0000 (19:04 +0200)]
[mlir][SymbolDCE] Track the number of symbols DCE'd

Added a statistic counting the number of erased symbols.

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

2 years agoFix llvm-strip --only-keep-debug documentation for ELF
James Henderson [Thu, 17 Mar 2022 11:36:42 +0000 (11:36 +0000)]
Fix llvm-strip --only-keep-debug documentation for ELF

The functionality (and llvm-objcopy's corresponding documentation) was
added in
https://github.com/llvm/llvm-project/commit/5ad0103d8a04cb066dfae4fc20b0dfcd9413f4d4.
It looks like the llvm-strip docs to match were missed.

Reviewed by: gbreynoo

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

2 years ago[X86][NFC] Rename target feature hasCMov->hasCMOV
Shengchen Kan [Fri, 18 Mar 2022 06:03:37 +0000 (14:03 +0800)]
[X86][NFC] Rename target feature hasCMov->hasCMOV

This is a follow-up patch for D121975.

2 years ago[AtomicExpand][PowerPC] Fix all-one mask value
Kai Luo [Fri, 18 Mar 2022 05:23:38 +0000 (13:23 +0800)]
[AtomicExpand][PowerPC] Fix all-one mask value

When generating a all-one mask value whose bitwidth is larger than 64, signed extension should be used rather then zero extension.

Reviewed By: jsji

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

2 years ago[X86] Rename more target feature related things consistency. NFC
Craig Topper [Fri, 18 Mar 2022 05:11:51 +0000 (22:11 -0700)]
[X86] Rename more target feature related things consistency. NFC

-Rename Mode*Bit to Is*Bit to match X86Subtarget.
-Rename FeatureLAHFSAHF to FeatureLAFHSAFH64 to match X86Subtarget.
-Use consistent capitalization

Reviewed By: skan

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

2 years ago[PowerPC][NFC] Add atomic alignments and ops tests for powerpc
Kai Luo [Fri, 18 Mar 2022 04:57:55 +0000 (12:57 +0800)]
[PowerPC][NFC] Add atomic alignments and ops tests for powerpc

PowerPC is lacking tests checking `_Atomic` alignment in cfe. Adding these tests since we're going to make change to align with gcc on Linux.

Reviewed By: hubert.reinterpretcast, jsji

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

2 years ago[X86] Set Int_MemBarrier as a meta-instruction
Shengchen Kan [Fri, 18 Mar 2022 05:11:39 +0000 (13:11 +0800)]
[X86] Set Int_MemBarrier as a meta-instruction

Compiler only emits a comment for `Int_MemBarrier`, so it should
be marked as a meta-instruction, which can help improve accuracy
of debug location.

Reviewed By: pengfei

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

2 years ago[Codegen][tablgen][NFC] Allow meta instruction to be target dependent
Shengchen Kan [Fri, 18 Mar 2022 05:07:13 +0000 (13:07 +0800)]
[Codegen][tablgen][NFC] Allow meta instruction to be target dependent

An instruction is a meta-instruction if it doesn't produce any output
in the form of executable instructions. So in the concept, a
meta-instruction does not have to be target independent.

Before this patch, `isMetaInstruction` is implemented by checking the
opcode of the instruction, add we have no way to add target dependent
opcode to the list, which does not make sense.

After this patch, a bit `isMeta` is added for class `Instruction` in
tablegen, which is used to indicate whether it's a meta instruction.

Reviewed By: pengfei

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

2 years ago[InstCombine] Sink instructions with multiple users in a successor block.
Andrew Wei [Fri, 18 Mar 2022 03:49:59 +0000 (11:49 +0800)]
[InstCombine] Sink instructions with multiple users in a successor block.

This patch tries to sink instructions when they are only used in a successor block.

This is a further enhancement patch based on Anna's commit:
D109700, which allows sinking an instruction having multiple uses in a single user.

In this patch, sink instructions with multiple users in a single successor block will be supported.
It could fix a known issue from rust:
  https://github.com/rust-lang/rust/issues/51346#issuecomment-394443610

Reviewed By: nikic, reames

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

2 years ago[libc][NFC] Add the platform independent file target only if mutex is available.
Siva Chandra Reddy [Thu, 17 Mar 2022 20:34:22 +0000 (20:34 +0000)]
[libc][NFC] Add the platform independent file target only if mutex is available.

The platform independent file implementation is not an entrypoint so it
cannot be excluded via the entrypoints.txt file. Hence, we need a
special treatment to exclude it from the build.

Reviewed By: michaelrj

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

2 years agoReland "Load pass plugins during option processing, so that plugin options are regist...
Wael Yehia [Mon, 14 Mar 2022 02:16:21 +0000 (22:16 -0400)]
Reland "Load pass plugins during option processing, so that plugin options are registered and live."

Fix Polly failures.

Reviewed By: mehdi_amini, Meinersbur

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

2 years ago[AMDGPU] Use COPY_TO_REGCLASS for buffer_atomic_cmpswap selection
Abinav Puthan Purayil [Thu, 17 Mar 2022 17:37:13 +0000 (23:07 +0530)]
[AMDGPU] Use COPY_TO_REGCLASS for buffer_atomic_cmpswap selection

GlobalISel was selecting the av_* regclass for some cases.

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

2 years ago[libc++][ranges] Implement changes to reverse_iterator from One Ranges Proposal.
Konstantin Varlamov [Fri, 18 Mar 2022 02:57:39 +0000 (19:57 -0700)]
[libc++][ranges] Implement changes to reverse_iterator from One Ranges Proposal.

Changes in [P0896](https://wg21.link/p0896):
- add `disable_sized_sentinel_for`;
- add `iter_move` and `iter_swap`;
- add a `requires` clause to the `operator->`;
- add `iterator_concept`;
- check that the `Iterator` template parameter is a bidirectional
  iterator;
- add constraints to all comparison operators;
- change the definitions of `iterator_category`, `value_type`,
  `difference_type` and `reference` (changes to `iterator_category` were
  already implemented).

Also add a few forgotten things to the `reverse_iterator` synopsis
(notably the spaceship operator).

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

2 years agoCorrect and complete dependency sets after 74b411d38c48513a125e67e049aca55452b9e855
Sterling Augustine [Fri, 18 Mar 2022 02:31:00 +0000 (19:31 -0700)]
Correct and complete dependency sets after 74b411d38c48513a125e67e049aca55452b9e855

Prior to this change the __support_cpp_array_ref target's only dependency was libc_root.
but it #includes "TypeTraits.h" and Array.h for that matter.

These dependencies matter when building in distributed build systems and the relevant
files must be know for the distributed build to ship them to the executor.

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

2 years ago[RISCV] Fix buildbot breakage by explicitly instantiating templates
Jessica Clarke [Fri, 18 Mar 2022 02:16:52 +0000 (02:16 +0000)]
[RISCV] Fix buildbot breakage by explicitly instantiating templates

RISCVISelDAGToDAG's selectImm uses RISCVTargetLowering::getAddr
(specifically the ConstantPoolSDNode) as of 41454ab25645 ("[RISCV] Use
constant pool for large integers"), but nothing explicitly instantiates
any of the templates, the only reason they exist is because of the
various lowering methods in RISCVISelLowering.cpp that themselves use
the methods. However, with inlining, those can end up not existing as
real functions and thus not be exported, leading to link errors. Up
until now this hasn't happened, but for whatever reason D121654 has
triggered this on the sanitizer-ppc64be-linux buildbot, giving:

  ../../../../lib/libLLVMRISCVCodeGen.a(RISCVISelDAGToDAG.cpp.o): In function `selectImm(llvm::SelectionDAG*, llvm::SDLoc const&, llvm::MVT, long, llvm::RISCVSubtarget const&)':
  RISCVISelDAGToDAG.cpp:(.text._ZL9selectImmPN4llvm12SelectionDAGERKNS_5SDLocENS_3MVTElRKNS_14RISCVSubtargetE+0x3d8): undefined reference to `llvm::SDValue llvm::RISCVTargetLowering::getAddr<llvm::ConstantPoolSDNode>(llvm::ConstantPoolSDNode*, llvm::SelectionDAG&, bool) const'
  collect2: error: ld returned 1 exit status

Fix this by explicitly instantiating getAddr in its four different forms
so separate translation units can reliably use it.

Fixes: 41454ab25645 ("[RISCV] Use constant pool for large integers")

2 years agoFix invalid preprocessor directive.
Sterling Augustine [Fri, 18 Mar 2022 02:12:48 +0000 (19:12 -0700)]
Fix invalid preprocessor directive.

2 years agoUpdate llvm-config.h.cmake for LLVM_UNREACHABLE_OPTIMIZE
Sterling Augustine [Fri, 18 Mar 2022 02:04:42 +0000 (19:04 -0700)]
Update llvm-config.h.cmake for LLVM_UNREACHABLE_OPTIMIZE

2 years ago[LoongArch] Add some blank lines to make .td more tidy. NFC
Weining Lu [Fri, 18 Mar 2022 01:49:16 +0000 (09:49 +0800)]
[LoongArch] Add some blank lines to make .td more tidy. NFC

2 years agoRevert "[SLP] Fix lookahead operand reordering for splat loads." due to build failures
Vasileios Porpodas [Fri, 18 Mar 2022 01:22:04 +0000 (18:22 -0700)]
Revert "[SLP] Fix lookahead operand reordering for splat loads." due to build failures

This reverts commit 5efa78985bf5cbba1c4346ba41a16435fc516446.

2 years ago[SLP][NFC] Added a test for a followup patch that enables handling splat loads with...
Vasileios Porpodas [Wed, 16 Mar 2022 22:45:51 +0000 (15:45 -0700)]
[SLP][NFC] Added a test for a followup patch that enables handling splat loads with uses.

2 years ago[SLP] Fix lookahead operand reordering for splat loads.
Vasileios Porpodas [Thu, 10 Mar 2022 02:18:16 +0000 (18:18 -0800)]
[SLP] Fix lookahead operand reordering for splat loads.

Splat loads are inexpensive in X86. For a 2-lane vector we need just one
instruction: `movddup (%reg), xmm0`. Using the standard Splat score leads
to worse code. This patch adds a new score dedicated for splat loads.

Please note that a splat is usually three IR instructions:
- It is usually a load and 2 inserts:
 %ld = load double, double* %gep
 %ins1 = insertelement <2 x double> poison, double %ld, i32 0
 %ins2 = insertelement <2 x double> %ins1, double %ld, i32 1

- But it can also be a load, an insert and a shuffle:
 %ld = load double, double* %gep
 %ins = insertelement <2 x double> poison, double %ld, i32 0
 %shf = shufflevector <2 x double> %ins, <2 x double> poison, <2 x i32> zeroinitializer

Because of this some of the lit tests contain more IR instructions.

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

2 years ago[SLP][NFC] This adds a test for a follow-up patch that fixes a look-ahead operand...
Vasileios Porpodas [Thu, 10 Mar 2022 01:47:23 +0000 (17:47 -0800)]
[SLP][NFC] This adds a test for a follow-up patch that fixes a look-ahead operand reordering issue

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

2 years agoUse llvm::append_range instead of push_back loops where applicable. NFCI.
Benjamin Kramer [Fri, 18 Mar 2022 00:15:43 +0000 (01:15 +0100)]
Use llvm::append_range instead of push_back loops where applicable. NFCI.

2 years agoRevert "Revert "Revert "[misexpect] Re-implement MisExpect Diagnostics"""
Paul Kirth [Fri, 18 Mar 2022 00:21:33 +0000 (00:21 +0000)]
Revert "Revert "Revert "[misexpect] Re-implement MisExpect Diagnostics"""

This reverts commit 6cf560d69a222bff4af4e1d092437fd77f0f981c.

2 years ago[gn build] (manually) port 6316129e066e
Nico Weber [Fri, 18 Mar 2022 00:08:11 +0000 (20:08 -0400)]
[gn build] (manually) port 6316129e066e

2 years agoRevert "Revert "[misexpect] Re-implement MisExpect Diagnostics""
Paul Kirth [Fri, 18 Mar 2022 00:04:22 +0000 (00:04 +0000)]
Revert "Revert "[misexpect] Re-implement MisExpect Diagnostics""

I mistakenly reverted my commit, so I'm relanding it.

This reverts commit 10866a1df4a82cdc54187330c509a2d46235455d.

2 years agoRevert "[misexpect] Re-implement MisExpect Diagnostics"
Paul Kirth [Thu, 17 Mar 2022 23:54:26 +0000 (23:54 +0000)]
Revert "[misexpect] Re-implement MisExpect Diagnostics"

This reverts commit e7749d4713a5ec886011ceb0fc821c6723061724.

2 years ago[misexpect] Re-implement MisExpect Diagnostics
Paul Kirth [Wed, 9 Mar 2022 16:01:38 +0000 (16:01 +0000)]
[misexpect] Re-implement MisExpect Diagnostics

Reimplements MisExpect diagnostics from D66324 to reconstruct its
original checking methodology only using MD_prof branch_weights
metadata.

New checks rely on 2 invariants:

1) For frontend instrumentation, MD_prof branch_weights will always be
   populated before llvm.expect intrinsics are lowered.

2) for IR and sample profiling, llvm.expect intrinsics will always be
   lowered before branch_weights are populated from the IR profiles.

These invariants allow the checking to assume how the existing branch
weights are populated depending on the profiling method used, and emit
the correct diagnostics. If these invariants are ever invalidated, the
MisExpect related checks would need to be updated, potentially by
re-introducing MD_misexpect metadata, and ensuring it always will be
transformed the same way as branch_weights in other optimization passes.

Frontend based profiling is now enabled without using LLVM Args, by
introducing a new CodeGen option, and checking if the -Wmisexpect flag
has been passed on the command line.

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

2 years ago[BPF] handle unsigned icmp ops in BPFAdjustOpt pass
Yonghong Song [Thu, 17 Mar 2022 05:09:59 +0000 (22:09 -0700)]
[BPF] handle unsigned icmp ops in BPFAdjustOpt pass

When investigating an issue with bcc tool inject.py, I found
a verifier failure with latest clang. The portion of code
can be illustrated as below:
  struct pid_struct {
    u64 curr_call;
    u64 conds_met;
    u64 stack[2];
  };
  struct pid_struct *bpf_map_lookup_elem();
  int foo() {
    struct pid_struct *p = bpf_map_lookup_elem();
    if (!p) return 0;
    p->curr_call--;
    if (p->conds_met < 1 || p->conds_met >= 3)
        return 0;
    if (p->stack[p->conds_met - 1] == p->curr_call)
        p->conds_met--;
    ...
  }

The verifier failure looks like:
  ...
  8: (79) r1 = *(u64 *)(r0 +0)
   R0_w=map_value(id=0,off=0,ks=4,vs=32,imm=0) R10=fp0 fp-8=mmmm????
  9: (07) r1 += -1
  10: (7b) *(u64 *)(r0 +0) = r1
   R0_w=map_value(id=0,off=0,ks=4,vs=32,imm=0) R1_w=inv(id=0) R10=fp0 fp-8=mmmm????
  11: (79) r2 = *(u64 *)(r0 +8)
   R0_w=map_value(id=0,off=0,ks=4,vs=32,imm=0) R1_w=inv(id=0) R10=fp0 fp-8=mmmm????
  12: (bf) r3 = r2
  13: (07) r3 += -3
  14: (b7) r4 = -2
  15: (2d) if r4 > r3 goto pc+13
   R0=map_value(id=0,off=0,ks=4,vs=32,imm=0) R1=inv(id=0) R2=inv(id=2)
   R3=inv(id=0,umin_value=18446744073709551614,var_off=(0xffffffff00000000; 0xffffffff))
   R4=inv-2 R10=fp0 fp-8=mmmm????
  16: (07) r2 += -1
  17: (bf) r3 = r2
  18: (67) r3 <<= 3
  19: (bf) r4 = r0
  20: (0f) r4 += r3
  math between map_value pointer and register with unbounded min value is not allowed

Here the compiler optimized "p->conds_met < 1 || p->conds_met >= 3" to
  r2 = p->conds_met
  r3 = r2
  r3 += -3
  r4 = -2
  if (r3 < r4) return 0
  r2 += -1
  r3 = r2
  ...
In the above, r3 is initially equal to r2, but is modified used by the comparison.
But later on r2 is used again. This caused verification failure.

BPF backend has a pass, AdjustOpt, to prevent such transformation, but only
focused on signed integers since typical bpf helper returns signed integers.
To fix this case, let us handle unsigned integers as well.

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

2 years ago[docs] Fix codeblock.
Alina Sbirlea [Thu, 17 Mar 2022 22:52:49 +0000 (15:52 -0700)]
[docs] Fix codeblock.

2 years agoRevert "[MLIR][Presburger] introduce SetCoalescer"
Mehdi Amini [Thu, 17 Mar 2022 22:49:13 +0000 (22:49 +0000)]
Revert "[MLIR][Presburger] introduce SetCoalescer"

This reverts commit dad80e97109afda17a278a5c1a87b2c595aa01a6.

The build is broken with some configurations (gcc-5 and gcc-8):

mlir/lib/Analysis/Presburger/PresburgerRelation.cpp:402:32: error: qualified name does not name a class before '{' token
 class presburger::SetCoalescer {

2 years ago[AMDGPU] Add 2 gfx940 mfma tests. NFC.
Stanislav Mekhanoshin [Thu, 17 Mar 2022 22:46:01 +0000 (15:46 -0700)]
[AMDGPU] Add 2 gfx940 mfma tests. NFC.

2 years ago[Attributor] Remove more non-deterministic behavior and debug output
Johannes Doerfert [Thu, 17 Mar 2022 22:40:05 +0000 (17:40 -0500)]
[Attributor] Remove more non-deterministic behavior and debug output

2 years ago[OpenMP][FIX] Initialize member to avoid undefined value in debug output
Johannes Doerfert [Thu, 17 Mar 2022 22:39:25 +0000 (17:39 -0500)]
[OpenMP][FIX] Initialize member to avoid undefined value in debug output

2 years ago[Attributor][FIX] Remove reference into map that might dangle
Johannes Doerfert [Thu, 17 Mar 2022 22:37:15 +0000 (17:37 -0500)]
[Attributor][FIX] Remove reference into map that might dangle

The reference was taken and the map was modified after. This can (and
did) lead to dangling pointers and all sorts of problems afterwards.

2 years ago[AlwaysInliner] Emit inline remark only when successful
Ellis Hoag [Thu, 17 Mar 2022 20:00:27 +0000 (13:00 -0700)]
[AlwaysInliner] Emit inline remark only when successful

Failures in `InlineFunction()` are caught after D121722, but `emitInlinedIntoBasedOnCost()` should only be called when inlining is successful. This also removes an unnecessary call to `shouldInline()` which always returned `InlineCost::getAlways()`.

Reviewed By: kyulee, nikic

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

2 years ago[docs] Add details to MemorySSA docs.
Alina Sbirlea [Tue, 15 Mar 2022 21:16:00 +0000 (14:16 -0700)]
[docs] Add details to MemorySSA docs.

Add more details to the docs regarding optimized accesses for Uses and Defs.
Include incoming changes from https://reviews.llvm.org/D121381.

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

2 years ago[WebAssembly] Add end-to-end codegen tests for wasm_simd128.h
Thomas Lively [Thu, 17 Mar 2022 22:22:17 +0000 (15:22 -0700)]
[WebAssembly] Add end-to-end codegen tests for wasm_simd128.h

Add a test checking that each SIMD intrinsic produces the expected instruction.
Since this test spans both clang and LLVM, place it in a new
intrinsic-header-tests subdirectory of cross-project-tests.

This revives D101684 now that cross-project-tests exists. In practice, the tests
of lowering from wasm_simd128.h to LLVM IR were not as useful as this end-to-end
test.

Updates the version check of gdb in cross-project-tests/lit.cfg.py so that
unexpected version formats do not prevent the new tests from running.

Depends on D121661.

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

2 years agoAdd a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions...
Mehdi Amini [Thu, 17 Mar 2022 22:19:33 +0000 (22:19 +0000)]
Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions are disabled

Reviewed By: dexonsmith

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

2 years ago[lldb] Migrate ProcessGDBRemote to ReportWarning
Jonas Devlieghere [Thu, 17 Mar 2022 20:55:24 +0000 (13:55 -0700)]
[lldb] Migrate ProcessGDBRemote to ReportWarning

2 years ago[ObjCARC] Fix non-determinism
Kyungwoo Lee [Thu, 17 Mar 2022 22:00:29 +0000 (15:00 -0700)]
[ObjCARC] Fix non-determinism

We often failed in the assertion, non-deterministically with a large IR:
```
Assertion `notDifferentParent(LocA.Ptr, LocB.Ptr) && "BasicAliasAnalysis doesn't support interprocedural queries."
```
Looking at the comment in https://reviews.llvm.org/D87806, it appears it's actually a module pass for new PM while the legacy PM still works as a function pass.
The fix is to align the same behavior in between new PM and old PM, which initializes ObjCARCContract for each function.

Reviewed By: aeubanks

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

2 years ago[libc++] [test] Add ranges_robust_against_copying_*.pass.cpp
Nikolas Klauser [Thu, 17 Mar 2022 21:27:13 +0000 (22:27 +0100)]
[libc++] [test] Add ranges_robust_against_copying_*.pass.cpp

    This tests the same QoI issue as the existing STL Classic test,
    but for the Ranges algorithms. Also, do the same thing for all
    the algorithms that take projections.

I found a few missing algorithms and added them to the existing test, too. `std::find_first_of` currently fails; I should look at why that is (and in particular, what is it doing weird that //makes// it inconsistent with the entire rest of libc++?).

Reviewed By: ldionne, #libc

Spies: libcxx-commits

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

2 years ago[libc++] Install psutil on CI builders
Louis Dionne [Thu, 17 Mar 2022 21:32:29 +0000 (17:32 -0400)]
[libc++] Install psutil on CI builders

This will make it possible to add a timeout when running the tests.

2 years agoAMDGPU: Use the implicit kernargs for code object version 5
Changpeng Fang [Thu, 17 Mar 2022 21:12:36 +0000 (14:12 -0700)]
AMDGPU: Use the implicit kernargs for code object version 5

Summary:
  Specifically, for trap handling, for targets that do not support getDoorbellID,
we load the queue_ptr from the implicit kernarg, and move queue_ptr to s[0:1].
To get aperture bases when targets do not have aperture registers, we load
private_base or shared_base directly from the implicit kernarg. In clang, we use
implicitarg_ptr + offsets to implement __builtin_amdgcn_workgroup_size_{xyz}.

Reviewers: arsenm, sameerds, yaxunl

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

2 years ago[libc++] Add missing <cstddef> include
Louis Dionne [Thu, 17 Mar 2022 21:07:27 +0000 (17:07 -0400)]
[libc++] Add missing <cstddef> include

2 years ago[lld][WebAssembly] Fix crash accessing non-live __tls_base symbol
Sam Clegg [Thu, 17 Mar 2022 05:28:38 +0000 (22:28 -0700)]
[lld][WebAssembly] Fix crash accessing non-live __tls_base symbol

In programs that don't otherwise depend on `__tls_base` it won't
be marked as live.  However this symbol is used internally in
a couple of places do we need to mark it as live explictily in
those places.

Fixes: #54386

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

2 years ago[IndVars] Add a new test affected by 62f86d4f
Eli Friedman [Thu, 17 Mar 2022 20:48:11 +0000 (13:48 -0700)]
[IndVars] Add a new test affected by 62f86d4f

2 years ago[IROutliner] Make sure that loop debug info is stripped.
Andrew Litteken [Mon, 14 Mar 2022 04:45:29 +0000 (23:45 -0500)]
[IROutliner] Make sure that loop debug info is stripped.

As pointed out in https://github.com/llvm/llvm-project/issues/54155#issuecomment-1057465479, there was a crash when loop info was being outlined. It was not being properly stripped and adjusted, so would point to the wrong location. This uses similar logic found in the CodeExtractor to adjust the loop debug info.

Reviewer: fhahn, paquette

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

2 years ago[flang] Add array constructor lowering tests
Valentin Clement [Thu, 17 Mar 2022 20:39:19 +0000 (21:39 +0100)]
[flang] Add array constructor lowering tests

This patch adds some tests for the lowering of
array constructors.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: mleair <leairmark@gmail.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2 years ago[AMDGPU] New MFMA names for existing instructions
Stanislav Mekhanoshin [Tue, 15 Mar 2022 20:36:06 +0000 (13:36 -0700)]
[AMDGPU] New MFMA names for existing instructions

Old names are supported as aliases.
_1k MFMA got new opcodes.

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

2 years ago[AMDGPU] Add gfx90a and gfx940 to get_elf_mach_gfx_name.cpp
Stanislav Mekhanoshin [Wed, 2 Mar 2022 22:18:13 +0000 (14:18 -0800)]
[AMDGPU] Add gfx90a and gfx940 to get_elf_mach_gfx_name.cpp

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

2 years ago[VFS] Add print/dump to the whole FileSystem hierarchy
Ben Barham [Wed, 9 Mar 2022 20:23:22 +0000 (12:23 -0800)]
[VFS] Add print/dump to the whole FileSystem hierarchy

For now most are implemented by printing out the name of the filesystem,
but this can be expanded in the future. Only `OverlayFileSystem` and
`RedirectingFileSystem` are properly implemented in this patch.
  - `OverlayFileSystem`: Prints each filesystem in the order that any
    operations are actually run on them. Optionally prints recursively.
  - `RedirectingFileSystem`: Prints out all mappings, as well as the
    `ExternalFS`. Most of this was already implemented other than the
    handling for the `DirectoryRemap` case and to actually print out the
    mapping.

Each FS should implement `printImpl` rather than `print`, where the
latter just fowards to the former. This is to avoid spreading the
default arguments through to the subclasses (where we may miss updating
in the future).

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

2 years ago[OpenMP][FIX] Make metadata and attribute check lines less detailed
Johannes Doerfert [Thu, 17 Mar 2022 19:58:22 +0000 (14:58 -0500)]
[OpenMP][FIX] Make metadata and attribute check lines less detailed

The update_cc script should really do this automatically :(

2 years ago[MLIR][Presburger] introduce SetCoalescer
Michel Weber [Thu, 17 Mar 2022 19:50:38 +0000 (19:50 +0000)]
[MLIR][Presburger] introduce SetCoalescer

This patch refactors the current coalesce implementation. It introduces
the `SetCoalescer`, a class in which all coalescing functionality lives.
The main advantage over the old design is the fact that the vectors of
constraints do not have to be passed around, but are implemented as
private fields of the SetCoalescer. This will become especially
important once more inequality types are introduced.

Reviewed By: arjunp

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

2 years ago[dsymutil] Store possible Swift reflection sections in an array
Benjamin Kramer [Thu, 17 Mar 2022 19:37:39 +0000 (20:37 +0100)]
[dsymutil] Store possible Swift reflection sections in an array

No need for a unordered_map of enum, which is also broken in GCC before
6.1. No functionality change intended.

2 years ago[mlir] Move InterfaceMap::InterfaceMap to the cpp file
Benjamin Kramer [Thu, 17 Mar 2022 19:13:52 +0000 (20:13 +0100)]
[mlir] Move InterfaceMap::InterfaceMap to the cpp file

So we don't end up with a copy of std::sort in every dialect definition.
NFCI.

2 years ago[mlir] Use array_pod_sort for sorting stats/counters.
Benjamin Kramer [Thu, 17 Mar 2022 19:10:27 +0000 (20:10 +0100)]
[mlir] Use array_pod_sort for sorting stats/counters.

This isn't performance sensitive and array_pod_sort is a lot smaller.
NFCI.

2 years ago[AMDGPU] Allow v_accvgpr_write to use SGPR src on gfx940
Stanislav Mekhanoshin [Wed, 16 Mar 2022 19:39:31 +0000 (12:39 -0700)]
[AMDGPU] Allow v_accvgpr_write to use SGPR src on gfx940

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

2 years ago[gn build] Port 22570bac6943
LLVM GN Syncbot [Thu, 17 Mar 2022 19:06:22 +0000 (19:06 +0000)]
[gn build] Port 22570bac6943

2 years agoPrecommit test for D121483:
Kevin P. Neal [Thu, 17 Mar 2022 19:01:12 +0000 (15:01 -0400)]
Precommit test for D121483:
[FPEnv][InstSimplify] Teach CannotBeNegativeZero() about constrained intrinsics.

2 years ago[OpenMP][FIX] Relax test check lines
Johannes Doerfert [Thu, 17 Mar 2022 19:01:07 +0000 (14:01 -0500)]
[OpenMP][FIX] Relax test check lines

2 years ago[lldb] Fix ^C handling in IOHandlerProcessSTDIO
Pavel Labath [Thu, 17 Mar 2022 18:47:00 +0000 (11:47 -0700)]
[lldb] Fix ^C handling in IOHandlerProcessSTDIO

D120762 accidentally moved the interrupt check into the block which was
reading stdio. This meant that a ^C only took effect after a regular
character has been pressed.

This patch fixes that and adds a (pexpect) test.

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

2 years agoCurrently the control of the eval-method is mixed with fast-math.
Zahira Ammarguellat [Mon, 7 Mar 2022 15:28:45 +0000 (07:28 -0800)]
Currently the control of the eval-method is mixed with fast-math.
FLT_EVAL_METHOD tells the user the precision at which, temporary results
are evaluated but when fast-math is enabled, the numeric values are not
guaranteed to match the source semantics, so the eval-method is
meaningless.
For example, the expression `x + y + z` has as source semantics `(x + y)
+ z`. FLT_EVAL_METHOD is telling the user at which precision `(x + y)`
is evaluated. With fast-math enable the compiler can choose to
evaluate the expression as `(y + z) + x`.
The correct behavior is to set the FLT_EVAL_METHOD to `-1` to tell the
user that the precision of the intermediate values is unknow. This
patch is doing that.

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

2 years ago[AMDGPU] Fix PreRARematerialize scheduler pass sinking subreg defs
Vang Thao [Thu, 17 Mar 2022 00:40:08 +0000 (17:40 -0700)]
[AMDGPU] Fix PreRARematerialize scheduler pass sinking subreg defs

When collecting trivially rematerializable defs, skip any subreg defs. We do not want to sink these.

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

2 years agoReland "Use a stable-sort when combining bases"
Sterling Augustine [Thu, 17 Mar 2022 17:01:49 +0000 (10:01 -0700)]
Reland "Use a stable-sort when combining bases"

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

2 years ago[libc++] Switch to the new testing configurations by default
Louis Dionne [Mon, 14 Mar 2022 18:23:38 +0000 (14:23 -0400)]
[libc++] Switch to the new testing configurations by default

We've been meaning to remove support for the legacy testing configuration
for a long time. This patch switches the default from the legacy config
to the appropriate new-style configuration based on a few hints.

We've been running with the new-style configuration for more than a year
in our CI, however it's possible that this will uncover issues with some
users that run the tests on platforms that we don't support yet with the
new-style configs. Unfortunately, there is no way to know about it other
than to land this patch and see whether anything breaks.

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

2 years ago[MLIR][Math] Add constant folder for powf
William S. Moses [Wed, 16 Mar 2022 20:51:03 +0000 (16:51 -0400)]
[MLIR][Math] Add constant folder for powf

Constant fold powf, given two constant operands and a compatible type

Reviewed By: ftynse

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

2 years ago[SLP]Do not schedule instructions with constants/argument/phi operands and external...
Alexey Bataev [Tue, 1 Mar 2022 19:32:32 +0000 (11:32 -0800)]
[SLP]Do not schedule instructions with constants/argument/phi operands and external users.

No need to schedule entry nodes where all instructions are not memory
read/write instructions and their operands are either constants, or
arguments, or phis, or instructions from others blocks, or their users
are phis or from the other blocks.
The resulting vector instructions can be placed at
the beginning of the basic block without scheduling (if operands does
not need to be scheduled) or at the end of the block (if users are
outside of the block).
It may save some compile time and scheduling resources.

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

2 years ago[scudo] Use portable sysconf instead of deprecated getpagesize
Dominic Chen [Wed, 16 Mar 2022 20:51:46 +0000 (13:51 -0700)]
[scudo] Use portable sysconf instead of deprecated getpagesize

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

2 years ago[MLIR] Add affine.load fold hook on global constant memrefs
Uday Bondhugula [Thu, 17 Mar 2022 17:31:54 +0000 (23:01 +0530)]
[MLIR] Add affine.load fold hook on global constant memrefs

Fold affine.load ops on global constant memrefs when indices are all
constant.

Reviewed By: ayzhuang

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

2 years agoReapply "[OpenMP][FIX] Allow device constructors for AMD GPU"
Johannes Doerfert [Thu, 17 Mar 2022 16:10:11 +0000 (11:10 -0500)]
Reapply "[OpenMP][FIX] Allow device constructors for AMD GPU"

This reverts commit a597d6a780b184539f504392168b004bf392a135 and
reapplies 07b176646134.

In AMD GPU device code the globals are in AS(1). Before, we crashed if
the global was a structure. Now we simply cast away the AS before we
generate the code to initialize the global.

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

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

2 years agoAdd another office hour
Johannes Doerfert [Thu, 17 Mar 2022 17:48:13 +0000 (12:48 -0500)]
Add another office hour

2 years agoLower `@llvm.global_dtors` using `__cxa_atexit` on MachO
Julian Lettner [Wed, 9 Mar 2022 20:33:59 +0000 (12:33 -0800)]
Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO

For MachO, lower `@llvm.global_dtors` into `@llvm_global_ctors` with
`__cxa_atexit` calls to avoid emitting the deprecated `__mod_term_func`.

Reuse the existing `WebAssemblyLowerGlobalDtors.cpp` to accomplish this.

Enable fallback to the old behavior via Clang driver flag
(`-fregister-global-dtors-with-atexit`) or llc / code generation flag
(`-lower-global-dtors-via-cxa-atexit`).  This escape hatch will be
removed in the future.

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

2 years ago[mlir][sparse] Introduce new binary and unary op
Jim Kitchen [Thu, 17 Mar 2022 17:16:29 +0000 (12:16 -0500)]
[mlir][sparse] Introduce new binary and unary op

When the sparse_tensor dialect lowers linalg.generic,
it makes inferences about how the operations should
affect the looping logic. For example, multiplication
is an intersection while addition is a union of two
sparse tensors.

The new binary and unary op separate the looping logic
from the computation by nesting the computation code
inside a block which is merged at the appropriate level
in the lowered looping code.

The binary op can have custom computation code for the
overlap, left, and right sparse overlap regions. The
unary op can have custom computation code for the
present and absent values.

Reviewed by: aartbik

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

2 years ago[ARM] Fix Decode of tsb csync
Archibald Elliott [Thu, 17 Mar 2022 17:29:24 +0000 (17:29 +0000)]
[ARM] Fix Decode of tsb csync

There is a crash in the ARM backend when attempting to decode a "tsb
csync" instruction using `llvm-objdump --triple=armv8.4a -d`. The crash
was in `ARMMCInstrAnalysis::evaluateBranch` where the number of operands
in the decoded instruction (0) did not match the number of operands in
the instruction description (1).

This is becuase `tsb csync` looks like it has an operand during
assembly, but there is only one valid operand (csync), so there is no
encoding space in the instruction for the operand, so the decoder never
has a field to decode that represents `csync`.

The fix is to add a custom decode method, which ensures that this
instruction does have the right number of operands after decoding. This
method merely adds the only available operand value, `ARM_TSB::CSYNC`.

Reviewed By: tmatheson

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

2 years ago[dsymutil] Apply relocations present in Swift reflection sections
Augusto Noronha [Fri, 25 Feb 2022 18:20:02 +0000 (15:20 -0300)]
[dsymutil] Apply relocations present in Swift reflection sections

The strippable Swift reflection sections contain subtractor relocations
that need to be applied. There are two situations we need to support.
1) Both symbols used in the relocation come from the .o file (for
   example, one symbol lives in __swift5_fieldmd and the second in
   __swift5_reflstr).
2) One symbol comes from th .o file and the second from the main
   binary (for example, __swift5_fieldmd and __swift5_typeref).

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