From: Chris Lattner Date: Sun, 12 Apr 2009 07:46:30 +0000 (+0000) Subject: make UpdateValueMap handle the possiblity that we could be X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=36e3946ac2f30a0bda66538ef2b974b1c8fbdc97;p=oota-llvm.git make UpdateValueMap handle the possiblity that we could be copying into the right register, avoiding a copy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68889 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 7e300536748..251e96a771c 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -158,7 +158,7 @@ unsigned FastISel::UpdateValueMap(Value* I, unsigned Reg) { unsigned &AssignedReg = ValueMap[I]; if (AssignedReg == 0) AssignedReg = Reg; - else { + else if (Reg != AssignedReg) { const TargetRegisterClass *RegClass = MRI.getRegClass(Reg); TII.copyRegToReg(*MBB, MBB->end(), AssignedReg, Reg, RegClass, RegClass);