Skip to content

Commit 2ba7ca3

Browse files
committed
[IRGen] Disable on-stack pack metadata via attr.
When lowering a SIL function, if it bears the no_onstack_pack_metadata annotation, disable on-stack pack metadata.
1 parent bf8ea7a commit 2ba7ca3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/IRGen/IRGenFunction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,12 @@ class IRGenFunction {
201201
llvm::Value *AsyncCoroutineCurrentResume = nullptr;
202202
llvm::Value *AsyncCoroutineCurrentContinuationContext = nullptr;
203203

204+
protected:
204205
// Whether pack metadata stack promotion is disabled for this function in
205206
// particular.
206207
bool packMetadataStackPromotionDisabled = false;
207208

209+
private:
208210
Address asyncContextLocation;
209211

210212
/// The unique block that calls @llvm.coro.end.

lib/IRGen/IRGenSIL.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,6 +2355,9 @@ void IRGenSILFunction::emitSILFunction() {
23552355
if (IGM.DebugInfo)
23562356
IGM.DebugInfo->emitFunction(*CurSILFn, CurFn);
23572357

2358+
if (!CurSILFn->useStackForPackMetadata())
2359+
packMetadataStackPromotionDisabled = true;
2360+
23582361
// Map the entry bb.
23592362
LoweredBBs[&*CurSILFn->begin()] = LoweredBB(&CurFn->back(), {});
23602363
// Create LLVM basic blocks for the other bbs.

0 commit comments

Comments
 (0)