[PATCH] D13132: [X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before calls

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 11:09:36 PDT 2015


rnk added a comment.

> a) Does it make sense to expose it like this to FrameLowering, or should the interface be more abstract, and actually turned into a .cfi_escape somewhere lower?


I'd make it more abstract internally. I'm thinking MCStreamer::EmitGnuArgsSize, and then the two streamer impls can add the 0x2e internally.

> b) I'm not sure how to optimize away consequent directives that provide the same size. I don't think this can be done in eliminateCallFramePseudoInstr(), because (1) it's not guaranteed to be called in program order (even though in practice I think that is what happens when we have pushes), and (2) I think the basic-block order can change later on.

>  It may make sense to eliminate the redundant directives somewhere in the MC layer, but I'm not sure where that can fit in. Any suggestions?


I wouldn't worry about it now.  If we keep it abstract, we can do the optimization as part of EmitCFIInstructions without digging into escaped CFI sequences.


================
Comment at: lib/Target/X86/X86FrameLowering.cpp:2073
@@ +2072,3 @@
+    if (NeedsDwarfCFI && !isDestroy && 
+        MF.getInfo<X86MachineFunctionInfo>()->getHasPushSequences()) {
+      const uint8_t GNU_ARGS_SIZE = 0x2e;
----------------
We shouldn't emit this if we have an FP for the frame.


http://reviews.llvm.org/D13132





More information about the llvm-commits mailing list