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)
commit3db39dc1ae6f27f10bd7bed91d40048b71c3ffc0
tree265413c982f8a44f9a73be8d0a9cdb485bf6ef01
parentd6d1a9859e142f7b67b49087b9649754a6a6b5cf
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
llvm-svn: 188936
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/merge_store.ll [new file with mode: 0644]