SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [NFC] Use llvm::hasSingleElement() in place of .size() == 1 (details)
  2. [SVE] Fix invalid usages of getNumElements in ShuffleVectorInstruction (details)
  3. [SVE] Eliminate bad VectorType::getNumElements() calls from ConstantFold (details)
  4. [MLIR] Fix parallel loop tiling. (details)
  5. Remove unused class variable ModuleSlice. (details)
  6. [flang] Fix fallout from varous changes to the cmake files. (details)
  7. Revert "Remove unused class variable ModuleSlice." as it was (details)
  8. [MLIR][SPIRVToLLVM] Support cast ops, some logical ops, UModOp (details)
  9. Fix rejects-valid when referencing an implicit operator== from within a (details)
  10. When performing a substitution into a dependent alias template, mark the (details)
  11. [BPF] fix a bug for BTF pointee type pruning (details)
  12. [clang-format] NFC 3% improvement in the overall clang-formatted status (details)
  13. [CUDA] make the test more hermetic (details)
  14. [mlir][spirv] Add MatrixTimesScalar operation (details)
  15. [mlir][Inliner] Properly handle callgraph node deletion (details)
  16. [flang] More Fortran runtime support for CHARACTER operations (details)
  17. Revert "Fix rejects-valid when referencing an implicit operator== from within a" (details)
  18. Revert "When performing a substitution into a dependent alias template, mark the" (details)
  19. AMDGPU: Don't use 16-bit FP inline constants in integer operands (details)
  20. [Driver] Search computed sysroot for libc++ header paths (details)
  21. [WebAssembly] MC: Fix for data aliases with offsets (getelementptr) (details)
  22. [ELF] Improve --export-dynamic-symbol performance by checking whether wildcard is really used (details)
  23. [PowerPC] Custom lower rotl v1i128 to vector_shuffle. (details)
  24. [ObjectYAML][ELF] Add support for emitting the .debug_abbrev section. (details)
  25. [PowerPC] Don't convert Loop to CTR Loop for fp128 BinaryOperator (details)
  26. Remove "unused" member ModuleSlice from `struct OpenMPOpt` (details)
  27. [lld-macho] Avoid explicit -arch in tests by defaulting to x86-64 (details)
  28. [lld-macho] Support non-pcrel section relocs (details)
  29. [lld-macho] Support X86_64_RELOC_GOT (details)
  30. [lld-macho] Handle GOT relocations of non-dylib symbols (details)
  31. [lld-macho] Ensure __bss sections we output have file offset of zero (details)
  32. [lld-macho] Handle alignment correctly when merging InputSections (details)
  33. [lld-macho] Handle framework search path, alongside library search path (details)
  34. [lld-macho] Add missing search-paths-darwin.test (details)
  35. [MLIR] Move SymbolOpInterface::isPublic() and friends to SymbolOpInterface Trait. (details)
  36. [DWARFYAML][debug_abbrev] Make the abbreviation code optional. (details)
  37. [Test] Add more tests showing missing opportunities in Select instcombine (details)
  38. [AArch64] SLSHardening: compute correct thunk name for X29. (details)
  39. [IndirectThunks] Make generated MF structure as expected by all instruction selectors. (details)
  40. [IndirectThunks] Tiny comment fix (details)
  41. [flang] AMAX0, MIN1... rewrite to MAX/MIN: make result conversion explicit (details)
  42. [AST] Move the "fallback to recovery expr" mechanism to CorrectDelayedTyposInExpr, NFC (details)
Commit 2eaadfc4fe662e1ba312929cd650ed349fe7f2b4 by jurahul
[NFC] Use llvm::hasSingleElement() in place of .size() == 1

- Also use functions in Region instead of Region::getBlocks() where possible.

Differential Revision: https://reviews.llvm.org/D82032
The file was modifiedmlir/lib/Transforms/MemRefDataFlowOpt.cpp
The file was modifiedmlir/lib/Dialect/Linalg/EDSC/Builders.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
The file was modifiedmlir/lib/Transforms/ViewOpGraph.cpp
Commit 4b776a98f1a425e264545b5c2abeff9e83a6f947 by ctetreau
[SVE] Fix invalid usages of getNumElements in ShuffleVectorInstruction

Summary:
Fix invalid usages of getNumElements identified by test case
LLVM.Transforms/InstCombine::vscale_extractelement.ll.

changesLength: Since the length of the llvm::SmallVector shufflemask
is related to the minimum number of elements in a scalable vector, it is
fine to just get the Min field of the ElementCount

isIdentityWithExtract: Since it is not possible to express the mask
needed for this pattern for scalable vectors, we can just bail before
calling getNumElements()

