[PATCH] D73968: GlobalISel: Reimplement fewerElementsVectorBasic
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 4 10:40:09 PST 2020
paquette added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2617
- if (BitsForNumParts != Size) {
- Register AccumDstReg = MRI.createGenericVirtualRegister(DstTy);
- MIRBuilder.buildUndef(AccumDstReg);
-
- // Handle the pieces which evenly divide into the requested type with
- // extract/op/insert sequence.
- for (unsigned Offset = 0; Offset < BitsForNumParts; Offset += NarrowSize) {
- SmallVector<SrcOp, 4> SrcOps;
- for (unsigned I = 1, E = MI.getNumOperands(); I != E; ++I) {
- Register PartOpReg = MRI.createGenericVirtualRegister(NarrowTy);
- MIRBuilder.buildExtract(PartOpReg, MI.getOperand(I), Offset);
- SrcOps.push_back(PartOpReg);
- }
-
- Register PartDstReg = MRI.createGenericVirtualRegister(NarrowTy);
- MIRBuilder.buildInstr(Opc, {PartDstReg}, SrcOps, Flags);
-
- Register PartInsertReg = MRI.createGenericVirtualRegister(DstTy);
- MIRBuilder.buildInsert(PartInsertReg, AccumDstReg, PartDstReg, Offset);
- AccumDstReg = PartInsertReg;
- }
+ assert(NumOps <= 3);
----------------
Message for the assert would be useful here
================
Comment at: llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2624-2630
+ for (int I = 0; I != NumOps; ++I) {
+ Register SrcReg = MI.getOperand(I + 1).getReg();
+ LLT SrcTy = MRI.getType(SrcReg);
+ GCDTys[I] = extractGCDType(ExtractedRegs[I], SrcTy, NarrowTy, SrcReg);
+ LCMTys[I] = buildLCMMergePieces(SrcTy, NarrowTy, GCDTys[I],
+ ExtractedRegs[I], TargetOpcode::G_ANYEXT);
}
----------------
Comment explaining what the loop produces would be helpful.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73968/new/
https://reviews.llvm.org/D73968
More information about the llvm-commits
mailing list