Commit db3fdbc 1 parent 0359677 commit db3fdbc Copy full SHA for db3fdbc
File tree 1 file changed +5
-5
lines changed
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) {
153
153
continue ;
154
154
if (MO.isUse ())
155
155
UseMap[MO.getReg ()] = std::make_pair (CurrentOrder, &MI);
156
- else if (MO.isDead () && UseMap. count (MO. getReg ()))
156
+ else if (MO.isDead ()) {
157
157
// Barrier is the last instruction where MO get used. MI should not
158
158
// 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
+ }
163
163
}
164
164
165
165
if (!MI.isSafeToMove (SawStore)) {
You can’t perform that action at this time.
0 commit comments