[PATCH] D41330: [X86] Reduce Store Forward Block issues in HW

Lama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 17 03:25:30 PST 2017


lsaba created this revision.
lsaba added reviewers: craig.topper, guyblank, zvi.
Herald added a subscriber: mgorny.

If a load follows a store and reloads data that the store has written to memory, Intel microarchitectures can in many cases forward the data directly from the store to the load, This "store forwarding" saves cycles by enabling the load to directly obtain the data instead of accessing the data from cache or memory.
A "store forward block" occurs in cases that a store cannot be forwarded to the load. The most typical case of store forward block on Intel Core microarchiticutre that a small store cannot be forwarded to a large load. 
The estimated penalty for a store forward block is ~13 cycles.

This pass tries to recognize and handle cases where "store forward block" is created by the compiler when lowering memcpy calls to a sequence
of a load and a store.

The pass currently only handles cases where memcpy is lowered to XMM/YMM registers, it tries to break the memcpy into smaller copies.
breaking the memcpy should be possible since there is no atomicity guarantee for loads and stores to XMM/YMM.


Repository:
  rL LLVM

https://reviews.llvm.org/D41330

Files:
  lib/Target/X86/CMakeLists.txt
  lib/Target/X86/X86.h
  lib/Target/X86/X86FixupSFB.cpp
  lib/Target/X86/X86TargetMachine.cpp
  test/CodeGen/X86/fixup-sfb.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41330.127272.patch
Type: text/x-patch
Size: 65049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171217/093bc58f/attachment.bin>


More information about the llvm-commits mailing list