summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMichael Liao <michael.hliao@gmail.com>2019-07-30 19:52:01 +0000
committerMichael Liao <michael.hliao@gmail.com>2019-07-30 19:52:01 +0000
commitf3983cc14af31e8ad2e6bf3031237040a3afdbf5 (patch)
treeedd54e292802f7d1b7d3c10533ce2d9632d3a6f8 /llvm/lib
parent3a56174d85a2c815ef55a24a6935fb4771201026 (diff)
downloadbcm5719-llvm-f3983cc14af31e8ad2e6bf3031237040a3afdbf5.tar.gz
bcm5719-llvm-f3983cc14af31e8ad2e6bf3031237040a3afdbf5.zip
[NVPTX] Fix PR41651
Summary: - Use the passed `DL` directly as retrieving data layout from CS by checking the called function is not reliable. Under indirect function call, there is no called function. Subscribers: jholewinski, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65468 llvm-svn: 367349
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index ae1aa98da0e..b3fb057083e 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -1291,8 +1291,8 @@ std::string NVPTXTargetLowering::getPrototype(
O << ".param .b" << size << " _";
} else if (isa<PointerType>(retTy)) {
O << ".param .b" << PtrVT.getSizeInBits() << " _";
- } else if (retTy->isAggregateType() || retTy->isVectorTy() || retTy->isIntegerTy(128)) {
- auto &DL = CS.getCalledFunction()->getParent()->getDataLayout();
+ } else if (retTy->isAggregateType() || retTy->isVectorTy() ||
+ retTy->isIntegerTy(128)) {
O << ".param .align " << retAlignment << " .b8 _["
<< DL.getTypeAllocSize(retTy) << "]";
} else {
OpenPOWER on IntegriCloud