A DAGCombine optimization for mergeing consecutive stores to memory. The optimization
authorNadav Rotem <nrotem@apple.com>
Wed, 3 Oct 2012 16:11:15 +0000 (16:11 +0000)
committerNadav Rotem <nrotem@apple.com>
Wed, 3 Oct 2012 16:11:15 +0000 (16:11 +0000)
commitc653de6c0f3722154a41cbb57c213a0cdd789419
tree9913b3a243254041e8ad9c7378737779a9101d97
parentbfcb4aa10b5948539f6ee59eecfe88faa9fc4e94
A DAGCombine optimization for mergeing consecutive stores to memory. The optimization
is not profitable in many cases because modern processors perform multiple stores
in parallel and merging stores prior to merging requires extra work. We handle two main cases:

1. Store of multiple consecutive constants:
  q->a = 3;
  q->4 = 5;
In this case we store a single legal wide integer.

2. Store of multiple consecutive loads:
  int a = p->a;
  int b = p->b;
  q->a = a;
  q->b = b;
In this case we load/store either ilegal vector registers or legal wide integer registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165125 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/MergeConsecutiveStores.ll [new file with mode: 0644]