[all-commits] [llvm/llvm-project] 0288d0: [LoongArch] Avoid scheduling relaxable code sequen...

ZhaoQi via All-commits all-commits at lists.llvm.org
Sun Jan 19 18:00:26 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0288d065eecb1208971dc4cdcc71731e34c6fca0
      https://github.com/llvm/llvm-project/commit/0288d065eecb1208971dc4cdcc71731e34c6fca0
  Author: ZhaoQi <zhaoqi01 at loongson.cn>
  Date:   2025-01-20 (Mon, 20 Jan 2025)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp
    M llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp
    M llvm/lib/Target/LoongArch/LoongArchInstrInfo.h
    M llvm/lib/Target/LoongArch/LoongArchMCInstLower.cpp
    M llvm/lib/Target/LoongArch/LoongArchMergeBaseOffset.cpp
    M llvm/lib/Target/LoongArch/LoongArchTargetMachine.cpp
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.h
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp
    A llvm/test/CodeGen/LoongArch/linker-relaxation.ll
    A llvm/test/CodeGen/LoongArch/mir-relax-flags.ll
    M llvm/test/CodeGen/LoongArch/mir-target-flags.ll

  Log Message:
  -----------
  [LoongArch] Avoid scheduling relaxable code sequence and attach relax relocs (#121330)

If linker relaxation enabled, relaxable code sequence expanded from
pseudos should avoid being separated by instruction scheduling. This
commit tags scheduling boundary for them to avoid being scheduled.
(Except for `tls_le/tls_ie` and `call36/tail36`. Because `tls_le/tls_ie`
can be scheduled and have no influence to relax, `call36/tail36` are
expanded later in `LoongArchExpandPseudo` pass.)

A new mask target-flag is added to attach relax relocs to the relaxable
code sequence. (No need to add it for `tls_le` and `call36/tail36`
because we can simply add relax relocs for them according to their
relocs. But for other code sequence, such as `PCALA_{HI20/LO12}`, we
must use the mask flag, mainly because relax should not be added when
code model is large.)

Because of the new mask target-flag, get "direct" flags is necessary
when using their target-flags. In addition, code sequence after being
optimized by `MergeBaseOffset` pass may not relaxable any more, so the
relax "bitmask" flag should be removed.



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