[PATCH] D68530: [AArch64] Don't combine callee-save and local stack adjustment when optimizing for size

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 30 05:37:17 PST 2019


hans added a comment.

In D68530#1764286 <https://reviews.llvm.org/D68530#1764286>, @dmgreen wrote:

> Oh boo. This is presumably some knock-on bug, that this is just exposing. Only on windows you say?
>
> Do you have a reproducer?


Here's a short repro:

  $ cat /tmp/a.cc
  template <typename T> void foo(T t);
  struct S {
    virtual bool bar();
  };
  void baz() { foo(&S::bar); }
  $ bin/clang -cc1 -triple arm64-unknown-windows-msvc19.16.0 -emit-obj -Os /tmp/a.cc
  clang: /work/llvm.monorepo/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:706: MachineBasicBlock::iterator convertCalleeSaveRestoreToSPPrePostIncDec(llvm::MachineBasicBlock &, MachineBasicBlock::iterator, const llvm::DebugLoc &, const llvm::TargetInstrInfo *, int, bool, bool *, bool): Assertion `MBBI->getOperand(OpndIdx - 1).getReg() == AArch64::SP && "Unexpected base register in callee-save save/restore instruction!"' failed.

I've reverted in c2443155a0f <https://reviews.llvm.org/rGc2443155a0fb245c8f17f2c1c72b6ea391e86e81> to unbreak the builds while this gets investigated.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68530/new/

https://reviews.llvm.org/D68530





More information about the llvm-commits mailing list