forked from OSchip/llvm-project
[NVPTX] Pass explicit GEP type (NFC)
Use source element type of original GEP, as we're just changing the address space.
This commit is contained in:
parent
f57d396dca
commit
b5a7da4391
|
@ -177,7 +177,8 @@ static void convertToParamAS(Value *OldUser, Value *Param) {
|
||||||
}
|
}
|
||||||
if (auto *GEP = dyn_cast<GetElementPtrInst>(I.OldInstruction)) {
|
if (auto *GEP = dyn_cast<GetElementPtrInst>(I.OldInstruction)) {
|
||||||
SmallVector<Value *, 4> Indices(GEP->indices());
|
SmallVector<Value *, 4> Indices(GEP->indices());
|
||||||
auto *NewGEP = GetElementPtrInst::Create(nullptr, I.NewParam, Indices,
|
auto *NewGEP = GetElementPtrInst::Create(GEP->getSourceElementType(),
|
||||||
|
I.NewParam, Indices,
|
||||||
GEP->getName(), GEP);
|
GEP->getName(), GEP);
|
||||||
NewGEP->setIsInBounds(GEP->isInBounds());
|
NewGEP->setIsInBounds(GEP->isInBounds());
|
||||||
return NewGEP;
|
return NewGEP;
|
||||||
|
|
Loading…
Reference in New Issue