21 cl::desc(
"Override the vector register size in bits, "
22 "which is otherwise found by querying TTI."));
25 cl::desc(
"Allow non-power-of-2 vectorization."));
27#define LoadSeedsDef "loads"
28#define StoreSeedsDef "stores"
31 cl::desc(
"Collect these seeds. Use empty for none or a comma-separated "
41 const auto &
DL =
F.getParent()->getDataLayout();
53 SeedCollector SC(&BB,
A.getScalarEvolution(), CollectStores, CollectLoads);
57 Seeds[Seeds.getFirstUnusedElementIdx()])),
60 auto DivideBy2 = [](
unsigned Num) {
68 for (
unsigned SliceElms = std::min(VecRegBits / ElmBits,
69 Seeds.getNumUnusedBits() / ElmBits);
70 SliceElms >= 2u; SliceElms = DivideBy2(SliceElms)) {
75 for (
unsigned Offset = Seeds.getFirstUnusedElementIdx(),
86 if (SeedSlice.empty())
89 assert(SeedSlice.size() >= 2 &&
"Should have been rejected!");
92 auto &Ctx =
F.getContext();
94 Rgn.setAux(SeedSlice);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
StringRef - Represent a constant reference to a string, i.e.
A pass that runs on a sandbox::Function.
bool runOnRegion(Region &R, const Analyses &A) final
\Returns true if it modifies R.
The main job of the Region is to point to new instructions generated by vectorization passes.
LLVM_ABI void clearAux()
Clears all auxiliary data.
A set of candidate Instructions for vectorizing together.
bool runOnFunction(Function &F, const Analyses &A) final
\Returns true if it modifies F.
SeedCollection(StringRef Pipeline)
iterator_range< SeedContainer::iterator > getStoreSeeds()
static unsigned getNumBits(Type *Ty, const DataLayout &DL)
\Returns the number of bits of Ty.
static Type * getExpectedType(const Value *V)
\Returns the expected type of Value V.
static Type * getElementType(Type *Ty)
Returns Ty if scalar or its element type if vector.
static LLVM_ABI unsigned getFloorPowerOf2(unsigned Num)
\Returns the first integer power of 2 that is <= Num.
template class LLVM_TEMPLATE_ABI opt< unsigned >
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
static cl::opt< unsigned > OverrideVecRegBits("sbvec-vec-reg-bits", cl::init(0), cl::Hidden, cl::desc("Override the vector register size in bits, " "which is otherwise found by querying TTI."))
static cl::opt< bool > AllowNonPow2("sbvec-allow-non-pow2", cl::init(false), cl::Hidden, cl::desc("Allow non-power-of-2 vectorization."))
cl::opt< std::string > CollectSeeds("sbvec-collect-seeds", cl::init(StoreSeedsDef), cl::Hidden, cl::desc("Collect these seeds. Use empty for none or a comma-separated " "list of '" StoreSeedsDef "' and '" LoadSeedsDef "'."))