[all-commits] [llvm/llvm-project] 647aff: [ARM] Restructure MOVi32imm expansion to not do po...

john-brawn-arm via All-commits all-commits at lists.llvm.org
Wed Jul 12 03:49:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 647aff28558b6b1379f0892138059b403192512a
      https://github.com/llvm/llvm-project/commit/647aff28558b6b1379f0892138059b403192512a
  Author: John Brawn <john.brawn at arm.com>
  Date:   2023-07-12 (Wed, 12 Jul 2023)

  Changed paths:
    M llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
    M llvm/test/CodeGen/ARM/execute-only-big-stack-frame.ll
    M llvm/test/CodeGen/ARM/execute-only.ll
    M llvm/test/CodeGen/ARM/large-stack.ll
    M llvm/test/CodeGen/Thumb2/segmented-stacks.ll

  Log Message:
  -----------
  [ARM] Restructure MOVi32imm expansion to not do pointless instructions

The expansion of the various MOVi32imm pseudo-instructions works by
splitting the operand into components (either halfwords or bytes) and
emitting instructions to combine those components into the final
result. When the operand is an immediate with some components being
zero this can result in pointless instructions that just add zero.

Avoid this by restructuring things so that a separate function handles
splitting the operand into components, then don't emit the component
if it is a zero immediate. This is straightforward for movw/movt,
where we just don't emit the movt if it's zero, but the thumb1
expansion using mov/add/lsl is more complex, as even when we don't
emit a given byte we still need to get the shift correct.

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


  Commit: 210f61cbddeddac47b347db072d674ee142520f6
      https://github.com/llvm/llvm-project/commit/210f61cbddeddac47b347db072d674ee142520f6
  Author: John Brawn <john.brawn at arm.com>
  Date:   2023-07-12 (Wed, 12 Jul 2023)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/test/CodeGen/ARM/execute-only.ll

  Log Message:
  -----------
  [ARM] Correctly handle execute-only in EmitStructByval

Currently when compiling for an execute-only target without movt then
EmitStructByval will generate a constant pool load which isn't
compatible with execute-only. Handle this by emitting tMOVi32imm,
and also simplify the existing movt handling by emitting t2MOVi32imm
or MOVi32imm.

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


Compare: https://github.com/llvm/llvm-project/compare/31dda3913f9d...210f61cbdded


More information about the All-commits mailing list