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)
commit497b958447eac80e864e11db0c0933aeb2bd131c
treea3f20a01a3c128a95dd64f7eb7d0e56b40dced76
parent7f0cbb570311bf2d6ffcdcd0013f86f6266303e3
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225949 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/Analysis.h
lib/CodeGen/Analysis.cpp