Commit f45fd429 authored by Evgeniy Stepanov's avatar Evgeniy Stepanov
Browse files

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
parent eece5a9d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -316,8 +316,8 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
      untagAlloca(AI, Info.LifetimeEnd[0], Size);
    } else {
      uint64_t Size = Info.AI->getAllocationSizeInBits(*DL).getValue() / 8;
      tagAlloca(AI, TagPCall->getNextNode(),
                IRB.CreatePointerCast(TagPCall, IRB.getInt8PtrTy()), Size);
      Value *Ptr = IRB.CreatePointerCast(TagPCall, IRB.getInt8PtrTy());
      tagAlloca(AI, &*IRB.GetInsertPoint(), Ptr, Size);
      for (auto &RI : RetVec) {
        untagAlloca(AI, RI, Size);
      }