[PATCH] D32481: [X86] memset should be using REPSTOS for memset on recent CPU (that have ERMS).

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 13:03:16 PDT 2017


zvi added inline comments.


================
Comment at: lib/Target/X86/X86SelectionDAGInfo.cpp:66
 SDValue X86SelectionDAGInfo::EmitTargetCodeForMemset(
-    SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src,
+    SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Val,
     SDValue Size, unsigned Align, bool isVolatile,
----------------
Can this be done in a parent commit?


================
Comment at: lib/Target/X86/X86SelectionDAGInfo.cpp:201
 
-namespace {
-
-// Represents a cover of a buffer of SizeVal bytes with blocks of size
-// AVT, as well as how many bytes remain (BytesLeft is always smaller than
-// the block size).
-struct RepMovsRepeats {
-  RepMovsRepeats(const uint64_t SizeVal, const MVT& AVT) {
-    const unsigned UBytes = AVT.getSizeInBits() / 8;
-    Count = SizeVal / UBytes;
-    BytesLeft = SizeVal % UBytes;
-  }
-
-  unsigned Count;
-  unsigned BytesLeft;
-};
-
-}  // namespace
-
 SDValue X86SelectionDAGInfo::EmitTargetCodeForMemcpy(
     SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue Dst, SDValue Src,
----------------
Can you please move the memcpy-related refactoring to a separate patch? It would be best if this patch was minimized to the memset improvement alone.


https://reviews.llvm.org/D32481





More information about the llvm-commits mailing list