[PATCH] D32002: [X86] Improve large struct pass by value performance

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 14:49:48 PDT 2017


RKSimon added a subscriber: llvm-commits.
RKSimon added a reviewer: andreadb.
RKSimon added a comment.

Adding Andrea as IIRC he's looked at x86 memcpy perf in the past.

Please don't forget to CC llvm-commits on all new phabs - otherwise it has no visibility on the relevant mailing list!



================
Comment at: lib/Target/X86/X86.td:281
+          "fast-string", "HasFastString", "true",
+          "REP MOVS/STOS are fast">;
+
----------------
Do we want the feature to be as simple as 'fast/slow' or should we take the size of the copy into account as well?


================
Comment at: lib/Target/X86/X86.td:508
   FeatureBMI2,
+  FeatureFastString,
   FeatureFMA,
----------------
Is this a Haswell feature in particular or the only target that has been tested?


================
Comment at: lib/Target/X86/X86SelectionDAGInfo.cpp:232
   MVT AVT;
-  if (Align & 1)
+  if (Subtarget.hasFastString())
+    // If the target has fast strings, then it's at least as fast to use
----------------
OptSize?


================
Comment at: test/CodeGen/X86/memcpy-struct-by-value.ll:3
+; RUN: llc -mtriple=x86_64-linux-gnu -mattr=+fast-string < %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=FAST
+
+%struct.large = type { [4096 x i8] }
----------------
Include nofast/fast target (-mcpu=) tests as well if possible


https://reviews.llvm.org/D32002





More information about the llvm-commits mailing list