diff options
| author | Amara Emerson <amara@apple.com> | 2021-09-25 22:55:37 -0700 |
|---|---|---|
| committer | Amara Emerson <amara@apple.com> | 2021-10-04 21:33:44 -0700 |
| commit | cfef1803dd83fc2447c295742710a09e8e17aa22 (patch) | |
| tree | 7b30657e26d5471548fb26d4820b363dbaca5509 /llvm/lib/CodeGen/StackProtector.cpp | |
| parent | 31a5cb3292e1167ed9f285a1a29463f2c5fe6bbf (diff) | |
[GlobalISel] Port over the SelectionDAG stack protector codegen feature.
This is a port of the feature that allows the StackProtector pass to omit
checking code for stack canary checks, and rely on SelectionDAG to do it at a
later stage. The reasoning behind this seems to be to prevent the IR checking
instructions from hindering tail-call optimizations during codegen.
Here we allow GlobalISel to also use that scheme. Doing so requires that we
do some analysis using some factored-out code to determine where to generate
code for the epilogs.
Not every case is handled in this patch since we don't have support for all
targets that exercise different stack protector schemes.
Differential Revision: https://reviews.llvm.org/D98200
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/StackProtector.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index 814352306486..d6d49c300d7c 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/lib/CodeGen/StackProtector.cpp @@ -436,9 +436,8 @@ bool StackProtector::InsertStackProtectors() { // protection in SDAG. bool SupportsSelectionDAGSP = TLI->useStackGuardXorFP() || - (EnableSelectionDAGSP && !TM->Options.EnableFastISel && - !TM->Options.EnableGlobalISel); - AllocaInst *AI = nullptr; // Place on stack that stores the stack guard. + (EnableSelectionDAGSP && !TM->Options.EnableFastISel); + AllocaInst *AI = nullptr; // Place on stack that stores the stack guard. for (BasicBlock &BB : llvm::make_early_inc_range(*F)) { ReturnInst *RI = dyn_cast<ReturnInst>(BB.getTerminator()); |
