[llvm] [MemCpyOpt] Fix the invalid code modification for GEP (PR #68479)

Kai Yan via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 8 02:40:43 PDT 2023


================
@@ -1062,19 +1066,25 @@ bool MemCpyOptPass::performCallSlotOptzn(Instruction *cpyLoad,
   // If necessary, perform additional analysis.
   if (isModOrRefSet(MR))
     MR = BAA.callCapturesBefore(C, DestWithSrcSize, DT);
-  if (isModOrRefSet(MR))
+  if (isModOrRefSet(MR)) {
----------------
kaiyan96 wrote:

RAII is a good idea. I have changed my implementation to an InstructionPositionGuard.

https://github.com/llvm/llvm-project/pull/68479


More information about the llvm-commits mailing list