[all-commits] [llvm/llvm-project] 64bc1f: [SystemZ] Global Stackprotector and associated loc...
Dominik Steenken via All-commits
all-commits at lists.llvm.org
Fri May 29 00:18:12 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 64bc1fae11d6591739ed0c14f1f3464ae7bc24ac
https://github.com/llvm/llvm-project/commit/64bc1fae11d6591739ed0c14f1f3464ae7bc24ac
Author: Dominik Steenken <dost at de.ibm.com>
Date: 2026-05-29 (Fri, 29 May 2026)
Changed paths:
M clang/include/clang/Basic/CodeGenOptions.def
M clang/include/clang/Options/Options.td
M clang/lib/CodeGen/CodeGenModule.cpp
M clang/lib/Driver/ToolChains/Clang.cpp
A clang/test/CodeGen/SystemZ/stack-guard-global-option.c
M clang/test/Driver/stack-protector-guard.c
M llvm/include/llvm/IR/Module.h
M llvm/lib/IR/Module.cpp
M llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
M llvm/lib/Target/SystemZ/SystemZAsmPrinter.h
M llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
M llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
M llvm/lib/Target/SystemZ/SystemZISelLowering.h
M llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
M llvm/lib/Target/SystemZ/SystemZInstrInfo.h
M llvm/lib/Target/SystemZ/SystemZInstrInfo.td
M llvm/lib/Target/SystemZ/SystemZOperators.td
A llvm/test/CodeGen/SystemZ/stack-guard-global-nopic.ll
A llvm/test/CodeGen/SystemZ/stack-guard-global-pic.ll
A llvm/test/CodeGen/SystemZ/stack-guard-pseudos.ll
A llvm/test/CodeGen/SystemZ/stack-guard-tls.ll
R llvm/test/CodeGen/SystemZ/stack-guard.ll
Log Message:
-----------
[SystemZ] Global Stackprotector and associated location section (#169317)
This commit allows `-mstack-protector-guard=global` for `s390x`.
It also adds a new arch-specific option
`-mstack-protector-guard-record`, analogous to `-mrecord-mcount`, which
will cause `clang` to emit a `__stack_protector_loc` section containing
all the locations in the output binary that load the stack guard
address, for the purposes of later rewriting of those loads by the
kernel. This new option only works together with the `global` stack
protector.
In order to minimize exposure of the stack guard, both the storing of
the stack guard onto the stack, and the later comparison of that value
against the reference value, are handled via direct mem-to-mem
instructions, those being `mvc` and `clc`.
This is achieved by introducing two new pseudo instructions,
`MOVE_STACK_GUARD` and `COMPARE_STACK_GUARD`, which are inserted by the
DAGCombiner after SelectionDAG construction. These pseudos stick around
throughout the entire backend pipeline, and are lowered only in the
AsmPrinter.
This commit also adds tests for both kinds of stack protectors (tls and
global), for the proper insertion of the pseudos, the proper emission of
the, `__stack_protector_loc` section, as well as the option
compatibility checks for the new options.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list