Reviewers: efriedma, sdesmalen, fpetrogalli, gchatelet, yrouban, craig.topper

Reviewed By: sdesmalen

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81969
The file was modifiedllvm/lib/IR/Instructions.cpp
The file was modifiedllvm/include/llvm/IR/Instructions.h
Commit 8819202dfd2c39a7ed4dd69f0d7e0e0bcf409e2a by ctetreau
[SVE] Eliminate bad VectorType::getNumElements() calls from ConstantFold

Summary:
Assume all usages of this function are explicitly fixed-width operations
and cast to FixedVectorType

Reviewers: efriedma, sdesmalen, c-rhodes, majnemer, dblaikie

Reviewed By: sdesmalen

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80262
The file was addedllvm/test/Analysis/ConstantFolding/extractelement-vscale.ll
The file was modifiedllvm/lib/IR/ConstantFold.cpp
Commit 1e60678c1f68a9ba109a669afa471834692ce979 by herhut
[MLIR] Fix parallel loop tiling.

Summary:
Parallel loop tiling did not properly compute the updated loop
indices when tiling, which lead to wrong results.

Differential Revision: https://reviews.llvm.org/D82013
The file was modifiedmlir/test/Dialect/SCF/parallel-loop-tiling.mlir
The file was modifiedmlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp
Commit 07a1749081bac07515d357fd96165662031de527 by echristo
Remove unused class variable ModuleSlice.
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit b46e2548b67de40acf33b5dde95077698995576f by eschweitz
[flang] Fix fallout from varous changes to the cmake files.

Differential revision: https://reviews.llvm.org/D82050
The file was removedflang/lib/Optimizer/Dialect/CMakeLists.txt
The file was removedflang/lib/Optimizer/Support/CMakeLists.txt
The file was modifiedflang/lib/Lower/CMakeLists.txt
The file was modifiedflang/tools/tco/CMakeLists.txt
The file was modifiedflang/lib/Optimizer/CMakeLists.txt
The file was modifiedflang/unittests/Optimizer/CMakeLists.txt
Commit a8dad3038816cdc664c1265c65429f7aac109362 by echristo
Revert "Remove unused class variable ModuleSlice." as it was
used in debug only code.

This reverts commit 07a1749081bac07515d357fd96165662031de527.
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit 771b7886872ec9f70b233554921c8e994e711cea by antiagainst
[MLIR][SPIRVToLLVM] Support cast ops, some logical ops, UModOp

Added support of simple logical ops: `LogicalAnd`, `LogicalOr`,
`LogicalEqual` and `LogicalNotEqual`. Added a missing conversion
for `UMod` op.

Also, implemented SPIR-V cast ops conversion. There are 4 simple
case where there is a clear equivalent in LLVM (e.g. `ConvertFToS`
is `fptosi`). For `FConvert`, `SConvert` and `UConvert` we
distinguish between truncation and extension based on the bit
width of the operand.

Differential Revision: https://reviews.llvm.org/D81812
The file was addedmlir/test/Conversion/SPIRVToLLVM/logical-to-llvm.mlir
The file was modifiedmlir/test/Conversion/SPIRVToLLVM/arithmetic-ops-to-llvm.mlir
The file was modifiedmlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
The file was addedmlir/test/Conversion/SPIRVToLLVM/cast-ops-to-llvm.mlir
Commit c7fbe2191b8b9cd64570ed3906d1bed1dd5fff8e by richard
Fix rejects-valid when referencing an implicit operator== from within a
templated class.

When a defaulted operator<=> results in the injection of a defaulted
operator==, that operator== can be named by unqualified name within the
same class, even if the class is templated. To make this work, perform
the transform from defaulted operator<=> to defaulted operator== in the
template definition context instead of the template instantiation
context.

This results in our substituting into a declaration from a context where
we don't have a full list of template arguments (or indeed any), for
which we are now more careful to not spuriously instantiate declarations
that are not dependent on the arguments we're substituting.
The file was modifiedclang/include/clang/AST/DeclBase.h
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp
The file was addedclang/test/SemaTemplate/defaulted.cpp
The file was modifiedclang/include/clang/Sema/Template.h
The file was modifiedclang/lib/Sema/SemaDeclCXX.cpp
The file was modifiedclang/lib/AST/DeclBase.cpp
The file was modifiedclang/test/PCH/cxx2a-defaulted-comparison.cpp
The file was modifiedclang/lib/Sema/SemaDecl.cpp
Commit c851d6cf4a4ab803d01d0059f4659f4f9f4435ea by richard
When performing a substitution into a dependent alias template, mark the
outer levels as retained rather than omitting their arguments.

