summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/NVPTX
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2019-04-24 06:55:50 +0000
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2019-04-24 06:55:50 +0000
commit71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab (patch)
tree733de499705847250087e8f5a20cb95267c2e819 /llvm/lib/Target/NVPTX
parent1e413ffa7bc8939af283ab54a5dfe7ede54b1ec7 (diff)
downloadbcm5719-llvm-71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab.tar.gz
bcm5719-llvm-71e8c6f20fe4c5d9cfd6235c360d602f0d29a6ab.zip
Add "const" in GetUnderlyingObjects. NFC
Summary: Both the input Value pointer and the returned Value pointers in GetUnderlyingObjects are now declared as const. It turned out that all current (in-tree) uses of GetUnderlyingObjects were trivial to update, being satisfied with have those Value pointers declared as const. Actually, in the past several of the users had to use const_cast, just because of ValueTracking not providing a version of GetUnderlyingObjects with "const" Value pointers. With this patch we get rid of those const casts. Reviewers: hfinkel, materi, jkorous Reviewed By: jkorous Subscribers: dexonsmith, jkorous, jholewinski, sdardis, eraman, hiraditya, jrtc27, atanasyan, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61038 llvm-svn: 359072
Diffstat (limited to 'llvm/lib/Target/NVPTX')
-rw-r--r--llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp b/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
index d6e44b785ea..4542e60c97e 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
@@ -701,11 +701,11 @@ static bool canLowerToLDG(MemSDNode *N, const NVPTXSubtarget &Subtarget,
// We use GetUnderlyingObjects() here instead of GetUnderlyingObject() mainly
// because the former looks through phi nodes while the latter does not. We
// need to look through phi nodes to handle pointer induction variables.
- SmallVector<Value *, 8> Objs;
- GetUnderlyingObjects(const_cast<Value *>(N->getMemOperand()->getValue()),
+ SmallVector<const Value *, 8> Objs;
+ GetUnderlyingObjects(N->getMemOperand()->getValue(),
Objs, F->getDataLayout());
- return all_of(Objs, [&](Value *V) {
+ return all_of(Objs, [&](const Value *V) {
if (auto *A = dyn_cast<const Argument>(V))
return IsKernelFn && A->onlyReadsMemory() && A->hasNoAliasAttr();
if (auto *GV = dyn_cast<const GlobalVariable>(V))
OpenPOWER on IntegriCloud