Use lookUpRegForValue here instead of duplicating the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2012-03-20 01:07:47 +00:00
parent 1aa73cc05a
commit 4e27027562

View File

@ -136,15 +136,8 @@ unsigned FastISel::getRegForValue(const Value *V) {
return 0;
}
// Look up the value to see if we already have a register for it. We
// cache values defined by Instructions across blocks, and other values
// only locally. This is because Instructions already have the SSA
// def-dominates-use requirement enforced.
DenseMap<const Value *, unsigned>::iterator I = FuncInfo.ValueMap.find(V);
if (I != FuncInfo.ValueMap.end())
return I->second;
unsigned Reg = LocalValueMap[V];
// Look up the value to see if we already have a register for it.
unsigned Reg = lookUpRegForValue(V);
if (Reg != 0)
return Reg;