Skip to content

Commit 2b8d7f0

Browse files
committed
Address comments
1 parent 2b8d53b commit 2b8d7f0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,11 +3239,14 @@ bool SPIRVInstructionSelector::selectFirstBitSet64Overflow(
32393239
// Loops 0, 2, 4, ... but stops one loop early when ComponentCount is odd
32403240
unsigned CurrentComponent = 0;
32413241
for (; CurrentComponent + 1 < ComponentCount; CurrentComponent += 2) {
3242-
Register SubVecReg = MRI->createVirtualRegister(GR.getRegClass(I64x2Type));
3242+
// This register holds the firstbitX result for each of the i64x2 vectors
3243+
// extracted from SrcReg
3244+
Register BitSetResult =
3245+
MRI->createVirtualRegister(GR.getRegClass(I64x2Type));
32433246

32443247
auto MIB = BuildMI(*I.getParent(), I, I.getDebugLoc(),
32453248
TII.get(SPIRV::OpVectorShuffle))
3246-
.addDef(SubVecReg)
3249+
.addDef(BitSetResult)
32473250
.addUse(GR.getSPIRVTypeID(I64x2Type))
32483251
.addUse(SrcReg)
32493252
// Per the spec, repeat the vector if only one vec is needed
@@ -3258,7 +3261,7 @@ bool SPIRVInstructionSelector::selectFirstBitSet64Overflow(
32583261
Register SubVecBitSetReg =
32593262
MRI->createVirtualRegister(GR.getRegClass(Vec2ResType));
32603263

3261-
if (!selectFirstBitSet64(SubVecBitSetReg, Vec2ResType, I, SubVecReg,
3264+
if (!selectFirstBitSet64(SubVecBitSetReg, Vec2ResType, I, BitSetResult,
32623265
BitSetOpcode, SwapPrimarySide))
32633266
return false;
32643267

0 commit comments

Comments
 (0)