[CodeGen] Replace the reused stores' chain for extractelt expansion.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 9 Mar 2015 22:51:05 +0000 (22:51 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 9 Mar 2015 22:51:05 +0000 (22:51 +0000)
commit55a060641fb07cbf7dfc93d2ae620b27b73c5ad3
tree5f3817ba64041e5f36b7ded7b39de0adc0aad072
parentfad749559cfed5dbfc3915382ceff720357ca10e
[CodeGen] Replace the reused stores' chain for extractelt expansion.

This fixes a subtle issue that was introduced in r205153.

When reusing a store for the extractelement expansion (to load directly
from it, inserting of going through the stack), later stores to the
same location might have overwritten the data we were expecting to
extract from.

To fix that, we need to explicitly replace the chain going out of the
reused store, so that later stores also have an explicit dependency on
the generated element-extracting loads, and can't clobber them.

rdar://20066785
Differential Revision: http://reviews.llvm.org/D8180

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231721 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
test/CodeGen/X86/extractelement-legalization-store-ordering.ll [new file with mode: 0644]
test/CodeGen/X86/vector-idiv.ll