llvm-6502/include/llvm/CodeGen
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
..
AsmPrinter.h Enabling the target-independent garbage collection infrastructure by hooking it 2008-01-07 01:30:38 +00:00
BreakCriticalMachineEdge.h
CallingConvLower.h
Collector.h
CollectorMetadata.h
Collectors.h
DwarfWriter.h
ELFRelocation.h
FileWriters.h
IntrinsicLowering.h
LinkAllCodegenComponents.h With this patch, the LowerGC transformation becomes the 2008-01-07 01:30:53 +00:00
LiveInterval.h
LiveIntervalAnalysis.h Rename SSARegMap -> MachineRegisterInfo in keeping with the idea 2007-12-31 04:13:23 +00:00
LiveVariables.h More cleanups for MachineOperand: 2007-12-30 21:56:09 +00:00
MachineBasicBlock.h properly encapsulate the parent field of MBB and MI with get/set accessors. 2007-12-31 04:56:33 +00:00
MachineCodeEmitter.h X86 JIT PIC jumptable support. 2008-01-05 02:26:58 +00:00
MachineConstantPool.h
MachineDominators.h
MachineFrameInfo.h
MachineFunction.h Rename SSARegMap -> MachineRegisterInfo in keeping with the idea 2007-12-31 04:13:23 +00:00
MachineFunctionPass.h
MachineInstr.h Implement automatically updated def/use lists for all MachineInstr register 2008-01-01 01:12:31 +00:00
MachineInstrBuilder.h Shrinkify the machine operand creation method names. 2007-12-30 00:45:46 +00:00
MachineJumpTableInfo.h
MachineLocation.h
MachineLoopInfo.h
MachineModuleInfo.h
MachineOperand.h add efficient iteration support for register use/def's 2008-01-01 02:55:32 +00:00
MachinePassRegistry.h
MachineRegisterInfo.h don't access element zero of an array of size zero. 2008-01-03 01:25:31 +00:00
MachineRelocation.h X86 PIC JIT support fixes: encoding bugs, add lazy pointer stubs support. 2008-01-04 10:46:51 +00:00
MachORelocation.h
Passes.h Don't recalculate the loop info and loop dominators analyses if they're 2008-01-04 20:54:55 +00:00
RegAllocRegistry.h
RegisterCoalescer.h
RegisterScavenging.h
RuntimeLibcalls.h
SchedGraphCommon.h
ScheduleDAG.h Rename SSARegMap -> MachineRegisterInfo in keeping with the idea 2007-12-31 04:13:23 +00:00
SchedulerRegistry.h
SelectionDAG.h
SelectionDAGISel.h Enabling the target-independent garbage collection infrastructure by hooking it 2008-01-07 01:30:38 +00:00
SelectionDAGNodes.h
ValueTypes.h
ValueTypes.td remove attribution from a variety of miscellaneous files. 2007-12-29 22:59:10 +00:00