[DAGCombiner] Fold together mul and shl when both are by a constant
authorJohn Brawn <john.brawn@arm.com>
Fri, 21 Aug 2015 10:48:17 +0000 (10:48 +0000)
committerJohn Brawn <john.brawn@arm.com>
Fri, 21 Aug 2015 10:48:17 +0000 (10:48 +0000)
commit19a3f63b5477afc8de8a5de22ecd975050e5cef2
tree34db950d586195ae91a8e02cae950ccbf5ac2434
parent92c2acd055885e7e329fca25b9233fadd0da0dd0
[DAGCombiner] Fold together mul and shl when both are by a constant

This is intended to improve code generation for GEPs, as the index value is
shifted by the element size and in GEPs of multi-dimensional arrays the index
of higher dimensions is multiplied by the lower dimension size.

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

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