llvm/test
Sander de Smalen 4548d296c1 [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize (Take 2)
Commit message from D66935:

This patch fixes a bug exposed by D65653 where a subsequent invocation
of `determineCalleeSaves` ends up with a different size for the callee
save area, leading to different frame-offsets in debug information.

In the invocation by PEI, `determineCalleeSaves` tries to determine
whether it needs to spill an extra callee-saved register to get an
emergency spill slot. To do this, it calls 'estimateStackSize' and
manually adds the size of the callee-saves to this. PEI then allocates
the spill objects for the callee saves and the remaining frame layout
is calculated accordingly.

A second invocation in LiveDebugValues causes estimateStackSize to return
the size of the stack frame including the callee-saves. Given that the
size of the callee-saves is added to this, these callee-saves are counted
twice, which leads `determineCalleeSaves` to believe the stack has
become big enough to require spilling an extra callee-save as emergency
spillslot. It then updates CalleeSavedStackSize with a larger value.

Since CalleeSavedStackSize is used in the calculation of the frame
offset in getFrameIndexReference, this leads to incorrect offsets for
variables/locals when this information is recalculated after PEI.

This patch fixes the lldb unit tests in `functionalities/thread/concurrent_events/*`

Changes after D66935:

Ensures AArch64FunctionInfo::getCalleeSavedStackSize does not return
the uninitialized CalleeSavedStackSize when running `llc` on a specific
pass where the MIR code has already been expected to have gone through PEI.

Instead, getCalleeSavedStackSize (when passed the MachineFrameInfo) will try
to recalculate the CalleeSavedStackSize from the CalleeSavedInfo. In debug
mode, the compiler will assert the recalculated size equals the cached
size as calculated through a call to determineCalleeSaves.

This fixes two tests:
  test/DebugInfo/AArch64/asan-stack-vars.mir
  test/DebugInfo/AArch64/compiler-gen-bbs-livedebugvalues.mir
that otherwise fail when compiled using msan.

Reviewed By: omjavaid, efriedma

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375425 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-21 17:12:56 +00:00
..
Analysis [SCEV] Simplify umin/max of zext and sext of the same value 2019-10-19 17:23:02 +00:00
Assembler [lit] Fix a test case that r374652 missed 2019-10-16 17:56:12 +00:00
Bindings [IRBuilder] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator 2019-10-14 15:35:01 +00:00
Bitcode Add FMF to vector ops for phi 2019-10-14 17:39:32 +00:00
BugPoint
CodeGen [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize (Take 2) 2019-10-21 17:12:56 +00:00
DebugInfo [AArch64][DebugInfo] Do not recompute CalleeSavedStackSize (Take 2) 2019-10-21 17:12:56 +00:00
Demangle [Demangle] Add a few more options to the microsoft demangler 2019-10-15 08:29:56 +00:00
Examples
ExecutionEngine [JITLink] Switch to slab allocation for InProcessMemoryManager, re-enable test. 2019-10-15 21:06:57 +00:00
Feature [FPEnv] Add constrained intrinsics for lrint and lround 2019-10-07 13:20:00 +00:00
FileCheck [FileCheck] Implement --ignore-case option. 2019-10-11 11:59:14 +00:00
Instrumentation Insert module constructors in a module pass 2019-10-11 08:47:03 +00:00
Integer
JitListener
Linker
LTO Reland: Dead Virtual Function Elimination 2019-10-17 09:58:57 +00:00
MachineVerifier Add an operand to memory intrinsics to denote the "tail" marker. 2019-09-28 05:33:21 +00:00
MC [X86] Fix register parsing in .seh_* in Intel syntax 2019-10-18 21:01:41 +00:00
Object [yaml2obj][obj2yaml] - Do not create a symbol table by default. 2019-10-20 14:47:17 +00:00
ObjectYAML [WebAssembly] Allow multivalue signatures in object files 2019-10-18 20:27:30 +00:00
Other Reapply r374743 with a fix for the ocaml binding 2019-10-14 16:15:14 +00:00
Reduce [Testing] Python 3 requires print to use parens 2019-09-20 13:52:47 +00:00
SafepointIRVerifier
Support
SymbolRewriter
TableGen [TableGen] Fix a bug that MCSchedClassDesc is interfered between different SchedModel 2019-10-11 08:36:54 +00:00
ThinLTO/X86 One more attempt to fix PS4 buildbot after r375219 2019-10-18 14:11:19 +00:00
tools [llvm/Object] - Make ELFObjectFile::getRelocatedSection return Expected<section_iterator> 2019-10-21 11:06:38 +00:00
Transforms Pre-commit test cases for D64713. 2019-10-21 15:01:59 +00:00
Unit
Verifier [DebugInfo] Add a DW_OP_LLVM_entry_value operation 2019-10-15 11:31:21 +00:00
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg.py Reland "[utils] Implement the llvm-locstats tool" 2019-10-02 07:00:01 +00:00
lit.site.cfg.py.in Follow-up to r372209: Use single quotes for host_ldflags in the lit config 2019-09-18 14:12:59 +00:00
TestRunner.sh