forked from OSchip/llvm-project
[GISel][CombinerHelper] Use uses() instead of operands() when traversing use operands.
NFC
This commit is contained in:
parent
304abde077
commit
98ceac4981
|
@ -109,10 +109,7 @@ bool CombinerHelper::matchCombineConcatVectors(MachineInstr &MI, bool &IsUndef,
|
||||||
// Walk over all the operands of concat vectors and check if they are
|
// Walk over all the operands of concat vectors and check if they are
|
||||||
// build_vector themselves or undef.
|
// build_vector themselves or undef.
|
||||||
// Then collect their operands in Ops.
|
// Then collect their operands in Ops.
|
||||||
for (const MachineOperand &MO : MI.operands()) {
|
for (const MachineOperand &MO : MI.uses()) {
|
||||||
// Skip the instruction definition.
|
|
||||||
if (MO.isDef())
|
|
||||||
continue;
|
|
||||||
Register Reg = MO.getReg();
|
Register Reg = MO.getReg();
|
||||||
MachineInstr *Def = MRI.getVRegDef(Reg);
|
MachineInstr *Def = MRI.getVRegDef(Reg);
|
||||||
assert(Def && "Operand not defined");
|
assert(Def && "Operand not defined");
|
||||||
|
@ -121,12 +118,8 @@ bool CombinerHelper::matchCombineConcatVectors(MachineInstr &MI, bool &IsUndef,
|
||||||
IsUndef = false;
|
IsUndef = false;
|
||||||
// Remember the operands of the build_vector to fold
|
// Remember the operands of the build_vector to fold
|
||||||
// them into the yet-to-build flattened concat vectors.
|
// them into the yet-to-build flattened concat vectors.
|
||||||
for (const MachineOperand &BuildVecMO : Def->operands()) {
|
for (const MachineOperand &BuildVecMO : Def->uses())
|
||||||
// Skip the definition.
|
|
||||||
if (BuildVecMO.isDef())
|
|
||||||
continue;
|
|
||||||
Ops.push_back(BuildVecMO.getReg());
|
Ops.push_back(BuildVecMO.getReg());
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case TargetOpcode::G_IMPLICIT_DEF: {
|
case TargetOpcode::G_IMPLICIT_DEF: {
|
||||||
LLT OpType = MRI.getType(Reg);
|
LLT OpType = MRI.getType(Reg);
|
||||||
|
|
Loading…
Reference in New Issue