25 ArgsRegistry.parse(AuxArg);
27 if (!CollectStores && !CollectLoads) {
33 const VectorizeOptions &Opts =
34 F.getContext().getLibraryOptions().get<VectorizeOptions>();
36 const auto &
DL =
F.getParent()->getDataLayout();
40 SeedCollector SC(&BB,
A.getScalarEvolution(), CollectStores, CollectLoads,
46 unsigned FirstUnusedIdx = Seeds.getFirstUnusedElementIdx();
49 Seeds[FirstUnusedIdx])),
52 unsigned VecRegBits = Opts.sbvec_vec_reg_bits != 0
53 ? Opts.sbvec_vec_reg_bits
54 :
A.getTTI().getLoadStoreVecRegBitWidth(AS);
56 auto DivideBy2 = [](
unsigned Num) {
64 for (
unsigned SliceElms = std::min(VecRegBits / ElmBits,
65 Seeds.getNumUnusedBits() / ElmBits);
66 SliceElms >= 2u; SliceElms = DivideBy2(SliceElms)) {
71 for (
unsigned Offset = Seeds.getFirstUnusedElementIdx(),
80 auto SeedSlice = Seeds.getSlice(
Offset, SliceElms * ElmBits,
81 !Opts.sbvec_allow_non_pow2);
82 if (SeedSlice.empty())
85 assert(SeedSlice.size() >= 2 &&
"Should have been rejected!");
88 auto &Ctx =
F.getContext();
92 Change |= RPM.runOnRegion(Rgn,
A);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Represent a constant reference to a string, i.e.
FunctionPass(StringRef Name)
Name can't contain any spaces or start with '-'.
A Region class that tracks its instructions score.
void clearAux()
Clears all auxiliary data.
void setAux(unsigned Idx, Instruction *I)
Set I as the Idx'th element in the auxiliary vector.
A set of candidate Instructions for vectorizing together.
SeedCollection(StringRef Pipeline, StringRef AuxArg)
bool runOnFunction(Function &F, const Analyses &A) final
\Returns true if it modifies F.
iterator_range< SeedContainer::iterator > getLoadSeeds()
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.
unsigned getLoadStoreAddressSpace(const Instruction *I)
A helper function that returns the address space of the pointer operand of load or store instruction.
This is an optimization pass for GlobalISel generic memory operations.