llvm-6502/include/llvm
Gordon Henriksen 8fa8929177 With this patch, the LowerGC transformation becomes the
ShadowStackCollector, which additionally has reduced overhead with
no sacrifice in portability.

Considering a function @fun with 8 loop-local roots,
ShadowStackCollector introduces the following overhead
(x86):

; shadowstack prologue
        movl    L_llvm_gc_root_chain$non_lazy_ptr, %eax
        movl    (%eax), %ecx
        movl    $___gc_fun, 20(%esp)
        movl    $0, 24(%esp)
        movl    $0, 28(%esp)
        movl    $0, 32(%esp)
        movl    $0, 36(%esp)
        movl    $0, 40(%esp)
        movl    $0, 44(%esp)
        movl    $0, 48(%esp)
        movl    $0, 52(%esp)
        movl    %ecx, 16(%esp)
        leal    16(%esp), %ecx
        movl    %ecx, (%eax)

; shadowstack loop overhead
        (none)

; shadowstack epilogue
        movl    48(%esp), %edx
        movl    %edx, (%ecx)

; shadowstack metadata
        .align  3
___gc_fun:                              # __gc_fun
        .long   8
        .space  4

In comparison to LowerGC:

; lowergc prologue
        movl    L_llvm_gc_root_chain$non_lazy_ptr, %eax
        movl    (%eax), %ecx
        movl    %ecx, 48(%esp)
        movl    $8, 52(%esp)
        movl    $0, 60(%esp)
        movl    $0, 56(%esp)
        movl    $0, 68(%esp)
        movl    $0, 64(%esp)
        movl    $0, 76(%esp)
        movl    $0, 72(%esp)
        movl    $0, 84(%esp)
        movl    $0, 80(%esp)
        movl    $0, 92(%esp)
        movl    $0, 88(%esp)
        movl    $0, 100(%esp)
        movl    $0, 96(%esp)
        movl    $0, 108(%esp)
        movl    $0, 104(%esp)
        movl    $0, 116(%esp)
        movl    $0, 112(%esp)

; lowergc loop overhead
        leal    44(%esp), %eax
        movl    %eax, 56(%esp)
        leal    40(%esp), %eax
        movl    %eax, 64(%esp)
        leal    36(%esp), %eax
        movl    %eax, 72(%esp)
        leal    32(%esp), %eax
        movl    %eax, 80(%esp)
        leal    28(%esp), %eax
        movl    %eax, 88(%esp)
        leal    24(%esp), %eax
        movl    %eax, 96(%esp)
        leal    20(%esp), %eax
        movl    %eax, 104(%esp)
        leal    16(%esp), %eax
        movl    %eax, 112(%esp)

; lowergc epilogue
        movl    48(%esp), %edx
        movl    %edx, (%ecx)

; lowergc metadata
        (none)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45670 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 01:30:53 +00:00
..
ADT Inverted argument order for ImmutableMap::Profile. 2008-01-02 22:18:33 +00:00
Analysis fix typo 2008-01-04 20:04:08 +00:00
Assembly Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Bitcode Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
CodeGen With this patch, the LowerGC transformation becomes the 2008-01-07 01:30:53 +00:00
Config Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Debugger Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ExecutionEngine Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Support Split param attr implementation out from Function.cpp into its 2008-01-02 23:42:30 +00:00
System Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Target rename isLoad -> isSimpleLoad due to evan's desire to have such a predicate. 2008-01-06 23:38:27 +00:00
Transforms With this patch, the LowerGC transformation becomes the 2008-01-07 01:30:53 +00:00
AbstractTypeUser.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Argument.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
AutoUpgrade.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
BasicBlock.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
CallGraphSCCPass.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
CallingConv.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Constant.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Constants.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
DerivedTypes.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Function.h Disallow copying explicitly. 2008-01-03 00:09:47 +00:00
GlobalAlias.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
GlobalValue.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
GlobalVariable.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
InlineAsm.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
InstrTypes.h When transforming a call to a bitcast function into 2008-01-06 10:12:28 +00:00
Instruction.def remove attribution from a variety of miscellaneous files. 2007-12-29 22:59:10 +00:00
Instruction.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Instructions.h Split param attr implementation out from Function.cpp into its 2008-01-02 23:42:30 +00:00
IntrinsicInst.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Intrinsics.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Intrinsics.td remove attribution from a variety of miscellaneous files. 2007-12-29 22:59:10 +00:00
IntrinsicsARM.td remove attribution from a variety of miscellaneous files. 2007-12-29 22:59:10 +00:00
IntrinsicsCellSPU.td remove attribution from a variety of miscellaneous files. 2007-12-29 22:59:10 +00:00
IntrinsicsPowerPC.td remove attribution from a variety of miscellaneous files. 2007-12-29 22:59:10 +00:00
IntrinsicsX86.td remove attribution from a variety of miscellaneous files. 2007-12-29 22:59:10 +00:00
LinkAllPasses.h With this patch, the LowerGC transformation becomes the 2008-01-07 01:30:53 +00:00
LinkAllVMCore.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Linker.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
LinkTimeOptimizer.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Module.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ModuleProvider.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ParameterAttributes.h The transform that tries to turn calls to bitcast functions into 2008-01-06 18:27:01 +00:00
Pass.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
PassAnalysisSupport.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
PassManager.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
PassManagers.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
PassSupport.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
SymbolTableListTraits.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Type.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
TypeSymbolTable.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Use.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
User.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
Value.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
ValueSymbolTable.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00