[all-commits] [llvm/llvm-project] df8ed3: [ARM] harden-sls-blr: avoid r12 and lr in indirect...

Kristof Beyls via All-commits all-commits at lists.llvm.org
Sat Dec 19 04:48:08 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: df8ed3928377edc6e9241a56680b694ffa9f4d6d
      https://github.com/llvm/llvm-project/commit/df8ed3928377edc6e9241a56680b694ffa9f4d6d
  Author: Kristof Beyls <kristof.beyls at arm.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
    M llvm/lib/Target/ARM/ARMBaseInstrInfo.h
    M llvm/lib/Target/ARM/ARMCallLowering.cpp
    M llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
    M llvm/lib/Target/ARM/ARMFastISel.cpp
    M llvm/lib/Target/ARM/ARMFeatures.h
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/lib/Target/ARM/ARMInstrInfo.td
    M llvm/lib/Target/ARM/ARMInstrThumb.td
    M llvm/lib/Target/ARM/ARMPredicates.td
    M llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp
    M llvm/lib/Target/ARM/ARMRegisterInfo.td
    M llvm/lib/Target/ARM/ARMSLSHardening.cpp
    M llvm/test/CodeGen/ARM/speculation-hardening-sls.ll

  Log Message:
  -----------
  [ARM] harden-sls-blr: avoid r12 and lr in indirect calls.

As a linker is allowed to clobber r12 on function calls, the code
transformation that hardens indirect calls is not correct in case a
linker does so.  Similarly, the transformation is not correct when
register lr is used.

This patch makes sure that r12 or lr are not used for indirect calls
when harden-sls-blr is enabled.

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




More information about the All-commits mailing list