[llvm] b54b84f - [MemCpyOpt] Add additional debug output (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 08:04:03 PDT 2022


Author: Nikita Popov
Date: 2022-10-13T17:03:44+02:00
New Revision: b54b84fde6d3dcc97649dea1f2286b7deab8cfee

URL: https://github.com/llvm/llvm-project/commit/b54b84fde6d3dcc97649dea1f2286b7deab8cfee
DIFF: https://github.com/llvm/llvm-project/commit/b54b84fde6d3dcc97649dea1f2286b7deab8cfee.diff

LOG: [MemCpyOpt] Add additional debug output (NFC)

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index 6785a8421511..387b71da4373 100644
--- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -943,7 +943,7 @@ bool MemCpyOptPass::performCallSlotOptzn(Instruction *cpyLoad,
   //     renders accesses from other threads undefined.
   //     TODO: This is currently not checked.
   if (mayBeVisibleThroughUnwinding(cpyDest, C, cpyStore)) {
-    LLVM_DEBUG(dbgs() << "Call Slot: Dest may be visible through unwinding");
+    LLVM_DEBUG(dbgs() << "Call Slot: Dest may be visible through unwinding\n");
     return false;
   }
 
@@ -952,8 +952,10 @@ bool MemCpyOptPass::performCallSlotOptzn(Instruction *cpyLoad,
   bool isDestSufficientlyAligned = srcAlign <= cpyAlign;
   // If dest is not aligned enough and we can't increase its alignment then
   // bail out.
-  if (!isDestSufficientlyAligned && !isa<AllocaInst>(cpyDest))
+  if (!isDestSufficientlyAligned && !isa<AllocaInst>(cpyDest)) {
+    LLVM_DEBUG(dbgs() << "Call Slot: Dest not sufficiently aligned\n");
     return false;
+  }
 
   // Check that src is not accessed except via the call and the memcpy.  This
   // guarantees that it holds only undefined values when passed in (so the final


        


More information about the llvm-commits mailing list