[PATCH] D155571: [MemCpyOpt] add terminator user test for D153453(NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 05:34:54 PDT 2023


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM with some nits.



================
Comment at: llvm/test/Transforms/MemCpyOpt/stack-move.ll:385
+; TODO: if the last user is terminator, we won't insert lifetime.end.
+; For multi-bb patch, we will insert it for next immidiate post dominator block.
+define void @terminator_lastuse() personality i32 0 {
----------------
immediate


================
Comment at: llvm/test/Transforms/MemCpyOpt/stack-move.ll:417
+
+  %2 = call i32 @use_nocapture(ptr nocapture %dest)
+  call void @llvm.lifetime.end.p0(i64 12, ptr %src)
----------------
Is this call needed to reproduce the crash?


================
Comment at: llvm/test/Transforms/MemCpyOpt/stack-move.ll:419
+  call void @llvm.lifetime.end.p0(i64 12, ptr %src)
+  %rv = invoke fastcc i32 @use_nocapture(ptr byval(%struct.Foo) %dest)
+  to label %suc unwind label %unw
----------------
fastcc and byval here look unnecessary (byval can be replaced by nocapture).


================
Comment at: llvm/test/Transforms/MemCpyOpt/stack-move.ll:423
+  %lp = landingpad i32 cleanup
+  br label %ehcleanup
+ehcleanup:
----------------
I don't think this extra br is needed, you can directly resume.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155571/new/

https://reviews.llvm.org/D155571



More information about the llvm-commits mailing list