summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/TargetTransformInfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 2bbc074186a..9de2f789c89 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -636,6 +636,12 @@ getOperandInfo(Value *V, TargetTransformInfo::OperandValueProperties &OpProps) {
TargetTransformInfo::OK_AnyValue;
OpProps = TargetTransformInfo::OP_None;
+ if (auto *CI = dyn_cast<ConstantInt>(V)) {
+ if (CI->getValue().isPowerOf2())
+ OpProps = TargetTransformInfo::OP_PowerOf2;
+ return TargetTransformInfo::OK_UniformConstantValue;
+ }
+
const Value *Splat = getSplatValue(V);
// Check for a splat of a constant or for a non uniform vector of constants
OpenPOWER on IntegriCloud