[llvm] ccee390 - GlobalISel: NFC minor cleanup to avoid a couple of fixed size local arrays
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 25 01:49:34 PST 2020
Author: Jay Foad
Date: 2020-02-25T09:49:19Z
New Revision: ccee390767ca963d541e0b1c7c8587d1fbde505f
URL: https://github.com/llvm/llvm-project/commit/ccee390767ca963d541e0b1c7c8587d1fbde505f
DIFF: https://github.com/llvm/llvm-project/commit/ccee390767ca963d541e0b1c7c8587d1fbde505f.diff
LOG: GlobalISel: NFC minor cleanup to avoid a couple of fixed size local arrays
Added:
Modified:
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index d8767d1c3068..3a4f20cdc68d 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -2574,8 +2574,6 @@ LegalizerHelper::fewerElementsVectorBasic(MachineInstr &MI, unsigned TypeIdx,
assert(NumOps <= 3 && "expected instrution with 1 result and 1-3 sources");
- LLT GCDTys[3];
- LLT LCMTys[3];
SmallVector<Register, 8> ExtractedRegs[3];
SmallVector<Register, 8> Parts;
@@ -2584,11 +2582,11 @@ LegalizerHelper::fewerElementsVectorBasic(MachineInstr &MI, unsigned TypeIdx,
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);
+ LLT GCDTy = extractGCDType(ExtractedRegs[I], SrcTy, NarrowTy, SrcReg);
// Build a sequence of NarrowTy pieces in ExtractedRegs for this operand.
- LCMTys[I] = buildLCMMergePieces(SrcTy, NarrowTy, GCDTys[I],
- ExtractedRegs[I], TargetOpcode::G_ANYEXT);
+ buildLCMMergePieces(SrcTy, NarrowTy, GCDTy, ExtractedRegs[I],
+ TargetOpcode::G_ANYEXT);
}
SmallVector<Register, 8> ResultRegs;
@@ -2620,7 +2618,9 @@ LegalizerHelper::fewerElementsVectorBasic(MachineInstr &MI, unsigned TypeIdx,
ResultRegs.append(NumUndefParts, MIRBuilder.buildUndef(NarrowTy).getReg(0));
// Extract the possibly padded result to the original result register.
- buildWidenedRemergeToDst(DstReg, LCMTys[0], ResultRegs);
+ LLT DstTy = MRI.getType(DstReg);
+ LLT LCMTy = getLCMType(DstTy, NarrowTy);
+ buildWidenedRemergeToDst(DstReg, LCMTy, ResultRegs);
MI.eraseFromParent();
return Legalized;
More information about the llvm-commits
mailing list