[llvm-commits] [Review Request][Patch]Introduce the VectorizeConfig class.

Sebastian Pop spop at codeaurora.org
Thu Apr 5 09:37:07 PDT 2012


On Thu, Apr 5, 2012 at 9:33 AM, Hongbin Zheng <etherzhhb at gmail.com> wrote:
>  //===----------------------------------------------------------------------===//
> +/// @brief Vectorize configuration.
> +struct VectorizeConfig {
> +  //===--------------------------------------------------------------------===//
> +  // Target architecture related parameters
> +
> +  /// @brief The size of the native vector registers.
> +  unsigned VectorBits;
> +
> +  /// @brief Don't try to vectorize integer values.
> +  bool NoInts;
> +
> +  /// @brief Don't try to vectorize floating-point values.
> +  bool NoFloats;
> +
> +  /// @brief Don't try to vectorize casting (conversion) operations.
> +  bool NoCasts;
> +
> +  /// @briefDon't try to vectorize floating-point math intrinsics.
> +  bool NoMath;
> +
> +  /// @brief Don't try to vectorize the fused-multiply-add intrinsic.
> +  bool NoFMA;
> +
> +  /// @brief Don't try to vectorize loads and stores.
> +  bool NoMemOps;

Please avoid the negative field names: instead please use the positive...

>       // Give a load or store half of the required depth so that load/store
>       // pairs will vectorize.
> -      if (!NoMemOpBoost && (isa<LoadInst>(V) || isa<StoreInst>(V)))
> -        return ReqChainDepth/2;
> +      if (!Config.NoMemOpBoost && (isa<LoadInst>(V) || isa<StoreInst>(V)))
> +        return Config.ReqChainDepth/2;
>
>       return 1;
>     }
> @@ -431,9 +436,9 @@ namespace {
>       case Intrinsic::exp:
>       case Intrinsic::exp2:
>       case Intrinsic::pow:
> -        return !NoMath;
> +        return !Config.NoMath;
>       case Intrinsic::fma:
> -        return !NoFMA;
> +        return !Config.NoFMA;


... that way, you would avoid the double negation here and elsewhere.

Thanks,
Sebastian
--
Qualcomm Innovation Center, Inc is a member of Code Aurora Forum




More information about the llvm-commits mailing list