[DAGCombiner] Fix the type used in canFoldInAddressingMode to account for the
authorQuentin Colombet <qcolombet@apple.com>
Fri, 24 Apr 2015 21:28:00 +0000 (21:28 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Fri, 24 Apr 2015 21:28:00 +0000 (21:28 +0000)
commit82291459611118ae441179945b472ad68e86a7d4
tree94e8dd90d7edfa2c1e2b3bfc80d3b2621d4b3729
parentaac51934cfc61420bf621e20af1e7bae29e013c5
[DAGCombiner] Fix the type used in canFoldInAddressingMode to account for the
right scaling.

In the function canFoldInAddressingMode, VT is computed as the type of the
destination/source of a LOAD/STORE operations, instead of the memory type of the
operation.
On targets with a scaling factor on the offset of the LOAD/STORE operations, the
function may return false for actually valid cases. This may then prevent the
selection of profitable pre or post indexed load/store operations, and instead
select pre or post indexed load/store for unprofitable cases.

Patch by Francois de Ferriere <francois.de-ferriere@st.com>!

Differential Revision: http://reviews.llvm.org/D9146

llvm-svn: 235780
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp