[all-commits] [llvm/llvm-project] b1a5ee: [ARM] Check all terms in emitPopInst when clearing...

Florian Hahn via All-commits all-commits at lists.llvm.org
Wed Dec 20 07:56:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b1a5ee1febd8a903cec3dfdad61d57900dc3823e
      https://github.com/llvm/llvm-project/commit/b1a5ee1febd8a903cec3dfdad61d57900dc3823e
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2023-12-20 (Wed, 20 Dec 2023)

  Changed paths:
    M llvm/lib/Target/ARM/ARMFrameLowering.cpp
    M llvm/lib/Target/ARM/ARMFrameLowering.h
    M llvm/test/CodeGen/Thumb2/outlined-fn-may-clobber-lr-in-caller.ll

  Log Message:
  -----------
  [ARM] Check all terms in emitPopInst when clearing Restored for LR. (#75527)

emitPopInst checks a single function exit MBB. If other paths also exit
the function and any of there terminators uses LR implicitly, it is not
save to clear the Restored bit.

Check all terminators for the function before clearing Restored.

This fixes a mis-compile in outlined-fn-may-clobber-lr-in-caller.ll
where the machine-outliner previously introduced BLs that clobbered LR
which in turn is used by the tail call return.

Alternative to #73553




More information about the All-commits mailing list