[PATCH] D66935: [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 05:24:23 PDT 2019


sdesmalen updated this revision to Diff 219316.
sdesmalen marked 2 inline comments as done.
sdesmalen added a comment.
Herald added subscribers: atanasyan, sdardis.

Just before committing this patch, I realised that I had not yet tested it for all targets (I did this on a different machine than I normally use, hence the change in config).

This led to a few more unit-test failures and thus some small changes to the patch to fix those:

- Made `getCalleeSaves` return an empty BitVector instead of asserting that `CalleeSavedInfo.isValid()`. The assert broke several tests that ran the LiveDebugValues pass in isolation. The MIR Parser only calls `setCalleeSavedInfoValid(true)` when there is at least one callee-save. So without any callee-saves specified in the MIR file, the assert would otherwise still trigger. It may be worth fixing this in a separate patch by e.g. adding an extra field to the MIR.

Note that most of the tests did not require the callee-saved info for the thing they were testing. For two of them,`test/DebugInfo/MIR/{Mips,X86}/live-debug-values-reg-copy.mir`, it was fixed by letting it `start-before=prologepilog` to populate the callee-saved info.

- Made `getCalleeSaves` a virtual function. D64986 <https://reviews.llvm.org/D64986> introduced a change for the ARM target to mark `R0` as //callee saved// in `determineCalleeSaves` if the parameter passed in `R0` is returned as-is (determined from the `returned` parameter attribute). Given that `R0` is not an actual callee-saved register, the register does not end up in the CalleeSaved list in MachineFrameInfo. By making `getCalleeSaves` a virtual function, the ARM target can still mark `R0` as a preserved register.

@efriedma, are you happy with these changes?


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

https://reviews.llvm.org/D66935

Files:
  llvm/include/llvm/CodeGen/TargetFrameLowering.h
  llvm/lib/CodeGen/LiveDebugValues.cpp
  llvm/lib/CodeGen/RegUsageInfoCollector.cpp
  llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp
  llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
  llvm/lib/Target/ARM/ARMFrameLowering.cpp
  llvm/lib/Target/ARM/ARMFrameLowering.h
  llvm/test/CodeGen/AArch64/wrong-callee-save-size-after-livedebugvariables.mir
  llvm/test/DebugInfo/MIR/Mips/live-debug-values-reg-copy.mir
  llvm/test/DebugInfo/MIR/X86/live-debug-values-reg-copy.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66935.219316.patch
Type: text/x-patch
Size: 12025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190909/4a918f0a/attachment.bin>


More information about the llvm-commits mailing list