[PATCH] D41135: EmitFuncArgumentDbgValue: Prefer stack slots over registers for stack arguments

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 14:27:52 PST 2017


aprantl created this revision.
aprantl added reviewers: rnk, dblaikie.

While investigating LLVM PR22316
http://llvm.org/bugs/show_bug.cgi?id=22316

I started wondering if it were not always preferable to emit the initial DBG_VALUEs for stack arguments as FI locations instead of describing the first register they get copied into. The advantage of doing this is that the arguments will be available as soon as the stack is setup. As illustrated by the testcase in the PR, the first copy of the FI into a register may be sunk by MachineSink.cpp into a later basic block. By describing the argument on the stack, we nicely circumvent this problem.

The COFF testcase change is the only testcase that broke with this change. Apparently it causes the order of the instructions in this function to get reshuffled without any functional change.


https://reviews.llvm.org/D41135

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  test/DebugInfo/COFF/fpo-shrink-wrap.ll
  test/DebugInfo/X86/stack-args.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41135.126623.patch
Type: text/x-patch
Size: 6848 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171212/433ab90d/attachment.bin>


More information about the llvm-commits mailing list