[PATCH] D20128: MemCpyOpt: combine local load/store sequences into memcpy.

Jun Bum Lim via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 15:41:33 PDT 2016


junbuml added inline comments.

================
Comment at: lib/Transforms/Scalar/MemCpyOptimizer.cpp:159
@@ -145,3 +158,3 @@
 
   /// StartPtr - The getelementptr instruction that points to the start of the
   /// range.
----------------
comment should be updated.

================
Comment at: lib/Transforms/Scalar/MemCpyOptimizer.cpp:204
@@ -187,3 +203,3 @@
   unsigned Bytes = unsigned(End-Start);
   unsigned MaxIntSize = DL.getLargestLegalIntTypeSize();
   if (MaxIntSize == 0)
----------------
Looks like it should be : 
  unsigned MaxIntSize = DL.getLargestLegalIntTypeSize() / 8; 

I will submit a separate patch just for this.


================
Comment at: lib/Transforms/Scalar/MemCpyOptimizer.cpp:613
@@ +612,3 @@
+
+    // If it is profitable to lower this range to memset, do so now.
+    if (!Range.isProfitableToUseMemIntrinsic(DL))
----------------
memset-> memcpy

================
Comment at: lib/Transforms/Scalar/MemCpyOptimizer.cpp:617-618
@@ +616,4 @@
+
+    // Otherwise, we do want to transform this!  Create a new memset.
+    // Get the starting pointer of the block.
+    Value *DestStartPtr = Range.DestStartPtr;
----------------
Comment should be updated.


Repository:
  rL LLVM

http://reviews.llvm.org/D20128





More information about the llvm-commits mailing list