summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2019-06-24 12:07:11 +0000
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2019-06-24 12:07:11 +0000
commit512b1187794d33c75e4d88e8a4822aab375379c0 (patch)
tree9c1f234a7c1993e42c660360e923d439c9f3d0e6 /llvm/lib/Analysis
parent2c5ff946277b13933b3096cd1eacb1066ee7af7a (diff)
downloadbcm5719-llvm-512b1187794d33c75e4d88e8a4822aab375379c0.tar.gz
bcm5719-llvm-512b1187794d33c75e4d88e8a4822aab375379c0.zip
[Scalarizer] Add scalarizer support for smul.fix.sat
Summary: Handle smul.fix.sat in the scalarizer. This is done by adding smul.fix.sat to the set of "isTriviallyVectorizable" intrinsics. The addition of smul.fix.sat in isTriviallyVectorizable and hasVectorInstrinsicScalarOpd can also be seen as a preparation to be able to use hasVectorInstrinsicScalarOpd in ConstantFolding. Reviewers: rengolin, RKSimon, dblaikie Reviewed By: rengolin Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63704 llvm-svn: 364177
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/VectorUtils.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index 8040af12d7c..986756eb262 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -37,8 +37,9 @@ static cl::opt<unsigned> MaxInterleaveGroupFactor(
cl::init(8));
/// Return true if all of the intrinsic's arguments and return type are scalars
-/// for the scalar form of the intrinsic and vectors for the vector form of the
-/// intrinsic.
+/// for the scalar form of the intrinsic, and vectors for the vector form of the
+/// intrinsic (except operands that are marked as always being scalar by
+/// hasVectorInstrinsicScalarOpd).
bool llvm::isTriviallyVectorizable(Intrinsic::ID ID) {
switch (ID) {
case Intrinsic::bswap: // Begin integer bit-manipulation.
@@ -53,6 +54,7 @@ bool llvm::isTriviallyVectorizable(Intrinsic::ID ID) {
case Intrinsic::uadd_sat:
case Intrinsic::usub_sat:
case Intrinsic::smul_fix:
+ case Intrinsic::smul_fix_sat:
case Intrinsic::umul_fix:
case Intrinsic::sqrt: // Begin floating-point.
case Intrinsic::sin:
@@ -85,8 +87,7 @@ bool llvm::isTriviallyVectorizable(Intrinsic::ID ID) {
}
}
-/// Identifies if the intrinsic has a scalar operand. It check for
-/// ctlz,cttz and powi special intrinsics whose argument is scalar.
+/// Identifies if the vector form of the intrinsic has a scalar operand.
bool llvm::hasVectorInstrinsicScalarOpd(Intrinsic::ID ID,
unsigned ScalarOpdIdx) {
switch (ID) {
@@ -95,6 +96,7 @@ bool llvm::hasVectorInstrinsicScalarOpd(Intrinsic::ID ID,
case Intrinsic::powi:
return (ScalarOpdIdx == 1);
case Intrinsic::smul_fix:
+ case Intrinsic::smul_fix_sat:
case Intrinsic::umul_fix:
return (ScalarOpdIdx == 2);
default:
OpenPOWER on IntegriCloud