Calling TLI->getNumRegisters creates a circular dependency when building LLVM using cmake.

Get the number of registers by calling getTypeLegalizationCost.

PR14199.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166911 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nadav Rotem
2012-10-29 05:28:35 +00:00
parent 8a5ec5d415
commit e49816076c

View File

@@ -300,6 +300,8 @@ VectorTargetTransformImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
unsigned
VectorTargetTransformImpl::getNumberOfParts(Type *Tp) const {
return TLI->getNumRegisters(Tp->getContext(), TLI->getValueType(Tp));
std::pair<unsigned, EVT> LT =
getTypeLegalizationCost(Tp->getContext(), TLI->getValueType(Tp));
return LT.first;
}