aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/IntrinsicInst.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-12-25 22:30:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-12-25 22:30:44 +0000
commit77fc4c146f0870ffb09c1afb823ccbe742c5e6ff (patch)
tree5c0eb39553003b9c75a901af6bc4ddabd6f2f28c /llvm/lib/IR/IntrinsicInst.cpp
parentf65dcba83ce5035ab88a85fe17628b447eb56e1b (diff)
Vendor import of llvm-project main llvmorg-14-init-13186-g0c553cc1af2e.vendor/llvm-project/llvmorg-14-init-13186-g0c553cc1af2e
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r--llvm/lib/IR/IntrinsicInst.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index 9206cd37a6d1..8f7318665cfb 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -468,6 +468,7 @@ bool VPIntrinsic::canIgnoreVectorLengthParam() const {
}
Function *VPIntrinsic::getDeclarationForParams(Module *M, Intrinsic::ID VPID,
+ Type *ReturnType,
ArrayRef<Value *> Params) {
assert(isVPIntrinsic(VPID) && "not a VP intrinsic");
Function *VPFunc;
@@ -486,22 +487,15 @@ Function *VPIntrinsic::getDeclarationForParams(Module *M, Intrinsic::ID VPID,
break;
case Intrinsic::vp_load:
VPFunc = Intrinsic::getDeclaration(
- M, VPID,
- {Params[0]->getType()->getPointerElementType(), Params[0]->getType()});
+ M, VPID, {ReturnType, Params[0]->getType()});
break;
case Intrinsic::vp_gather:
VPFunc = Intrinsic::getDeclaration(
- M, VPID,
- {VectorType::get(cast<VectorType>(Params[0]->getType())
- ->getElementType()
- ->getPointerElementType(),
- cast<VectorType>(Params[0]->getType())),
- Params[0]->getType()});
+ M, VPID, {ReturnType, Params[0]->getType()});
break;
case Intrinsic::vp_store:
VPFunc = Intrinsic::getDeclaration(
- M, VPID,
- {Params[1]->getType()->getPointerElementType(), Params[1]->getType()});
+ M, VPID, {Params[0]->getType(), Params[1]->getType()});
break;
case Intrinsic::vp_scatter:
VPFunc = Intrinsic::getDeclaration(