This better reflects what's going on (we're performing a substitution
while still inside a template). In theory this is also more correct, but
I've not found a testcase where it matters in practice (largely because
we don't allow alias templates to be declared inside a function).
The file was modifiedclang/lib/Sema/SemaTemplate.cpp
Commit 89648eb16d01725457f958e634d16c534b64c42c by yhs
[BPF] fix a bug for BTF pointee type pruning

In BTF, pointee type pruning is used to reduce cluttering
too many unused types into prog BTF. For example,
   struct task_struct {
      ...
      struct mm_struct *mm;
      ...
   }
If bpf program does not access members of "struct mm_struct",
there is no need to bring types for "struct mm_struct" to BTF.

This patch fixed a bug where an incorrect pruning happened.
The test case like below:
    struct t;
    typedef struct t _t;
    struct s1 { _t *c; };
    int test1(struct s1 *arg) { ... }

    struct t { int a; int b; };
    struct s2 { _t c; }
    int test2(struct s2 *arg) { ... }

After processing test1(), among others, BPF backend generates BTF types for
    "struct s1", "_t" and a placeholder for "struct t".
Note that "struct t" is not really generated. If later a direct access
to "struct t" member happened, "struct t" BTF type will be generated
properly.

During processing test2(), when processing member type "_t c",
BPF backend sees type "_t" already generated, so returned.
This caused the problem that "struct t" BTF type is never generated and
eventually causing incorrect type definition for "struct s2".

To fix the issue, during DebugInfo type traversal, even if a
typedef/const/volatile/restrict derived type has been recorded in BTF,
if it is not a type pruning candidate, type traversal of its base type continues.

Differential Revision: https://reviews.llvm.org/D82041
The file was addedllvm/test/CodeGen/BPF/BTF/pruning-const.ll
The file was modifiedllvm/lib/Target/BPF/BTFDebug.cpp
The file was addedllvm/test/CodeGen/BPF/BTF/pruning-typedef.ll
Commit 7c1c2d9775813e8ec3c71b50677cb20b2c71cf7a by mydeveloperday
[clang-format] NFC 3% improvement in the overall clang-formatted status

Update Clang-Formatted Formatted status
The file was modifiedclang/docs/ClangFormattedStatus.rst
Commit ac20150e299a41ade860f432741c1b8557ac8058 by tra
[CUDA] make the test more hermetic

Otherwise the -Werror tests fail if the locally installed CUDA version found by
the driver is newer than 10.1 and produces a warning.
The file was modifiedclang/test/Driver/cuda-simple.cu
Commit 55d53d4f5448db87ab0bec903be94b696c8ed3e8 by 23439402+HazemAbdelhafez
[mlir][spirv] Add MatrixTimesScalar operation

Summary:
- Define the MatrixTimesScalar operation and add roundtrip tests.
- Added a new base class for matrix-specific operations to avoid invalid operands type mismatch check.
- Created a separate Matrix arithmetic operations td file to add more operations in the future.
- Augmented the automatically generated verify method to print more fine-grained error messages.
- Made minor Updates to the matrix type tests.

Reviewers: antiagainst, rriddle, mravishankar

Reviewed By: antiagainst

Subscribers: mehdi_amini, jpienaar, shauheen, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, bader, grosul1, frgossen, Kayjukh, jurahul, msifontes

Tags: #mlir

Differential Revision: https://reviews.llvm.org/D81677
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was addedmlir/test/Dialect/SPIRV/matrix-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/matrix.mlir
The file was addedmlir/include/mlir/Dialect/SPIRV/SPIRVMatrixOps.td
Commit f4ef77cbb48b549211ecc18085f14ec7a17c01fc by riddleriver
[mlir][Inliner] Properly handle callgraph node deletion

We previously weren't properly updating the SCC iterator when nodes were removed, leading to asan failures in certain situations. This commit adds a CallGraphSCC class and defers operation deletion until inlining has finished.

Differential Revision: https://reviews.llvm.org/D81984
The file was modifiedmlir/test/Transforms/inlining-dce.mlir
The file was modifiedmlir/test/lib/Dialect/Test/TestDialect.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestOps.td
The file was modifiedmlir/lib/Transforms/Inliner.cpp
Commit 3d627d6ff9be386ed32b3858a901773221f55761 by pklausler
[flang] More Fortran runtime support for CHARACTER operations

Summary:
- Remove C++ library dependence from lock.h
- Implement LEN_TRIM, REPEAT, ADJUSTL, ADJUSTR, MAX/MIN
  intrinsic functions for CHARACTER

Reviewers: tskeith, PeteSteinfeld, sscalpone, schweitz, DavidTruby

Reviewed By: PeteSteinfeld

Subscribers: llvm-commits, flang-commits

Tags: #flang, #llvm

Differential Revision: https://reviews.llvm.org/D82054
The file was modifiedflang/runtime/type-code.cpp
The file was modifiedflang/runtime/type-code.h
The file was modifiedflang/runtime/character.h
The file was modifiedflang/unittests/Evaluate/reshape.cpp
The file was modifiedflang/runtime/transformational.cpp
The file was modifiedflang/runtime/ISO_Fortran_binding.cpp
The file was modifiedflang/runtime/character.cpp
The file was modifiedflang/runtime/descriptor.cpp
The file was modifiedflang/runtime/descriptor.h
The file was modifiedflang/runtime/lock.h
The file was modifiedflang/include/flang/ISO_Fortran_binding.h
Commit 55b6f68f4b254bd1506ff844fa511b6658607992 by richard
Revert "Fix rejects-valid when referencing an implicit operator== from within a"

This change may have caused some self-host failures. Reverting while
investigating.

This reverts commit c7fbe2191b8b9cd64570ed3906d1bed1dd5fff8e.
The file was modifiedclang/include/clang/AST/DeclBase.h
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp
The file was removedclang/test/SemaTemplate/defaulted.cpp
The file was modifiedclang/include/clang/Sema/Template.h
The file was modifiedclang/lib/Sema/SemaDeclCXX.cpp
The file was modifiedclang/lib/AST/DeclBase.cpp
The file was modifiedclang/test/PCH/cxx2a-defaulted-comparison.cpp
Commit 973cfa9ef5cb32b859744e5435df049bf3999915 by richard
Revert "When performing a substitution into a dependent alias template, mark the"

This change depends on reverted change c7fbe2191b8b9cd64570ed3906d1bed1dd5fff8e.

This reverts commit c851d6cf4a4ab803d01d0059f4659f4f9f4435ea.
The file was modifiedclang/lib/Sema/SemaTemplate.cpp
Commit 5f5f566b265db00f577ead268400d99f34ba9cdd by Matthew.Arsenault
AMDGPU: Don't use 16-bit FP inline constants in integer operands

It seems to be a hardware defect that the half inline constants do not
work as expected for the 16-bit integer operations (the inverse does
work correctly). Experimentation seems to show these are really
reading the 32-bit inline constants, which can be observed by writing
inline asm using op_sel to see what's in the high half of the
constant. Theoretically we could fold the high halves of the 32-bit
constants using op_sel.

The *_asm_all.s MC tests are broken, and I don't know where the script
to autogenerate these are. I started manually fixing it, but there's
just too many cases to fix. This also does break the
assembler/disassembler support for these values, and I'm not sure what
to do about it. These are still valid encodings, so it seems like you
should be able to use them in some way. If you wrote assembly using
them, you could have really meant it (perhaps to read the high bits
with op_sel?). The disassembler will print the invalid literal
constant which will fail to re-assemble. The behavior is also
different depending on the use context. Consider this example, which
was previously accepted and encoded using the inline constant:

  v_mad_i16 v5, v1, -4.0, v3
  ; encoding: [0x05,0x00,0xec,0xd1,0x01,0xef,0x0d,0x04]

In contexts where an inline immediate is required (such as on gfx8/9),
this will now be rejected. For gfx10, this will produce the literal
encoding and change the printed format:
  v_mad_i16 v5, v1, 0xc400, v3
  ; encoding: [0x05,0x00,0x5e,0xd7,0x01,0xff,0x0d,0x04,0x00,0xc4,0x00,0x00]

This is just another variation of the issue that we don't perfectly
handle round trip assembly/disassembly due to not tracking how
immediates were encoded. This doesn't matter much in practice, since
compilers don't emit the suboptimal encoding. I doubt any users are
relying on this behavior (although I did make use of the old behavior
to figure out what was wrong).

Fixes bug 46302.
The file was modifiedllvm/test/MC/Disassembler/AMDGPU/gfx8_dasm_all.txt
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.td
The file was modifiedllvm/test/CodeGen/AMDGPU/imm16.ll
The file was modifiedllvm/test/MC/AMDGPU/gfx8_asm_all.s
The file was modifiedllvm/test/MC/AMDGPU/vop3.s
The file was modifiedllvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
The file was modifiedllvm/test/MC/AMDGPU/gfx9_asm_all.s
The file was addedllvm/test/MC/AMDGPU/vop3-gfx10.s
The file was modifiedllvm/test/MC/AMDGPU/vop_sdwa.s
The file was modifiedllvm/test/MC/Disassembler/AMDGPU/gfx10_dasm_all.txt
The file was modifiedllvm/test/MC/AMDGPU/literalv216-err.s
The file was modifiedllvm/test/MC/Disassembler/AMDGPU/literalv216_gfx10.txt
The file was modifiedllvm/test/CodeGen/AMDGPU/shrink-add-sub-constant.ll
The file was addedllvm/test/MC/AMDGPU/gfx9-asm-err.s
The file was modifiedllvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h
The file was modifiedllvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
The file was modifiedllvm/test/MC/AMDGPU/gfx10_asm_all.s
The file was modifiedllvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
The file was modifiedllvm/test/MC/AMDGPU/vop3-gfx9.s
The file was modifiedllvm/lib/Target/AMDGPU/VOP2Instructions.td
The file was modifiedllvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
The file was modifiedllvm/test/MC/Disassembler/AMDGPU/vop3_gfx9.txt
The file was modifiedllvm/test/MC/Disassembler/AMDGPU/gfx9_dasm_all.txt
The file was modifiedllvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/immv216.ll
Commit 6c4ce202267ee089e611b7bee1dc4f3eb07ba23d by rprichard
[Driver] Search computed sysroot for libc++ header paths

Summary:
The Android NDK's clang driver is used with an Android -target setting,
and the driver automatically finds the Android sysroot at a path
relative to the driver. The sysroot has the libc++ headers in it.

Remove Hurd::computeSysRoot as it is equivalent to the new
ToolChain::computeSysRoot method.

Fixes PR46213.

Reviewers: srhines, danalbert, #libc, kristina

Reviewed By: srhines, danalbert

Subscribers: ldionne, sthibaul, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81622
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp
The file was modifiedclang/lib/Driver/ToolChains/Linux.h
The file was modifiedclang/lib/Driver/ToolChains/Hurd.cpp
The file was modifiedclang/lib/Driver/ToolChains/MSP430.h
The file was modifiedclang/lib/Driver/ToolChain.cpp
The file was modifiedclang/include/clang/Driver/ToolChain.h
The file was modifiedclang/lib/Driver/ToolChains/Hurd.h
The file was modifiedclang/lib/Driver/ToolChains/RISCVToolchain.h
Commit 7ee758d691b2afc2f130ba3a8f8507fb6415f1d9 by sbc
[WebAssembly] MC: Fix for data aliases with offsets (getelementptr)

For some reason we hadn't seen such cases in the wild which makes
me think that clang and rustc don't generate these.  In the bug which
reproduces it only occurs with LTO so my guess is that some LTO pass
is creating this alias + gep.

See: https://github.com/emscripten-core/emscripten/issues/8731

Differential Revision: https://reviews.llvm.org/D79462
The file was addedllvm/test/CodeGen/WebAssembly/aliases.ll
The file was addedllvm/test/MC/WebAssembly/alias.s
The file was modifiedllvm/lib/MC/WasmObjectWriter.cpp
The file was addedllvm/test/MC/WebAssembly/offset.s
Commit 49279ca160183c1567e2637f88f3e92eb458c3e7 by maskray
[ELF] Improve --export-dynamic-symbol performance by checking whether wildcard is really used

A hasWildcard pattern iterates over symVector, which can be slow when there
are many --export-dynamic-symbol. In optimistic cases, most patterns don't use
a wildcard character. hasWildcard: false can avoid a symbol table iteration.

While here, add two tests using `[` and `?`, respectively.
The file was modifiedlld/ELF/ScriptParser.cpp
The file was modifiedlld/test/ELF/export-dynamic-symbol.s
The file was modifiedlld/ELF/Driver.cpp
The file was modifiedlld/ELF/ScriptParser.h
Commit ad6024e29fe7a48c5182bb1ce3a410d4b12f7850 by esme.yi
[PowerPC] Custom lower rotl v1i128 to vector_shuffle.

Summary: A bug is reported in bugzilla-45628, where the swap_with_shift case can’t be matched to a single HW instruction xxswapd as expected.
In fact the case matches the idiom of rotate. We have MatchRotate to handle an ‘or’ of two operands and generate a rot[lr] if the case matches the idiom of rotate. While PPC doesn’t support ROTL v1i128. We can custom lower ROTL v1i128 to the vector_shuffle. The vector_shuffle will be matched to a single HW instruction during the phase of instruction selection.

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D81076
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.h
The file was modifiedllvm/test/CodeGen/PowerPC/pr45628.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
Commit 1f391afbf44e5b9e8d96bf8b92dbbc575e4ef0af by Xing
[ObjectYAML][ELF] Add support for emitting the .debug_abbrev section.

This patch enables yaml2elf emit the .debug_abbrev section.

The generated .debug_abbrev is verified using `llvm-dwarfdump`.

Known issues that will be addressed later:
- Current implementation doesn't support generating multiple abbreviation tables in one .debug_abbrev section.

Reviewed By: jhenderson, grimar

Differential Revision: https://reviews.llvm.org/D81820
The file was addedllvm/test/tools/yaml2obj/ELF/DWARF/debug-abbrev.yaml
The file was modifiedllvm/lib/ObjectYAML/DWARFYAML.cpp
The file was modifiedllvm/lib/ObjectYAML/ELFEmitter.cpp
Commit 58e19d465a13b4ada2f7f3ea0252601dc700b777 by shkzhang
[PowerPC] Don't convert Loop to CTR Loop for fp128 BinaryOperator

Summary:
For PPC BinaryOperator of fp128 will become libcall, we shouldn't
convert loop to CTR loop if the loop contain libCall.

But currently, in the PPCTTIImpl::mightUseCTR() function, we only deal
with BinaryOperator for ppc_fp128, don't deal with the fp128.

Reviewed By: shchenz

Differential Revision: https://reviews.llvm.org/D81353
The file was modifiedllvm/test/CodeGen/PowerPC/ctrloop-fp128.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
Commit 77b79d79c05f2431b77be48d35437741eb39cdae by joker.eph
Remove "unused" member ModuleSlice from `struct OpenMPOpt`

This is fixing warning from clang:

warning: private field 'ModuleSlice' is not used [-Wunused-private-field]
  SmallPtrSetImpl<Function *> &ModuleSlice;
                               ^

Differential Revision: https://reviews.llvm.org/D82027
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit 2f4cfa3c7adda3f77d1773c80940cb4118c75c1e by jezng
[lld-macho] Avoid explicit -arch in tests by defaulting to x86-64

Summary:
As mentioned in https://reviews.llvm.org/D81326#2093931, I'm not sure it
makes sense to use the default target triple to determine -arch.
Long-term we should probably detect it from the input object files, but
in the meantime it would be nice not to have to add it to all our tests
by using a convenient default.

Reviewers: #lld-macho

Subscribers: arphaman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81983
The file was modifiedlld/test/MachO/static-link.s
The file was modifiedlld/test/MachO/invalid/duplicate-symbol.s
The file was modifiedlld/test/MachO/invalid/stub-link.s
The file was modifiedlld/test/MachO/invalid/order-file-bad-arch.test
The file was modifiedlld/test/MachO/invalid/invalid-relocation-length.yaml
The file was modifiedlld/test/MachO/arch.s
The file was modifiedlld/test/MachO/invalid/no-such-file.s
The file was modifiedlld/test/MachO/fat-arch.s
The file was modifiedlld/test/MachO/invalid/bad-archive.s
The file was modifiedlld/test/MachO/invalid/invalid-fat-offset.s
The file was modifiedlld/test/MachO/archive.s
The file was modifiedlld/test/MachO/invalid/invalid-relocation-pcrel.yaml
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/test/MachO/platform-version.test
The file was modifiedlld/test/MachO/x86-64-reloc-signed.s
The file was modifiedlld/test/MachO/dylink.s
The file was modifiedlld/test/MachO/link-search-order.s
The file was modifiedlld/test/MachO/resolution.s
The file was modifiedlld/test/MachO/invalid/missing-dylib.s
The file was modifiedlld/test/MachO/section-headers.s
The file was modifiedlld/test/MachO/order-file.s
The file was modifiedlld/test/MachO/x86-64-reloc-unsigned.s
The file was modifiedlld/test/MachO/invalid/archive-no-index.s
The file was modifiedlld/test/MachO/invalid/alignment-too-large.yaml
The file was modifiedlld/test/MachO/sub-library.s
The file was modifiedlld/test/MachO/load-commands.s
The file was modifiedlld/test/MachO/section-merge.s
The file was modifiedlld/test/MachO/stub-link.s
The file was modifiedlld/test/MachO/subsections-section-relocs.s
The file was modifiedlld/test/MachO/search-paths.test
The file was modifiedlld/test/MachO/subsections-symbol-relocs.s
The file was modifiedlld/test/MachO/invalid/order-file-bad-objfile.test
The file was modifiedlld/test/MachO/invalid/invalid-executable.s
The file was modifiedlld/test/MachO/invalid/invalid-fat-narch.s
The file was modifiedlld/test/MachO/symtab.s
The file was modifiedlld/test/MachO/dylink-lazy.s
The file was modifiedlld/test/MachO/entry-symbol.s
The file was modifiedlld/test/MachO/segments.s
The file was modifiedlld/test/MachO/no-exports-dylib.s
The file was modifiedlld/test/MachO/dylib.s
The file was modifiedlld/test/MachO/relocations.s
The file was modifiedlld/test/MachO/export-trie.s
The file was modifiedlld/test/MachO/symbol-order.s
The file was modifiedlld/test/MachO/silent-ignore.test
The file was modifiedlld/test/MachO/invalid/no-id-dylink.yaml
The file was modifiedlld/test/MachO/invalid/undefined-symbol.s
Commit fcde378dcbdf2447e543d75d012bebae91a3d0c6 by jezng
[lld-macho] Support non-pcrel section relocs

Summary: Depends on D80854.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80855
The file was modifiedlld/test/MachO/relocations.s
The file was modifiedlld/MachO/InputFiles.cpp
Commit c3d98ea89fa4807f06121ec186c00fa18593bfd0 by jezng
[lld-macho] Support X86_64_RELOC_GOT

Summary:
As far as I can tell, it's identical to _GOT_LOAD. llvm-mc has the following
comment explaining why _GOT exists:

```
// x86_64 distinguishes movq foo@GOTPCREL so that the linker can
// rewrite the movq to an leaq at link time if the symbol ends up in
// the same linkage unit.
```

Depends on D80855.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Reviewed By: MaskRay, smeenai

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80856
The file was modifiedlld/test/MachO/dylink.s
The file was modifiedlld/MachO/Arch/X86_64.cpp
Commit a12e7d406de2c31633414e5c73881869c930d194 by jezng
[lld-macho] Handle GOT relocations of non-dylib symbols

Summary:
Turns out this case is actually really common -- it happens whenever there's
a reference to an `extern` variable that ends up statically linked.

Depends on D80856.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Reviewed By: smeenai

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80857
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/MachO/Arch/X86_64.cpp
The file was modifiedlld/MachO/Symbols.h
The file was modifiedlld/MachO/Target.h
The file was addedlld/test/MachO/local-got.s
The file was modifiedlld/MachO/SyntheticSections.h
The file was modifiedlld/MachO/InputSection.cpp
The file was modifiedlld/MachO/Writer.cpp
Commit 74871cdad729aa5a5f39804214e5872f8e418d8e by jezng
[lld-macho] Ensure __bss sections we output have file offset of zero

Summary:
llvm-mc emits `__bss` sections with an offset of zero, but we weren't expecting
that in our input, so we were copying non-zero data from the start of the file and
putting it in `__bss`, with obviously undesirable runtime results. (It appears that
the kernel will copy those nonzero bytes as long as the offset is nonzero, regardless
of whether S_ZERO_FILL is set.)

I debated on whether to make a special ZeroFillSection -- separate from a
regular InputSection -- but it seemed like too much work for now. But I'm happy
to refactor if anyone feels strongly about having it as a separate class.

Depends on D80857.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Reviewed By: smeenai

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80859
The file was modifiedlld/MachO/InputSection.cpp
The file was addedlld/test/MachO/bss.s
The file was modifiedlld/MachO/InputFiles.cpp
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/MachO/InputSection.h
The file was modifiedlld/MachO/SyntheticSections.cpp
Commit 525c7d8cda72c00c85de4989bcddefd4fb9a14a1 by jezng
[lld-macho] Handle alignment correctly when merging InputSections

Summary:
Previously, we weren't updating isecAddr when aligning InputSections,
resulting in truncated sections under the right conditions.

Reviewers: #lld-macho, compnerd

Reviewed By: #lld-macho, compnerd

Subscribers: smeenai, compnerd, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81298
The file was modifiedlld/MachO/MergedOutputSection.cpp
The file was modifiedlld/test/MachO/section-merge.s
Commit d50f44a2f771b0872f6555cc3023cc5e9cfacabd by jezng
[lld-macho] Handle framework search path, alongside library search path

Summary:
Add front-end support for `lld::macho::Configuration::frameworkSearchPath`.

Depends on D80582.

Reviewers: ruiu, pcc, MaskRay, smeenai, int3, Ktwu, alexshap, christylee

Reviewed By: int3

Subscribers: ormris, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80677
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/test/MachO/search-paths.test
The file was modifiedlld/MachO/Config.h
Commit f7453a97cefa612e0cba5984d74da10b3b3da177 by jezng
[lld-macho] Add missing search-paths-darwin.test

Summary: Forgot to `git add` it when patching D80677
The file was addedlld/test/MachO/search-paths-darwin.test
Commit 3d316eb06d91cd859f5da51715bab7ee3cae8bf0 by jurahul
[MLIR] Move SymbolOpInterface::isPublic() and friends to SymbolOpInterface Trait.

- This will allow calling these functions from Op's that support this interface (like FuncOp) directly:

```
FuncOp func = ...
func.isPrivate()
```

Differential Revision: https://reviews.llvm.org/D82060
The file was modifiedmlir/include/mlir/IR/SymbolInterfaces.td
Commit d261a1c0e0e5962ec1a42841692b47aca655e3a0 by Xing
[DWARFYAML][debug_abbrev] Make the abbreviation code optional.

