summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/IRBuilder.cpp
diff options
context:
space:
mode:
authorSander de Smalen <sander.desmalen@arm.com>2019-06-13 09:37:38 +0000
committerSander de Smalen <sander.desmalen@arm.com>2019-06-13 09:37:38 +0000
commit51c2fa0e2ac1ee0afdffb45ff3c2bac4bf09c3cf (patch)
tree49360c0aef3239b611cbd42593dc54c2f6470098 /llvm/lib/IR/IRBuilder.cpp
parent8d59f5370d46a2b9cb2714a3342eb58bacd52580 (diff)
downloadbcm5719-llvm-51c2fa0e2ac1ee0afdffb45ff3c2bac4bf09c3cf.tar.gz
bcm5719-llvm-51c2fa0e2ac1ee0afdffb45ff3c2bac4bf09c3cf.zip
Improve reduction intrinsics by overloading result value.
This patch uses the mechanism from D62995 to strengthen the definitions of the reduction intrinsics by letting the scalar result/accumulator type be overloaded from the vector element type. For example: ; The LLVM LangRef specifies that the scalar result must equal the ; vector element type, but this is not checked/enforced by LLVM. declare i32 @llvm.experimental.vector.reduce.or.i32.v4i32(<4 x i32> %a) This patch changes that into: declare i32 @llvm.experimental.vector.reduce.or.v4i32(<4 x i32> %a) Which has the type-constraint more explicit and causes LLVM to check the result type with the vector element type. Reviewers: RKSimon, arsenm, rnk, greened, aemerson Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D62996 llvm-svn: 363240
Diffstat (limited to 'llvm/lib/IR/IRBuilder.cpp')
-rw-r--r--llvm/lib/IR/IRBuilder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/IRBuilder.cpp b/llvm/lib/IR/IRBuilder.cpp
index 36c823e7a10..0c6461c9078 100644
--- a/llvm/lib/IR/IRBuilder.cpp
+++ b/llvm/lib/IR/IRBuilder.cpp
@@ -313,7 +313,7 @@ static CallInst *getReductionIntrinsic(IRBuilderBase *Builder, Intrinsic::ID ID,
Value *Src) {
Module *M = Builder->GetInsertBlock()->getParent()->getParent();
Value *Ops[] = {Src};
- Type *Tys[] = { Src->getType()->getVectorElementType(), Src->getType() };
+ Type *Tys[] = { Src->getType() };
auto Decl = Intrinsic::getDeclaration(M, ID, Tys);
return createCallHelper(Decl, Ops, Builder);
}
OpenPOWER on IntegriCloud