diff options
author | Quentin Colombet <qcolombet@apple.com> | 2019-11-15 13:33:35 -0800 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2019-11-15 13:54:33 -0800 |
commit | 98ceac498167cfadb05c5bd7590525d75bda01c4 (patch) | |
tree | 100a5d11167c4a05cc2a6612ae477031637653fb | |
parent | 304abde0779ba036bde985b33eabbc6113cf0189 (diff) | |
download | bcm5719-llvm-98ceac498167cfadb05c5bd7590525d75bda01c4.tar.gz bcm5719-llvm-98ceac498167cfadb05c5bd7590525d75bda01c4.zip |
[GISel][CombinerHelper] Use uses() instead of operands() when traversing use operands.
NFC
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index 504f0eb7600..bcf31e16142 100644 --- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -109,10 +109,7 @@ bool CombinerHelper::matchCombineConcatVectors(MachineInstr &MI, bool &IsUndef, // Walk over all the operands of concat vectors and check if they are // build_vector themselves or undef. // Then collect their operands in Ops. - for (const MachineOperand &MO : MI.operands()) { - // Skip the instruction definition. - if (MO.isDef()) - continue; + for (const MachineOperand &MO : MI.uses()) { Register Reg = MO.getReg(); MachineInstr *Def = MRI.getVRegDef(Reg); assert(Def && "Operand not defined"); @@ -121,12 +118,8 @@ bool CombinerHelper::matchCombineConcatVectors(MachineInstr &MI, bool &IsUndef, IsUndef = false; // Remember the operands of the build_vector to fold // them into the yet-to-build flattened concat vectors. - for (const MachineOperand &BuildVecMO : Def->operands()) { - // Skip the definition. - if (BuildVecMO.isDef()) - continue; + for (const MachineOperand &BuildVecMO : Def->uses()) Ops.push_back(BuildVecMO.getReg()); - } break; case TargetOpcode::G_IMPLICIT_DEF: { LLT OpType = MRI.getType(Reg); |