[all-commits] [llvm/llvm-project] 6ae3d3: Revert "Reland [AArch64][MachineOutliner] Return a...

ostannard via All-commits all-commits at lists.llvm.org
Wed Dec 11 04:06:27 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6ae3d310bd94a338f2c121b19e7995dc72ca46dc
      https://github.com/llvm/llvm-project/commit/6ae3d310bd94a338f2c121b19e7995dc72ca46dc
  Author: Oliver Stannard <oliver.stannard at linaro.org>
  Date:   2019-12-11 (Wed, 11 Dec 2019)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-cfi.ll
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-diff-scope-same-key.ll
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-non-leaf.ll
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-regsave.mir
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-diff-key.ll
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-same-key-a.ll
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-same-scope-same-key-b.ll
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-subtarget.ll
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-thunk.ll
    R llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-v8-3.ll

  Log Message:
  -----------
  Revert "Reland [AArch64][MachineOutliner] Return address signing for outlined functions"

This reverts commit cec2d5c17457722113580251c8a045fa9aca9b1b.

Reverting because this is still creating outlined functions with return
address signing instructions with mismatches SP values. For example:

  int *volatile v;

  void foo(int x) {
    int a[x];
    v = &a[0];
    v = &a[0];
    v = &a[0];
    v = &a[0];
    v = &a[0];
    v = &a[0];
  }

  void bar(int x) {
    int a[x];
    v = 0;
    v = &a[0];
    v = &a[0];
    v = &a[0];
    v = &a[0];
    v = &a[0];
  }

This generates these two outlined functions, both of which modify SP
between the paciasp and retaa instructions:

  $ clang --target=aarch64-arm-none-eabi -march=armv8.3-a -c test2.c -o - -S -Oz -mbranch-protection=pac-ret+leaf
  ...
  OUTLINED_FUNCTION_0:                    // @OUTLINED_FUNCTION_0
          .cfi_sections .debug_frame
          .cfi_startproc
  // %bb.0:
          paciasp
          .cfi_negate_ra_state
          mov     w8, w0
          lsl     x8, x8, #2
          add     x8, x8, #15             // =15
          mov     x9, sp
          and     x8, x8, #0x7fffffff0
          sub     x8, x9, x8
          mov     x29, sp
          mov     sp, x8
          adrp    x9, v
          retaa
  ...
  OUTLINED_FUNCTION_1:                    // @OUTLINED_FUNCTION_1
          .cfi_startproc
  // %bb.0:
          paciasp
          .cfi_negate_ra_state
          str     x8, [x9, :lo12:v]
          str     x8, [x9, :lo12:v]
          str     x8, [x9, :lo12:v]
          str     x8, [x9, :lo12:v]
          str     x8, [x9, :lo12:v]
          mov     sp, x29
          retaa




More information about the All-commits mailing list