@@ -280,15 +280,13 @@ class MachineRegisterInfo {
280280 template <bool Uses, bool Defs, bool SkipDebug,
281281 bool ByOperand, bool ByInstr, bool ByBundle>
282282 class defusechain_iterator ;
283- template <bool Uses, bool Defs, bool SkipDebug,
284- bool ByOperand, bool ByInstr, bool ByBundle>
283+ template <bool Uses, bool Defs, bool SkipDebug, bool ByInstr>
285284 class defusechain_instr_iterator ;
286285
287286 // Make it a friend so it can access getNextOperandForReg().
288287 template <bool , bool , bool , bool , bool , bool >
289288 friend class defusechain_iterator ;
290- template <bool , bool , bool , bool , bool , bool >
291- friend class defusechain_instr_iterator ;
289+ template <bool , bool , bool , bool > friend class defusechain_instr_iterator ;
292290
293291 // / reg_iterator/reg_begin/reg_end - Walk all defs and uses of the specified
294292 // / register.
@@ -306,7 +304,7 @@ class MachineRegisterInfo {
306304 // / reg_instr_iterator/reg_instr_begin/reg_instr_end - Walk all defs and uses
307305 // / of the specified register, stepping by MachineInstr.
308306 using reg_instr_iterator =
309- defusechain_instr_iterator<true , true , false , false , true , false >;
307+ defusechain_instr_iterator<true , true , false , /* ByInstr= */ true >;
310308 reg_instr_iterator reg_instr_begin (Register RegNo) const {
311309 return reg_instr_iterator (getRegUseDefListHead (RegNo));
312310 }
@@ -322,7 +320,7 @@ class MachineRegisterInfo {
322320 // / reg_bundle_iterator/reg_bundle_begin/reg_bundle_end - Walk all defs and uses
323321 // / of the specified register, stepping by bundle.
324322 using reg_bundle_iterator =
325- defusechain_instr_iterator<true , true , false , false , false , true >;
323+ defusechain_instr_iterator<true , true , false , /* ByInstr= */ false >;
326324 reg_bundle_iterator reg_bundle_begin (Register RegNo) const {
327325 return reg_bundle_iterator (getRegUseDefListHead (RegNo));
328326 }
@@ -358,7 +356,7 @@ class MachineRegisterInfo {
358356 // / all defs and uses of the specified register, stepping by MachineInstr,
359357 // / skipping those marked as Debug.
360358 using reg_instr_nodbg_iterator =
361- defusechain_instr_iterator<true , true , true , false , true , false >;
359+ defusechain_instr_iterator<true , true , true , /* ByInstr= */ true >;
362360 reg_instr_nodbg_iterator reg_instr_nodbg_begin (Register RegNo) const {
363361 return reg_instr_nodbg_iterator (getRegUseDefListHead (RegNo));
364362 }
@@ -375,7 +373,7 @@ class MachineRegisterInfo {
375373 // / all defs and uses of the specified register, stepping by bundle,
376374 // / skipping those marked as Debug.
377375 using reg_bundle_nodbg_iterator =
378- defusechain_instr_iterator<true , true , true , false , false , true >;
376+ defusechain_instr_iterator<true , true , true , /* ByInstr= */ false >;
379377 reg_bundle_nodbg_iterator reg_bundle_nodbg_begin (Register RegNo) const {
380378 return reg_bundle_nodbg_iterator (getRegUseDefListHead (RegNo));
381379 }
@@ -409,7 +407,7 @@ class MachineRegisterInfo {
409407 // / def_instr_iterator/def_instr_begin/def_instr_end - Walk all defs of the
410408 // / specified register, stepping by MachineInst.
411409 using def_instr_iterator =
412- defusechain_instr_iterator<false , true , false , false , true , false >;
410+ defusechain_instr_iterator<false , true , false , /* ByInstr= */ true >;
413411 def_instr_iterator def_instr_begin (Register RegNo) const {
414412 return def_instr_iterator (getRegUseDefListHead (RegNo));
415413 }
@@ -425,7 +423,7 @@ class MachineRegisterInfo {
425423 // / def_bundle_iterator/def_bundle_begin/def_bundle_end - Walk all defs of the
426424 // / specified register, stepping by bundle.
427425 using def_bundle_iterator =
428- defusechain_instr_iterator<false , true , false , false , false , true >;
426+ defusechain_instr_iterator<false , true , false , /* ByInstr= */ false >;
429427 def_bundle_iterator def_bundle_begin (Register RegNo) const {
430428 return def_bundle_iterator (getRegUseDefListHead (RegNo));
431429 }
@@ -489,7 +487,7 @@ class MachineRegisterInfo {
489487 // / use_instr_iterator/use_instr_begin/use_instr_end - Walk all uses of the
490488 // / specified register, stepping by MachineInstr.
491489 using use_instr_iterator =
492- defusechain_instr_iterator<true , false , false , false , true , false >;
490+ defusechain_instr_iterator<true , false , false , /* ByInstr= */ true >;
493491 use_instr_iterator use_instr_begin (Register RegNo) const {
494492 return use_instr_iterator (getRegUseDefListHead (RegNo));
495493 }
@@ -505,7 +503,7 @@ class MachineRegisterInfo {
505503 // / use_bundle_iterator/use_bundle_begin/use_bundle_end - Walk all uses of the
506504 // / specified register, stepping by bundle.
507505 using use_bundle_iterator =
508- defusechain_instr_iterator<true , false , false , false , false , true >;
506+ defusechain_instr_iterator<true , false , false , /* ByInstr= */ false >;
509507 use_bundle_iterator use_bundle_begin (Register RegNo) const {
510508 return use_bundle_iterator (getRegUseDefListHead (RegNo));
511509 }
@@ -547,7 +545,7 @@ class MachineRegisterInfo {
547545 // / all uses of the specified register, stepping by MachineInstr, skipping
548546 // / those marked as Debug.
549547 using use_instr_nodbg_iterator =
550- defusechain_instr_iterator<true , false , true , false , true , false >;
548+ defusechain_instr_iterator<true , false , true , /* ByInstr= */ true >;
551549 use_instr_nodbg_iterator use_instr_nodbg_begin (Register RegNo) const {
552550 return use_instr_nodbg_iterator (getRegUseDefListHead (RegNo));
553551 }
@@ -564,7 +562,7 @@ class MachineRegisterInfo {
564562 // / all uses of the specified register, stepping by bundle, skipping
565563 // / those marked as Debug.
566564 using use_bundle_nodbg_iterator =
567- defusechain_instr_iterator<true , false , true , false , false , true >;
565+ defusechain_instr_iterator<true , false , true , /* ByInstr= */ false >;
568566 use_bundle_nodbg_iterator use_bundle_nodbg_begin (Register RegNo) const {
569567 return use_bundle_nodbg_iterator (getRegUseDefListHead (RegNo));
570568 }
@@ -1151,8 +1149,7 @@ class MachineRegisterInfo {
11511149 // / returns defs. If neither are true then you are silly and it always
11521150 // / returns end(). If SkipDebug is true it skips uses marked Debug
11531151 // / when incrementing.
1154- template <bool ReturnUses, bool ReturnDefs, bool SkipDebug, bool ByOperand,
1155- bool ByInstr, bool ByBundle>
1152+ template <bool ReturnUses, bool ReturnDefs, bool SkipDebug, bool ByInstr>
11561153 class defusechain_instr_iterator {
11571154 friend class MachineRegisterInfo ;
11581155
@@ -1210,14 +1207,12 @@ class MachineRegisterInfo {
12101207 // Iterator traversal: forward iteration only
12111208 defusechain_instr_iterator &operator ++() { // Preincrement
12121209 assert (Op && " Cannot increment end iterator!" );
1213- if (ByOperand)
1214- advance ();
1215- else if (ByInstr) {
1210+ if (ByInstr) {
12161211 MachineInstr *P = Op->getParent ();
12171212 do {
12181213 advance ();
12191214 } while (Op && Op->getParent () == P);
1220- } else if (ByBundle) {
1215+ } else {
12211216 MachineBasicBlock::instr_iterator P =
12221217 getBundleStart (Op->getParent ()->getIterator ());
12231218 do {
@@ -1234,7 +1229,7 @@ class MachineRegisterInfo {
12341229 // Retrieve a reference to the current operand.
12351230 MachineInstr &operator *() const {
12361231 assert (Op && " Cannot dereference end iterator!" );
1237- if (ByBundle )
1232+ if (!ByInstr )
12381233 return *getBundleStart (Op->getParent ()->getIterator ());
12391234 return *Op->getParent ();
12401235 }
0 commit comments