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

Hal Finkel hfinkel at anl.gov
Thu Apr 5 09:44:28 PDT 2012


Makes sense to me. Thanks, Sebastian!

 -Hal

On Thu, 5 Apr 2012 11:42:20 -0500
Sebastian Pop <spop at codeaurora.org> wrote:

> On Thu, Apr 5, 2012 at 11:37 AM, Sebastian Pop <spop at codeaurora.org>
> wrote:
> > Please avoid the negative field names: instead please use the
> > positive...
> 
> Okay, here are my suggestions for the new names:
> 
> > 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;
> >> +
> 
> VectorizeInts
> 
> >> +  /// @brief Don't try to vectorize floating-point values.
> >> +  bool NoFloats;
> 
> VectorizeFloats
> 
> >> +
> >> +  /// @brief Don't try to vectorize casting (conversion)
> >> operations.
> >> +  bool NoCasts;
> 
> VectorizeCasts
> 
> >> +
> >> +  /// @briefDon't try to vectorize floating-point math intrinsics.
> >> +  bool NoMath;
> 
> VectorizeMath
> 
> >> +
> >> +  /// @brief Don't try to vectorize the fused-multiply-add
> >> intrinsic.
> >> +  bool NoFMA;
> 
> VectorizeFMA
> 
> >> +
> >> +  /// @brief Don't try to vectorize loads and stores.
> >> +  bool NoMemOps;
> 
> VectorizeMemOps
> 
> >>       // 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)))
> 
> if (Config.VectorizeMemOpBoost && ... )
> 
> >> +        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;
> 
> return Config.VectorizeMath;
> 
> >>       case Intrinsic::fma:
> >> -        return !NoFMA;
> >> +        return !Config.NoFMA;
> 
> return Config.VectorizeFMA;
> 
> etc.
> 
> > ... that way, you would avoid the double negation here and
> > elsewhere.
> >
> > Thanks,
> > Sebastian
> > --
> > Qualcomm Innovation Center, Inc is a member of Code Aurora Forum



-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory




More information about the llvm-commits mailing list