Change Value::getUnderlyingObject to have the MaxLookup value specified as a
authorBob Wilson <bob.wilson@apple.com>
Mon, 25 Jan 2010 18:26:54 +0000 (18:26 +0000)
committerBob Wilson <bob.wilson@apple.com>
Mon, 25 Jan 2010 18:26:54 +0000 (18:26 +0000)
commit032742972f69c014dd5e985753c06a7fe3d08704
tree598179f2966009f90210cd7be041018fceb6fcaa
parentaee6a656e84956a2e3c9d7436f68a4a3cfa64fee
Change Value::getUnderlyingObject to have the MaxLookup value specified as a
parameter with a default value, instead of just hardcoding it in the
implementation.  The limit of MaxLookup = 6 was introduced in r69151 to fix
a performance problem with O(n^2) behavior in instcombine, but the scalarrepl
pass is relying on getUnderlyingObject to go all the way back to an AllocaInst.
Making the limit part of the method signature makes it clear that by default
the result is limited and should help avoid similar problems in the future.
This fixes pr6126.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94433 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Value.h
lib/Transforms/Scalar/ScalarReplAggregates.cpp
lib/VMCore/Value.cpp