[PATCH] D21087: [MemCpyOpt] Do not exchange llvm.lifetime.start and llvm.memcpy

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 14:49:14 PDT 2016


echristo added inline comments.

================
Comment at: lib/Transforms/Scalar/MemCpyOptimizer.cpp:792
@@ +791,3 @@
+  // Lifetime marks shouldn't be operated on.
+  if (Function *F = C->getCalledFunction())
+    if (F->isIntrinsic() && F->getIntrinsicID() == Intrinsic::lifetime_start)
----------------
timshen wrote:
> echristo wrote:
> > We might be able to move this check to line 1184 before we call the function... or maybe hoist the conditions a bit and handle it for processStore as well?
> > 
> > Thoughts?
> It'll be hard to check this in a higher level, because the CallInst doesn't necessarily exist.
> 
> Checking at every caller side will also work, but I can't think of a case where we don't need this check - exchanging a lifetime mark with the memcpy is clearly wrong.
I was mostly trying to figure out other ways to get down here than where we are. I guess this will work though...


http://reviews.llvm.org/D21087





More information about the llvm-commits mailing list