diff options
Diffstat (limited to 'include/llvm/TargetTransformInfo.h')
-rw-r--r-- | include/llvm/TargetTransformInfo.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/TargetTransformInfo.h b/include/llvm/TargetTransformInfo.h index db9cc66..a18cef6 100644 --- a/include/llvm/TargetTransformInfo.h +++ b/include/llvm/TargetTransformInfo.h @@ -75,6 +75,18 @@ public: /// LSR, and LowerInvoke use this interface. class ScalarTargetTransformInfo { public: + /// PopcntHwSupport - Hardware support for population count. Compared to the + /// SW implementation, HW support is supposed to significantly boost the + /// performance when the population is dense, and it may or not may degrade + /// performance if the population is sparse. A HW support is considered as + /// "Fast" if it can outperform, or is on a par with, SW implementaion when + /// the population is sparse; otherwise, it is considered as "Slow". + enum PopcntHwSupport { + None, + Fast, + Slow + }; + virtual ~ScalarTargetTransformInfo() {} /// isLegalAddImmediate - Return true if the specified immediate is legal @@ -122,6 +134,11 @@ public: virtual bool shouldBuildLookupTables() const { return true; } + + /// getPopcntHwSupport - Return hardware support for population count. + virtual PopcntHwSupport getPopcntHwSupport(unsigned IntTyWidthInBit) const { + return None; + } }; /// VectorTargetTransformInfo - This interface is used by the vectorizers |