rdar://12100355 (part 1)

This revision attempts to recognize following population-count pattern:

 while(a) { c++; ... ; a &= a - 1; ... },
  where <c> and <a>could be used multiple times in the loop body.

 TODO: On X8664 and ARM, __buildin_ctpop() are not expanded to a efficent 
instruction sequence, which need to be improved in the following commits.

Reviewed by Nadav, really appreciate!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168931 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Shuxin Yang
2012-11-29 19:38:54 +00:00
parent 7360116048
commit 84fca61ca5
7 changed files with 646 additions and 40 deletions

View File

@@ -26,7 +26,7 @@ class TargetLowering;
/// ScalarTargetTransformInfo interface. Different targets can implement
/// this interface differently.
class ScalarTargetTransformImpl : public ScalarTargetTransformInfo {
private:
protected:
const TargetLowering *TLI;
public: