[all-commits] [llvm/llvm-project] cd3486: [lld-macho] Implement ObjC category merging (-objc...

Vitaly Buka via All-commits all-commits at lists.llvm.org
Wed Mar 20 14:19:42 PDT 2024


  Branch: refs/heads/users/vitalybuka/spr/ir-introduce-llvmexperimentalhot
  Home:   https://github.com/llvm/llvm-project
  Commit: cd34860705607ba804e20753f3ef4f2d4392df57
      https://github.com/llvm/llvm-project/commit/cd34860705607ba804e20753f3ef4f2d4392df57
  Author: alx32 <103613512+alx32 at users.noreply.github.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/MachO/InputSection.h
    M lld/MachO/ObjC.cpp
    M lld/MachO/ObjC.h
    M lld/MachO/Options.td
    A lld/test/MachO/objc-category-merging-complete-test.s
    A lld/test/MachO/objc-category-merging-extern-class-minimal.s

  Log Message:
  -----------
  [lld-macho] Implement ObjC category merging (-objc_category_merging) (#85727)

This change adds a flag to lld to enable category merging for MachoO +
ObjC.
It adds the '-objc_category_merging' flag for enabling this option and
uses the existing '-no_objc_category_merging' flag for disabling it.
In ld64, this optimization is enabled by default, but in lld, for now,
we require explicitly passing the '-objc_category_merging' flag in order
to enable it.

Behavior: if in the same link unit, multiple categories are extending
the same class, then they get merged into a single category.
Ex: Cat1(method1+method2,protocol1) + Cat2(method3+method4,protocol2,
property1) = Cat1_2(method1+method2+method3+method4,
protocol1+protocol2, property1)

Notes on implementation decisions made in this diff:

There is a possibility to further improve the current implementation by
directly merging the category data into the base class (if the base
class is present in the link unit) - this improvement may be done as a
follow-up. This improved functionality is already present in ld64.
We do the merging on the raw inputSections - after dead-stripping
(categories can't be dead stripped anyway).
The changes are mostly self-contained to ObjC.cpp, except for adding a
new flag (linkerOptimizeReason) to ConcatInputSection and StringPiece to
mark that this data has been optimized away. Another way to do it would
have been to just mark the pieces as not 'live' but this would cause the
old symbols to show up in the linker map as being dead-stripped - even
if dead-stripping is disabled. This flag allows us to match the ld64
behavior.

Note: This is a re-land of
https://github.com/llvm/llvm-project/pull/82928 after fixing using
already freed memory in `generatedSectionData`. This issue was detected
by ASAN build.

---------

Co-authored-by: Alex B <alexborcan at meta.com>


  Commit: 4242d15e68580d1d1f7c4d782a59e6dffb698ca8
      https://github.com/llvm/llvm-project/commit/4242d15e68580d1d1f7c4d782a59e6dffb698ca8
  Author: Valentin Clement (バレンタイン クレメン) <clementval at gmail.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/test/Lower/CUDA/cuda-kernel-calls.cuf

  Log Message:
  -----------
  [flang][cuda] Update syntax of fir.cuda_kernel_launch to match fir.call (#85814)

`fir.cuda_kernel_launch` represents a call to a cuda kernel with the
chervon syntax. Its assembly format is meant to match `fir.call`. This
patch updates the format to match the syntax closer for args and their
types.


  Commit: 12a6546395c6225112731f33608afed452c4f8d1
      https://github.com/llvm/llvm-project/commit/12a6546395c6225112731f33608afed452c4f8d1
  Author: Evan Wilde <etceterawilde at gmail.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/test/Preprocessor/sysroot-prefix.c

  Log Message:
  -----------
  Add support for sysroot-relative system header search paths (#82084)

Clang supported header searchpaths of the form `-I =/path`, relative to
the sysroot if one is passed, but did not implement that behavior for
`-iquote`, `-isystem`, or `-idirafter`.

This implements the `=` portion of the behavior implemented by GCC for
these flags described in
https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html.


  Commit: 2377b9773d40d2daa249ac20fe452f041bb6a88c
      https://github.com/llvm/llvm-project/commit/2377b9773d40d2daa249ac20fe452f041bb6a88c
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    A llvm/test/CodeGen/X86/pr85681.ll

  Log Message:
  -----------
  [DAG] SimplifyShift - shift i1/vXi1 X, Y --> X (any non-zero shift amount is undefined).

Alive2: https://alive2.llvm.org/ce/z/SdESbg

Fixes #85681


  Commit: 8cbb8ac02cc481723a0e0c20beab03fdc50accd9
      https://github.com/llvm/llvm-project/commit/8cbb8ac02cc481723a0e0c20beab03fdc50accd9
  Author: Finn Plummer <50529406+inbelic at users.noreply.github.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td
    M mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
    M mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir
    M mlir/test/Dialect/SPIRV/Transforms/canonicalize.mlir

  Log Message:
  -----------
  [mlir][spirv] Add folding for SelectOp (#85430)

Add missing constant propogation folder for spirv.Select

Implement additional folding when both selections are equivalent or the
condition is a constant Scalar/SplatVector.

Allows for constant folding in the IndexToSPIRV pass.

Part of work #70704


  Commit: 5cfcd9bc13ac0f1be519e2e2d69276c82cbba3b9
      https://github.com/llvm/llvm-project/commit/5cfcd9bc13ac0f1be519e2e2d69276c82cbba3b9
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M clang/cmake/caches/Fuchsia-stage2.cmake

  Log Message:
  -----------
  [cmake] Reenable FatLTO for Fuchsia toolchains

We can reenable this now that FatLTO won't be enabled for Mac platforms

Pull Request: https://github.com/llvm/llvm-project/pull/85709


  Commit: e3030f1e1958a2be51822bacce764395c16e682a
      https://github.com/llvm/llvm-project/commit/e3030f1e1958a2be51822bacce764395c16e682a
  Author: Alfie Richards <alfie.richards at arm.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAddressingModes.h
    M llvm/test/MC/ARM/basic-arm-instructions.s

  Log Message:
  -----------
  [ARM] FIX: Fix parsing `pkhtb` with a condition code

This was broken by https://github.com/llvm/llvm-project/pull/83436 as in
optional operands meant when the CC operand is provided the
`parsePKHImm` parser is applied to register operands, which previously
erroneously produced an error.


  Commit: 31f4b329c8234fab9afa59494d7f8bdaeaefeaad
      https://github.com/llvm/llvm-project/commit/31f4b329c8234fab9afa59494d7f8bdaeaefeaad
  Author: quic-areg <aregmi at quicinc.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp
    A clang/test/Driver/hexagon-default-build-attributes.s
    M llvm/include/llvm/BinaryFormat/ELF.h
    M llvm/include/llvm/Object/ELFObjectFile.h
    A llvm/include/llvm/Support/HexagonAttributeParser.h
    A llvm/include/llvm/Support/HexagonAttributes.h
    M llvm/lib/Object/ELF.cpp
    M llvm/lib/Object/ELFObjectFile.cpp
    M llvm/lib/ObjectYAML/ELFYAML.cpp
    M llvm/lib/Support/CMakeLists.txt
    A llvm/lib/Support/HexagonAttributeParser.cpp
    A llvm/lib/Support/HexagonAttributes.cpp
    M llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
    M llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp
    M llvm/lib/Target/Hexagon/HexagonAsmPrinter.h
    M llvm/lib/Target/Hexagon/HexagonTargetStreamer.h
    M llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp
    M llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
    M llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h
    A llvm/test/CodeGen/Hexagon/build-attributes.ll
    A llvm/test/MC/Hexagon/directive-attribute-err.s
    A llvm/test/MC/Hexagon/directive-attribute.s
    A llvm/test/MC/Hexagon/hexagon_attributes.s
    M llvm/test/tools/llvm-readobj/ELF/machine-specific-section-types.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  [Hexagon] ELF attributes for Hexagon (#85359)

Defines a subset of attributes and emits them to a section called
.hexagon.attributes.

The current attributes recorded are the attributes needed by
llvm-objdump to automatically determine target features and eliminate
the need to manually pass features.


  Commit: 73302d3ca4c59db9ddd963d132ba07eb6e2f23e7
      https://github.com/llvm/llvm-project/commit/73302d3ca4c59db9ddd963d132ba07eb6e2f23e7
  Author: LLVM GN Syncbot <llvmgnsyncbot at gmail.com>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn

  Log Message:
  -----------
  [gn build] Port 31f4b329c823


  Commit: 1756a5bdf9f9ddf7dc2589ebc56661a329109729
      https://github.com/llvm/llvm-project/commit/1756a5bdf9f9ddf7dc2589ebc56661a329109729
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-03-20 (Wed, 20 Mar 2024)

  Changed paths:
    M clang/cmake/caches/Fuchsia-stage2.cmake
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    A clang/test/Driver/hexagon-default-build-attributes.s
    M clang/test/Preprocessor/sysroot-prefix.c
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/test/Lower/CUDA/cuda-kernel-calls.cuf
    M lld/MachO/Driver.cpp
    M lld/MachO/InputSection.h
    M lld/MachO/ObjC.cpp
    M lld/MachO/ObjC.h
    M lld/MachO/Options.td
    A lld/test/MachO/objc-category-merging-complete-test.s
    A lld/test/MachO/objc-category-merging-extern-class-minimal.s
    M llvm/docs/LangRef.rst
    M llvm/include/llvm/BinaryFormat/ELF.h
    M llvm/include/llvm/Object/ELFObjectFile.h
    A llvm/include/llvm/Support/HexagonAttributeParser.h
    A llvm/include/llvm/Support/HexagonAttributes.h
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/Object/ELF.cpp
    M llvm/lib/Object/ELFObjectFile.cpp
    M llvm/lib/ObjectYAML/ELFYAML.cpp
    M llvm/lib/Support/CMakeLists.txt
    A llvm/lib/Support/HexagonAttributeParser.cpp
    A llvm/lib/Support/HexagonAttributes.cpp
    M llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAddressingModes.h
    M llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
    M llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp
    M llvm/lib/Target/Hexagon/HexagonAsmPrinter.h
    M llvm/lib/Target/Hexagon/HexagonTargetStreamer.h
    M llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp
    M llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
    M llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h
    A llvm/test/CodeGen/Hexagon/build-attributes.ll
    A llvm/test/CodeGen/X86/pr85681.ll
    M llvm/test/MC/ARM/basic-arm-instructions.s
    A llvm/test/MC/Hexagon/directive-attribute-err.s
    A llvm/test/MC/Hexagon/directive-attribute.s
    A llvm/test/MC/Hexagon/hexagon_attributes.s
    M llvm/test/tools/llvm-readobj/ELF/machine-specific-section-types.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp
    M llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
    M mlir/include/mlir/Dialect/SPIRV/IR/SPIRVLogicalOps.td
    M mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
    M mlir/test/Conversion/SPIRVToLLVM/misc-ops-to-llvm.mlir
    M mlir/test/Dialect/SPIRV/Transforms/canonicalize.mlir

  Log Message:
  -----------
  spelling

Created using spr 1.3.4


Compare: https://github.com/llvm/llvm-project/compare/ff1a904e3c0c...1756a5bdf9f9

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list