Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/SILOptimizer/Mandatory/Differentiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4691,7 +4691,8 @@ class JVPEmitter final
CLONE_AND_EMIT_TANGENT(AllocStack, asi) {
auto &diffBuilder = getDifferentialBuilder();
auto *mappedAllocStackInst = diffBuilder.createAllocStack(
asi->getLoc(), getRemappedTangentType(asi->getElementType()));
asi->getLoc(), getRemappedTangentType(asi->getElementType()),
asi->getVarInfo());
bufferMap.try_emplace({asi->getParent(), asi},
mappedAllocStackInst);
}
Expand Down Expand Up @@ -6112,7 +6113,7 @@ class PullbackEmitter final : public SILInstructionVisitor<PullbackEmitter> {
// Allocate local buffer and initialize to zero.
auto bufObjectType = getRemappedTangentType(originalBuffer->getType());
auto *newBuf = localAllocBuilder.createAllocStack(
originalBuffer.getLoc(), bufObjectType);
RegularLocation::getAutoGeneratedLocation(), bufObjectType);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this code is constructing a temporary buffer inside PullbackEmitter::getAdjointBuffer - maybe it's even correct for this buffer to have a synthesized location (because it's an auxiliary variable that doesn't directly relate to user-written variables).

// Temporarily change global builder insertion point and emit zero into the
// local buffer.
auto insertionPoint = builder.getInsertionBB();
Expand Down