Skip to content

Commit f45fd42

Browse files
committed
Speculative fix for stack-tagging.ll failure.
Depending on the evaluation order of function call arguments, the current code may insert a use before def. llvm-svn: 366375
1 parent eece5a9 commit f45fd42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AArch64/AArch64StackTagging.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
316316
untagAlloca(AI, Info.LifetimeEnd[0], Size);
317317
} else {
318318
uint64_t Size = Info.AI->getAllocationSizeInBits(*DL).getValue() / 8;
319-
tagAlloca(AI, TagPCall->getNextNode(),
320-
IRB.CreatePointerCast(TagPCall, IRB.getInt8PtrTy()), Size);
319+
Value *Ptr = IRB.CreatePointerCast(TagPCall, IRB.getInt8PtrTy());
320+
tagAlloca(AI, &*IRB.GetInsertPoint(), Ptr, Size);
321321
for (auto &RI : RetVec) {
322322
untagAlloca(AI, RI, Size);
323323
}

0 commit comments

Comments
 (0)