Skip to content

Commit 6b393a8

Browse files
committed
feedback
1 parent 9ea79f3 commit 6b393a8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Target/AMDGPU/SIFoldOperands.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,8 +2220,7 @@ bool SIFoldOperandsImpl::tryFoldImmRegSequence(MachineInstr &MI) {
22202220
SmallVector<uint64_t, 8> ImmVals;
22212221
uint64_t ImmVal = 0;
22222222
uint64_t ImmSize = 0;
2223-
for (unsigned i = 0; i < Defs.size(); ++i) {
2224-
auto &[Op, SubIdx] = Defs[i];
2223+
for (auto &[Op, SubIdx] : Defs) {
22252224
unsigned SubRegSize = TRI->getSubRegIdxSize(SubIdx);
22262225
unsigned Shift = (TRI->getChannelFromSubReg(SubIdx) % 2) * SubRegSize;
22272226
ImmSize += SubRegSize;
@@ -2240,9 +2239,6 @@ bool SIFoldOperandsImpl::tryFoldImmRegSequence(MachineInstr &MI) {
22402239
}
22412240
}
22422241

2243-
assert(ImmVals.size() > 0 &&
2244-
"REG_SEQUENCE should have at least 1 operand pair");
2245-
22462242
// Can only combine REG_SEQUENCE into one 64b immediate materialization mov.
22472243
if (DefRC == TRI->getVGPR64Class()) {
22482244
BuildMI(*MI.getParent(), MI, MI.getDebugLoc(),
@@ -2263,7 +2259,7 @@ bool SIFoldOperandsImpl::tryFoldImmRegSequence(MachineInstr &MI) {
22632259

22642260
for (unsigned i = 0; i < ImmVals.size(); ++i) {
22652261
const TargetRegisterClass *RC = TRI->getVGPR64Class();
2266-
auto MovReg = MRI->createVirtualRegister(RC);
2262+
Register MovReg = MRI->createVirtualRegister(RC);
22672263
// Duplicate vmov imm materializations (e.g., splatted operands) should get
22682264
// combined by MachineCSE pass.
22692265
BuildMI(*MI.getParent(), MI, MI.getDebugLoc(),

0 commit comments

Comments
 (0)