Fold a loop for array processing in ComputeLinearIndex
authorMehdi Amini <mehdi.amini@apple.com>
Wed, 14 Jan 2015 05:33:01 +0000 (05:33 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Wed, 14 Jan 2015 05:33:01 +0000 (05:33 +0000)
commit8923cc5470a1a6c728c800a409d1c6c86d52825a
tree56089b2fdf800645dc970b329c3a6932f1fcd790
parenteeea8970b4b12b5493d603ceff960e4b19296c1f
Fold a loop for array processing in ComputeLinearIndex

When processing an array, every Elt has the same layout, it is
useless to recursively call each ComputeLinearIndex on each element.
Just do it once and multiply by the number of elements.

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

llvm-svn: 225949
llvm/include/llvm/CodeGen/Analysis.h
llvm/lib/CodeGen/Analysis.cpp