> +  /// getAlignment - Return the alignment of the access that is  
> being performed
> +  ///
> +  unsigned getAlignment() const {
> +    signed Log2AlignVal = ((SubclassData>>1)-1);
> +    return ((Log2AlignVal < 0) ? 0 : 1<<Log2AlignVal);
> +  }

I think that this can be written as:
    ((1 << (SubclassData>>1)) >> 1

which is branchless and simpler.

> +  /// getAlignment - Return the alignment of the access that is  
> being performed
> +  ///
> +  unsigned getAlignment() const {
> +    signed Log2AlignVal = ((SubclassData>>1)-1);
> +    return ((Log2AlignVal < 0) ? 0 : 1<<Log2AlignVal);
> +  }

Likewise,

-Chris
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to