[llvm] r366375 - Speculative fix for stack-tagging.ll failure.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 14:27:45 PDT 2019


Author: eugenis
Date: Wed Jul 17 14:27:44 2019
New Revision: 366375

URL: http://llvm.org/viewvc/llvm-project?rev=366375&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64StackTagging.cpp

Modified: llvm/trunk/lib/Target/AArch64/AArch64StackTagging.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64StackTagging.cpp?rev=366375&r1=366374&r2=366375&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64StackTagging.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64StackTagging.cpp Wed Jul 17 14:27:44 2019
@@ -316,8 +316,8 @@ bool AArch64StackTagging::runOnFunction(
       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);
       }




More information about the llvm-commits mailing list