Skip to content

Commit 396ba9e

Browse files
author
Thorsten Schütt
committed
address review comments
1 parent b62e1a1 commit 396ba9e

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,19 +1181,7 @@ class MachineIRBuilder {
11811181
/// \pre \p Res must be a generic virtual register with scalar type.
11821182
///
11831183
/// \return a MachineInstrBuilder for the newly created instruction.
1184-
MachineInstrBuilder buildStepVector(const DstOp &Res,
1185-
const ConstantInt &Step);
1186-
1187-
/// Build and insert \p Res = G_STEP_VECTOR \p Step
1188-
///
1189-
/// G_STEP_VECTOR returns a scalable vector of linear sequence of step \p Step
1190-
/// into \p Res.
1191-
///
1192-
/// \pre setBasicBlock or setMI must have been called.
1193-
/// \pre \p Res must be a generic virtual register with scalar type.
1194-
///
1195-
/// \return a MachineInstrBuilder for the newly created instruction.
1196-
MachineInstrBuilder buildStepVector(const DstOp &Res, const APInt &Step);
1184+
MachineInstrBuilder buildStepVector(const DstOp &Res, unsigned Step);
11971185

11981186
/// Build and insert \p Res = G_VSCALE \p MinElts
11991187
///

llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -810,17 +810,14 @@ MachineInstrBuilder MachineIRBuilder::buildInsert(const DstOp &Res,
810810
}
811811

812812
MachineInstrBuilder MachineIRBuilder::buildStepVector(const DstOp &Res,
813-
const APInt &Step) {
814-
ConstantInt *CI = ConstantInt::get(getMF().getFunction().getContext(), Step);
815-
return buildStepVector(Res, *CI);
816-
}
813+
unsigned Step) {
814+
ConstantInt *CI =
815+
ConstantInt::get(getMF().getFunction().getContext(), APInt(64, Step));
817816

818-
MachineInstrBuilder MachineIRBuilder::buildStepVector(const DstOp &Res,
819-
const ConstantInt &Step) {
820817
auto StepVector = buildInstr(TargetOpcode::G_STEP_VECTOR);
821818
StepVector->setDebugLoc(DebugLoc());
822819
Res.addDefToMIB(*getMRI(), StepVector);
823-
StepVector.addCImm(&Step);
820+
StepVector.addCImm(CI);
824821
return StepVector;
825822
}
826823

0 commit comments

Comments
 (0)