summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-11-14 15:04:08 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-11-14 15:04:08 +0000
commit2b166c504428cdbd0250e827c3af41f1945c79ab (patch)
tree936ad86fe7972388bb8b1ce8915531f5008ea58e /llvm/lib/Analysis
parent07e93c57a3e5cf0ae32f7ed08fcc04ccb4ce82d5 (diff)
downloadbcm5719-llvm-2b166c504428cdbd0250e827c3af41f1945c79ab.tar.gz
bcm5719-llvm-2b166c504428cdbd0250e827c3af41f1945c79ab.zip
[TTI] getOperandInfo - a broadcast shuffle means the result is OK_UniformValue
llvm-svn: 346868
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/TargetTransformInfo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 25ebcdec3be..79fe6dc7d87 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -399,6 +399,13 @@ TargetTransformInfo::getOperandInfo(Value *V, OperandValueProperties &OpProps) {
return OK_UniformConstantValue;
}
+ // A broadcast shuffle creates a uniform value.
+ // TODO: Add support for non-zero index broadcasts.
+ // TODO: Add support for different source vector width.
+ if (auto *ShuffleInst = dyn_cast<ShuffleVectorInst>(V))
+ if (ShuffleInst->isZeroEltSplat())
+ OpInfo = OK_UniformValue;
+
const Value *Splat = getSplatValue(V);
// Check for a splat of a constant or for a non uniform vector of constants
OpenPOWER on IntegriCloud