[PATCH] D18906: [DeadStoreElimination] Shorten beginning of memset overwritten by later stores

Mandeep Singh Grang via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 13:30:14 PDT 2016


mgrang added a subscriber: mgrang.

================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:341
@@ +340,3 @@
+  OverwriteComplete,
+  OverwriteBegin,
+  OverwriteEnd,
----------------
It's better to list the enum members alphabetically.

================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:639
@@ -614,2 +638,3 @@
           unsigned DepWriteAlign = DepIntrinsic->getAlignment();
-          if (llvm::isPowerOf2_64(InstWriteOffset) ||
+          bool IsOverwriteEnd = OR == OverwriteEnd;
+          if (!IsOverwriteEnd)
----------------
Enclosing the RHS in parentheses makes it more readable.
bool IsOverwriteEnd = (OR == OverwriteEnd);

================
Comment at: lib/Transforms/Scalar/DeadStoreElimination.cpp:656
@@ +655,3 @@
+                    ? InstWriteOffset - DepWriteOffset
+                    : DepLoc.Size - (InstWriteOffset - DepWriteOffset);
+
----------------
Parentheses not really needed:

DepLoc.Size - (InstWriteOffset - DepWriteOffset) equals DepLoc.Size - InstWriteOffset - DepWriteOffset


http://reviews.llvm.org/D18906





More information about the llvm-commits mailing list