File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
llvm/lib/Analysis/LiveVar Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -14,27 +14,34 @@ void LiveVarSet::applyTranferFuncForMInst(const MachineInstr *const MInst)
14
14
15
15
for ( MachineInstr::val_op_const_iterator OpI (MInst); !OpI.done () ; OpI++) {
16
16
17
- if ( OpI.isDef () ) { // kill only if this operand is a def
17
+ if ( OpI.isDef () ) // kill only if this operand is a def
18
18
remove (*OpI); // this definition kills any uses
19
- }
19
+ }
20
20
21
+ // do for implicit operands as well
22
+ for ( unsigned i=0 ; i < MInst->getNumImplicitRefs (); ++i) {
23
+ if ( MInst->implicitRefIsDefined (i) )
24
+ remove ( MInst->getImplicitRef (i) );
21
25
}
22
26
27
+
23
28
for ( MachineInstr::val_op_const_iterator OpI (MInst); !OpI.done () ; OpI++) {
24
29
25
30
if ( ((*OpI)->getType ())->isLabelType ()) continue ; // don't process labels
26
-
27
- if ( ! OpI.isDef () ) { // add only if this operand is a use
31
+
32
+ if ( ! OpI.isDef () ) // add only if this operand is a use
28
33
add ( *OpI ); // An operand is a use - so add to use set
29
- }
30
34
}
31
- }
32
-
33
-
34
-
35
35
36
+ // do for implicit operands as well
37
+ for ( unsigned i=0 ; i < MInst->getNumImplicitRefs (); ++i) {
38
+ if ( ! MInst->implicitRefIsDefined (i) )
39
+ add ( MInst->getImplicitRef (i) );
40
+ }
36
41
42
+ }
37
43
44
+
38
45
39
46
#if 0
40
47
void LiveVarSet::applyTranferFuncForInst(const Instruction *const Inst)
You can’t perform that action at this time.
0 commit comments