This patch helps make the `Code` optional in abbreviations table.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D81826
The file was modifiedllvm/test/ObjectYAML/MachO/DWARF-LittleEndian.yaml
The file was modifiedllvm/test/ObjectYAML/MachO/DWARF5-abbrevValues.yaml
The file was modifiedllvm/include/llvm/ObjectYAML/DWARFYAML.h
The file was modifiedllvm/test/tools/yaml2obj/ELF/DWARF/debug-abbrev.yaml
The file was modifiedllvm/lib/ObjectYAML/DWARFYAML.cpp
The file was modifiedllvm/test/ObjectYAML/MachO/DWARF-debug_abbrev.yaml
The file was modifiedllvm/test/ObjectYAML/MachO/DWARF-BigEndian.yaml
The file was modifiedllvm/lib/ObjectYAML/DWARFEmitter.cpp
Commit 819948c44331c53ecc0bb1998ba1daae5c2d7275 by mkazantsev
[Test] Add more tests showing missing opportunities in Select instcombine
The file was modifiedllvm/test/Transforms/InstCombine/select.ll
Commit 3f0cc96a9694e499968544ebda6903982eaeb8a4 by kristof.beyls
[AArch64] SLSHardening: compute correct thunk name for X29.

The enum values for AArch64 registers are not all consecutive.
Therefore, the computation
  "__llvm_slsblr_thunk_x" + utostr(Reg - AArch64::X0)
is not always correct. utostr(Reg - AArch64::X0) will not generate the
expected string for the registers that do not have consecutive values in
the enum.
This happened to work for most registers, but does not for AArch64::FP
(i.e. register X29).
This can get triggered when the X29 is not used as a frame pointer.

Differential Revision: https://reviews.llvm.org/D81997
The file was modifiedllvm/lib/Target/AArch64/AArch64SLSHardening.cpp
The file was modifiedllvm/test/CodeGen/AArch64/speculation-hardening-sls.ll
Commit 832cfc767246442969c0805fd310a5297c3dbede by kristof.beyls
[IndirectThunks] Make generated MF structure as expected by all instruction selectors.

This also enables running the AArch64 SLSHardening pass with GlobalISel,
so add a test for that.

Differential Revision: https://reviews.llvm.org/D81403
The file was modifiedllvm/include/llvm/CodeGen/IndirectThunks.h
The file was modifiedllvm/lib/Target/X86/X86IndirectThunks.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64SLSHardening.cpp
The file was modifiedllvm/test/CodeGen/AArch64/speculation-hardening-sls.ll
Commit f7455da2633d14f1ce76aaa7c73ea682ac51ac37 by kristof.beyls
[IndirectThunks] Tiny comment fix
The file was modifiedllvm/include/llvm/CodeGen/IndirectThunks.h
Commit f1fa3b7f6ee958ec4dfb7104bd0ae64ec0061551 by jperier
[flang] AMAX0, MIN1... rewrite to MAX/MIN: make result conversion explicit

Summary:
This patch changes speficic extremum functions rewrite to generic MIN/MAX.
It applies to AMAX0, AMIN0, AMAX1, AMIN1, MAX0, MIN0, MAX1, MIN1, DMAX1,
and DMIN1.

- Do not re-write specific extremums to MAX/MIN in intrinsic Probe and let
folding rewrite it and introduc the conversion on the MIN/MAX result.
- Also make operand promotion explicit in MIN/MAX folding.

For instance, after this patch:
AMAX0(int8, int4) is rewritten to REAL(MAX(int8, INT(int4, 8)))

All this care is to avoid rewritting it to MAX(REAL(int8), REAL(int4))
that may not always be numerically equivalent to the first rewrite.

Reviewers: klausler, schweitz, sscalpone, jdoerfert, DavidTruby

Reviewed By: klausler, schweitz

Subscribers: llvm-commits, flang-commits

Tags: #flang, #llvm

Differential Revision: https://reviews.llvm.org/D81940
The file was modifiedflang/test/Evaluate/folding04.f90
The file was modifiedflang/lib/Evaluate/intrinsics.cpp
The file was modifiedflang/lib/Evaluate/fold-integer.cpp
The file was modifiedflang/lib/Evaluate/fold-implementation.h
The file was modifiedflang/lib/Evaluate/fold-real.cpp
Commit 910689f0aa7207cd902716e0e32d243346a670e8 by hokein.wu
[AST] Move the "fallback to recovery expr" mechanism to CorrectDelayedTyposInExpr, NFC

Summary: Also delete two overloads, which don't seem necessary.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82047
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/lib/Sema/SemaStmt.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was modifiedclang/lib/Parse/ParseDeclCXX.cpp