[llvm-commits] [PATCH] Population-count loop idiom recognization

Shuxin Yang shuxin.llvm at gmail.com
Mon Nov 19 16:39:41 PST 2012


Hi, Dmitri:

    Thank you for pointing out these problems. I will fix them in the 
revised patch.

Best Regards!
Shuxin

On 11/19/2012 01:28 PM, Dmitri Gribenko wrote:
> Hi Shuxin,
>
> Just mechanical issues (I'm not familiar with this part of LLVM):
>
> +  /// CreateCtpop - Create and insert ctpop.
> +  CallInst *CreateCtpop(Value *Val);
>
> Please don't duplicate function or class name inside the comment.  Old
> code is written that way, but current coding style advises not to
> duplicate.
>
> +  assert(!(TyWidth & (TyWidth - 1)) && "Ty width must be power of 2");
>
> Please call isPowerOf2_32 from llvm/Support/MathExtras.h.
>
> +CallInst *IRBuilderBase::
> +CreateCtpop(Value *Val) {
>
> No newline after '::' needed.
>
> +  class LIRUtil {
> +  public:
>
> This class has no data members, and all member functions are static.
> It makes sense to just put these functions in the anonymous namespace.
>
> +    static BranchInst *getBranch(BasicBlock * BB) {
>
> No space before '*', please.
>
> Dmitri
>




More information about the llvm-commits mailing list