Teach BaseIndexOffset::match to identify base pointers in loops.
authorJuergen Ributzka <juergen@apple.com>
Wed, 21 Aug 2013 21:53:38 +0000 (21:53 +0000)
committerJuergen Ributzka <juergen@apple.com>
Wed, 21 Aug 2013 21:53:38 +0000 (21:53 +0000)
commit915e936de270c3c57df1382b683001adc2c0d695
tree82a6c5582471ba568d7774f1f30b5841bed0af22
parent79ef34d1802eeea48aa4e9346abecbf8ceb2e8eb
Teach BaseIndexOffset::match to identify base pointers in loops.

The small utility function that pattern matches Base + Index +
Offset patterns for loads and stores fails to recognize the base
pointer for loads/stores from/into an array at offset 0 inside a
loop. As a result DAGCombiner::MergeConsecutiveStores was not able
to merge all stores.

This commit fixes the issue by adding an additional pattern match
and also a test case.

Reviewer: Nadav

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