Skip to content

Commit 7253491

Browse files
committed
feedback
1 parent 7e41ebe commit 7253491

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
@@ -2158,8 +2158,7 @@ bool SIFoldOperandsImpl::tryFoldImmRegSequence(MachineInstr &MI) {
21582158
SmallVector<uint64_t, 8> ImmVals;
21592159
uint64_t ImmVal = 0;
21602160
uint64_t ImmSize = 0;
2161-
for (unsigned i = 0; i < Defs.size(); ++i) {
2162-
auto &[Op, SubIdx] = Defs[i];
2161+
for (auto &[Op, SubIdx] : Defs) {
21632162
unsigned SubRegSize = TRI->getSubRegIdxSize(SubIdx);
21642163
unsigned Shift = (TRI->getChannelFromSubReg(SubIdx) % 2) * SubRegSize;
21652164
ImmSize += SubRegSize;
@@ -2178,9 +2177,6 @@ bool SIFoldOperandsImpl::tryFoldImmRegSequence(MachineInstr &MI) {
21782177
}
21792178
}
21802179

2181-
assert(ImmVals.size() > 0 &&
2182-
"REG_SEQUENCE should have at least 1 operand pair");
2183-
21842180
// Can only combine REG_SEQUENCE into one 64b immediate materialization mov.
21852181
if (DefRC == TRI->getVGPR64Class()) {
21862182
BuildMI(*MI.getParent(), MI, MI.getDebugLoc(),
@@ -2201,7 +2197,7 @@ bool SIFoldOperandsImpl::tryFoldImmRegSequence(MachineInstr &MI) {
22012197

22022198
for (unsigned i = 0; i < ImmVals.size(); ++i) {
22032199
const TargetRegisterClass *RC = TRI->getVGPR64Class();
2204-
auto MovReg = MRI->createVirtualRegister(RC);
2200+
Register MovReg = MRI->createVirtualRegister(RC);
22052201
// Duplicate vmov imm materializations (e.g., splatted operands) should get
22062202
// combined by MachineCSE pass.
22072203
BuildMI(*MI.getParent(), MI, MI.getDebugLoc(),

0 commit comments

Comments
 (0)