Skip to content

Commit 83d83c6

Browse files
tuStromaigcbot
authored andcommitted
Int size mismatch in createShl() function
While creating shl instruction the shift integer size was always 32-bit int. It could cause assert in llvm code if output instruction type was different than i32.
1 parent d56c1b8 commit 83d83c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IGC/Compiler/FixResourcePtr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Value* FixResourcePtr::GetByteOffset(Instruction* eltPtr)
224224
}
225225
else if (eltSize.isPowerOf2())
226226
{
227-
APInt shift = APInt(32, eltSize.logBase2());
227+
APInt shift = APInt(eltIdx->getType()->getScalarSizeInBits(), eltSize.logBase2());
228228
offsetValue = builder->CreateShl(eltIdx, shift);
229229
}
230230
else

0 commit comments

Comments
 (0)