llvm.org GIT mirror llvm / a2fb634
lastRegisterUse() should ignore identity copies. Those will be erased. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48759 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 12 years ago
2 changed file(s) with 45 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
15401540 E = mri_->use_end(); I != E; ++I) {
15411541 MachineOperand &Use = I.getOperand();
15421542 MachineInstr *UseMI = Use.getParent();
1543 unsigned SrcReg, DstReg;
1544 if (tii_->isMoveInstr(*UseMI, SrcReg, DstReg) && SrcReg == DstReg)
1545 // Ignore identity copies.
1546 continue;
15431547 unsigned Idx = li_->getInstructionIndex(UseMI);
15441548 if (Idx >= Start && Idx < End && Idx >= UseIdx) {
15451549 LastUse = &Use;
15611565 if (e < s || MI == NULL)
15621566 return NULL;
15631567
1564 for (unsigned i = 0, NumOps = MI->getNumOperands(); i != NumOps; ++i) {
1565 MachineOperand &Use = MI->getOperand(i);
1566 if (Use.isRegister() && Use.isUse() && Use.getReg() &&
1567 tri_->regsOverlap(Use.getReg(), Reg)) {
1568 UseIdx = e;
1569 return &Use;
1570 }
1571 }
1568 // Ignore identity copies.
1569 unsigned SrcReg, DstReg;
1570 if (!(tii_->isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg))
1571 for (unsigned i = 0, NumOps = MI->getNumOperands(); i != NumOps; ++i) {
1572 MachineOperand &Use = MI->getOperand(i);
1573 if (Use.isRegister() && Use.isUse() && Use.getReg() &&
1574 tri_->regsOverlap(Use.getReg(), Reg)) {
1575 UseIdx = e;
1576 return &Use;
1577 }
1578 }
15721579
15731580 e -= InstrSlots::NUM;
15741581 }
0 ; RUN: llvm-as < %s | llc -march=ppc32
1
2 %struct..0objc_object = type { %struct.objc_class* }
3 %struct.NSArray = type { %struct..0objc_object }
4 %struct.NSMutableArray = type { %struct.NSArray }
5 %struct.PFTPersistentSymbols = type { %struct..0objc_object, %struct.VMUSymbolicator*, %struct.NSMutableArray*, %struct.__CFDictionary*, %struct.__CFDictionary*, %struct.__CFDictionary*, %struct.__CFDictionary*, %struct.NSMutableArray*, i8, %struct.pthread_mutex_t, %struct.NSMutableArray*, %struct.pthread_rwlock_t }
6 %struct.VMUMachTaskContainer = type { %struct..0objc_object, i32, i32 }
7 %struct.VMUSymbolicator = type { %struct..0objc_object, %struct.NSMutableArray*, %struct.NSArray*, %struct.NSArray*, %struct.VMUMachTaskContainer*, i8 }
8 %struct.__CFDictionary = type opaque
9 %struct.__builtin_CFString = type { i32*, i32, i8*, i32 }
10 %struct.objc_class = type opaque
11 %struct.objc_selector = type opaque
12 %struct.pthread_mutex_t = type { i32, [40 x i8] }
13 %struct.pthread_rwlock_t = type { i32, [124 x i8] }
14 external constant %struct.__builtin_CFString ; <%struct.__builtin_CFString*>:0 [#uses=1]
15
16 define void @"-[PFTPersistentSymbols saveSymbolWithName:address:path:lineNumber:flags:owner:]"(%struct.PFTPersistentSymbols* %self, %struct.objc_selector* %_cmd, %struct.NSArray* %name, i64 %address, %struct.NSArray* %path, i32 %lineNumber, i64 %flags, %struct..0objc_object* %owner) nounwind {
17 entry:
18 br i1 false, label %bb12, label %bb21
19 bb12: ; preds = %entry
20 %tmp17 = tail call i8 inttoptr (i64 4294901504 to i8 (%struct..0objc_object*, %struct.objc_selector*, %struct.NSArray*)*)( %struct..0objc_object* null, %struct.objc_selector* null, %struct.NSArray* bitcast (%struct.__builtin_CFString* @0 to %struct.NSArray*) ) signext nounwind ; [#uses=0]
21 br i1 false, label %bb25, label %bb21
22 bb21: ; preds = %bb12, %entry
23 %tmp24 = or i64 %flags, 4 ; [#uses=1]
24 br label %bb25
25 bb25: ; preds = %bb21, %bb12
26 %flags_addr.0 = phi i64 [ %tmp24, %bb21 ], [ %flags, %bb12 ] ; [#uses=1]
27 %tmp3233 = trunc i64 %flags_addr.0 to i32 ; [#uses=0]
28 ret void
29 }