mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
optimize duplicate ValueMap lookups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34599 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ce74de46dd
commit
251db1890c
@ -661,17 +661,14 @@ SDOperand SelectionDAGLowering::getValue(const Value *V) {
|
|||||||
return DAG.getFrameIndex(SI->second, TLI.getPointerTy());
|
return DAG.getFrameIndex(SI->second, TLI.getPointerTy());
|
||||||
}
|
}
|
||||||
|
|
||||||
DenseMap<const Value*, unsigned>::iterator VMI =
|
unsigned InReg = FuncInfo.ValueMap[V];
|
||||||
FuncInfo.ValueMap.find(V);
|
assert(InReg && "Value not in map!");
|
||||||
assert(VMI != FuncInfo.ValueMap.end() && "Value not in map!");
|
|
||||||
|
|
||||||
unsigned InReg = VMI->second;
|
|
||||||
|
|
||||||
// If this type is not legal, make it so now.
|
// If this type is not legal, make it so now.
|
||||||
if (VT != MVT::Vector) {
|
if (VT != MVT::Vector) {
|
||||||
if (TLI.getTypeAction(VT) == TargetLowering::Expand) {
|
if (TLI.getTypeAction(VT) == TargetLowering::Expand) {
|
||||||
// Source must be expanded. This input value is actually coming from the
|
// Source must be expanded. This input value is actually coming from the
|
||||||
// register pair VMI->second and VMI->second+1.
|
// register pair InReg and InReg+1.
|
||||||
MVT::ValueType DestVT = TLI.getTypeToExpandTo(VT);
|
MVT::ValueType DestVT = TLI.getTypeToExpandTo(VT);
|
||||||
unsigned NumVals = TLI.getNumElements(VT);
|
unsigned NumVals = TLI.getNumElements(VT);
|
||||||
N = DAG.getCopyFromReg(DAG.getEntryNode(), InReg, DestVT);
|
N = DAG.getCopyFromReg(DAG.getEntryNode(), InReg, DestVT);
|
||||||
@ -4189,9 +4186,9 @@ LowerArguments(BasicBlock *LLVMBB, SelectionDAGLowering &SDL,
|
|||||||
|
|
||||||
// If this argument is live outside of the entry block, insert a copy from
|
// If this argument is live outside of the entry block, insert a copy from
|
||||||
// whereever we got it to the vreg that other BB's will reference it as.
|
// whereever we got it to the vreg that other BB's will reference it as.
|
||||||
if (FuncInfo.ValueMap.count(AI)) {
|
DenseMap<const Value*, unsigned>::iterator VMI=FuncInfo.ValueMap.find(AI);
|
||||||
SDOperand Copy =
|
if (VMI != FuncInfo.ValueMap.end()) {
|
||||||
SDL.CopyValueToVirtualRegister(AI, FuncInfo.ValueMap[AI]);
|
SDOperand Copy = SDL.CopyValueToVirtualRegister(AI, VMI->second);
|
||||||
UnorderedChains.push_back(Copy);
|
UnorderedChains.push_back(Copy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user