Skip to content

Commit 910aee7

Browse files
KornevNikitaMrSidims
authored andcommitted
Apply suggestion
1 parent fbb53e6 commit 910aee7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/SPIRV/SPIRVReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ bool SPIRVToLLVM::postProcessOCLBuiltinWithArrayArguments(
14241424
auto Zero =
14251425
ConstantInt::getNullValue(Type::getInt32Ty(T->getContext()));
14261426
Value *Index[] = {Zero, Zero};
1427-
I = GetElementPtrInst::CreateInBounds(nullptr, Alloca, Index, "", CI);
1427+
I = GetElementPtrInst::CreateInBounds(T, Alloca, Index, "", CI);
14281428
}
14291429
return Name.str();
14301430
},

lib/SPIRV/SPIRVUtil.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,8 +1184,7 @@ Value *getScalarOrArrayConstantInt(Instruction *Pos, Type *T, unsigned Len,
11841184
new StoreInst(CA, Alloca, Pos);
11851185
auto Zero = ConstantInt::getNullValue(Type::getInt32Ty(T->getContext()));
11861186
Value *Index[] = {Zero, Zero};
1187-
auto *Ret =
1188-
GetElementPtrInst::CreateInBounds(nullptr, Alloca, Index, "", Pos);
1187+
auto *Ret = GetElementPtrInst::CreateInBounds(AT, Alloca, Index, "", Pos);
11891188
LLVM_DEBUG(dbgs() << "[getScalarOrArrayConstantInt] Alloca: " << *Alloca
11901189
<< ", Return: " << *Ret << '\n');
11911190
return Ret;

0 commit comments

Comments
 (0)