[PATCH] D17736: [SSP, 1/2] Refactor to support customizable stack guard load from IR level.

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 29 13:52:42 PST 2016


timshen created this revision.
timshen added a reviewer: echristo.
timshen added subscribers: iteratee, kbarton, joerg, hfinkel, llvm-commits.

    This is mainly because glibc exports stack guards to TCB block instead
    of as a global/TLS variable. For Power, GCC solves this problem by
    directly hardcoding register number and offset to access the TCB data
    member.

    We achieve this in a similar way by extending the existing target opcode
    LOAD_STACK_GUARD to not require an address, since previously it still
    carries an address to the lower level.

    We also add two intrinsics:
    1) llvm.stackguardvalue() directly returns the value and loweres to a
       LOAD_STACK_GUARD node. It can be used in IR SSP.
    2) llvm.stackguardcheckvalue(llvm_ptr_ty) is used for DAG SSP only.
       It takes a value instead of an address.

    llvm.stackguardcheck(llvm_ptrptr_ty) is left merely for backward
    compatibility and not breaking several tests.

http://reviews.llvm.org/D17736

Files:
  include/llvm/IR/Intrinsics.td
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
  lib/CodeGen/StackProtector.cpp
  lib/CodeGen/TargetLoweringBase.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17736.49418.patch
Type: text/x-patch
Size: 17778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160229/6fe9b3e6/attachment.bin>


More information about the llvm-commits mailing list