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

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 11:59:21 PDT 2016


timshen 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)
----------------
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.


http://reviews.llvm.org/D21087





More information about the llvm-commits mailing list