mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
[TargetTransformInfo] Add pow2 analysis for scalar constants
Add ConstantInt analysis to getOperandInfo so we get more realistic div/rem expansion costs comparable to the vector costs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336827 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user