From f49bc3f1b19c24e4957bd3bc2dc08218f4707c55 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 24 Jul 2014 20:40:55 +0000 Subject: [X86] Optimize stackmap shadows on X86. This patch minimizes the number of nops that must be emitted on X86 to satisfy stackmap shadow constraints. To minimize the number of nops inserted, the X86AsmPrinter now records the size of the most recent stackmap's shadow in the StackMapShadowTracker class, and tracks the number of instruction bytes emitted since the that stackmap instruction was encountered. Padding is emitted (if it is required at all) immediately before the next stackmap/patchpoint instruction, or at the end of the basic block. This optimization should reduce code-size and improve performance for people using the llvm stackmap intrinsic on X86. llvm-svn: 213892 --- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 424e759caa8..226e4204224 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -804,6 +804,8 @@ void AsmPrinter::EmitFunctionBody() { } } } + + EmitBasicBlockEnd(MBB); } // If the last instruction was a prolog label, then we have a situation where -- cgit v1.2.3