File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -153,13 +153,13 @@ bool LiveRangeShrink::runOnMachineFunction(MachineFunction &MF) {
153153 continue ;
154154 if (MO.isUse ())
155155 UseMap[MO.getReg ()] = std::make_pair (CurrentOrder, &MI);
156- else if (MO.isDead () && UseMap. count (MO. getReg ()))
156+ else if (MO.isDead ()) {
157157 // Barrier is the last instruction where MO get used. MI should not
158158 // be moved above Barrier.
159- if (Barrier < UseMap[ MO.getReg ()]. first ) {
160- Barrier = UseMap[MO. getReg ()] .first ;
161- BarrierMI = UseMap[MO. getReg ()]. second ;
162- }
159+ auto It = UseMap. find ( MO.getReg ());
160+ if (It ! = UseMap. end () && Barrier < It-> second .first )
161+ std::tie (Barrier, BarrierMI) = It-> second ;
162+ }
163163 }
164164
165165 if (!MI.isSafeToMove (SawStore)) {
You can’t perform that action at this time.
0 commit comments