Skip to content

Commit 1f021d5

Browse files
committed
feedback
1 parent 012a652 commit 1f021d5

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
@@ -2225,8 +2225,7 @@ bool SIFoldOperandsImpl::tryFoldImmRegSequence(MachineInstr &MI) {
22252225
SmallVector<uint64_t, 8> ImmVals;
22262226
uint64_t ImmVal = 0;
22272227
uint64_t ImmSize = 0;
2228-
for (unsigned i = 0; i < Defs.size(); ++i) {
2229-
auto &[Op, SubIdx] = Defs[i];
2228+
for (auto &[Op, SubIdx] : Defs) {
22302229
unsigned SubRegSize = TRI->getSubRegIdxSize(SubIdx);
22312230
unsigned Shift = (TRI->getChannelFromSubReg(SubIdx) % 2) * SubRegSize;
22322231
ImmSize += SubRegSize;
@@ -2245,9 +2244,6 @@ bool SIFoldOperandsImpl::tryFoldImmRegSequence(MachineInstr &MI) {
22452244
}
22462245
}
22472246

2248-
assert(ImmVals.size() > 0 &&
2249-
"REG_SEQUENCE should have at least 1 operand pair");
2250-
22512247
// Can only combine REG_SEQUENCE into one 64b immediate materialization mov.
22522248
if (DefRC == TRI->getVGPR64Class()) {
22532249
BuildMI(*MI.getParent(), MI, MI.getDebugLoc(),
@@ -2268,7 +2264,7 @@ bool SIFoldOperandsImpl::tryFoldImmRegSequence(MachineInstr &MI) {
22682264

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

0 commit comments

Comments
 (0)