Skip to content

Commit

Permalink
Have callees set up their shadow frame.
Browse files Browse the repository at this point in the history
Before this change we'd have caller's allocate shadow space. Besides
being an unconventional strategy, this also means that we allocate
shadow space for things which will never require shadow space. We even
had to conservatively allocate shadow space before external calls just
in case they call-back into functions that do need shadow space.

This change makes each callee requiring a shadow frame allocate it
itself.

Read the comment at the top of ShadowStack.cpp for implementation
details.

Measuring about a 22% speedup on bigloop.
  • Loading branch information
vext01 committed Dec 19, 2024
1 parent 172202a commit d7689df
Show file tree
Hide file tree
Showing 6 changed files with 425 additions and 163 deletions.
1 change: 1 addition & 0 deletions llvm/include/llvm/InitializePasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ void initializeXRayInstrumentationPass(PassRegistry&);
void initializeYkStackmapsPass(PassRegistry&);
void initializeYkSplitBlocksAfterCallsPass(PassRegistry&);
void initializeYkBasicBlockTracerPass(PassRegistry&);
void initializeYkShadowStackPass(PassRegistry&);
void initializeYkModuleClonePass(PassRegistry&);
} // end namespace llvm

Expand Down
1 change: 1 addition & 0 deletions llvm/lib/CodeGen/CodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,6 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeYkStackmapsPass(Registry);
initializeYkSplitBlocksAfterCallsPass(Registry);
initializeYkBasicBlockTracerPass(Registry);
initializeYkShadowStackPass(Registry);
initializeYkModuleClonePass(Registry);
}
Loading

0 comments on commit d7689df

Please sign in to comment.