projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f57d396
)
[NVPTX] Pass explicit GEP type (NFC)
author
Nikita Popov
<nikita.ppv@gmail.com>
Thu, 8 Jul 2021 18:59:56 +0000
(20:59 +0200)
committer
Nikita Popov
<nikita.ppv@gmail.com>
Thu, 8 Jul 2021 19:21:43 +0000
(21:21 +0200)
Use source element type of original GEP, as we're just changing
the address space.
llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
b/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
index
66cbd6e
..
ddb7f09
100644
(file)
--- a/
llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
+++ b/
llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
@@
-177,7
+177,8
@@
static void convertToParamAS(Value *OldUser, Value *Param) {
}
if (auto *GEP = dyn_cast<GetElementPtrInst>(I.OldInstruction)) {
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);
NewGEP->setIsInBounds(GEP->isInBounds());
return NewGEP;