32 SmallPtrSet<Value *, 8> Unique(Bndl.begin(), Bndl.end());
33 if (Unique.size() != Bndl.size())
39 bool IsInteger =
false;
40 for ([[maybe_unused]]
auto *
I : Bndl) {
46 if (IsFloat && IsInteger)
50 if (!Sched.trySchedule(Bndl))
58 SmallPtrSet<Instruction *, 8> DeadCandidates;
59 for (
auto *SI : Stores) {
62 DeadCandidates.insert(PtrI);
63 SI->eraseFromParent();
65 for (
auto *LI : Loads) {
68 DeadCandidates.insert(PtrI);
71 for (
auto *PtrI : DeadCandidates)
72 if (!PtrI->hasNUsesOrMore(1))
73 PtrI->eraseFromParent();
80 Function &
F = *Bndl[0]->getParent()->getParent();
81 DL = &
F.getParent()->getDataLayout();
82 auto &Ctx =
F.getContext();
85 Bndl,
A.getScalarEvolution(), *DL))
87 if (!canVectorize(Bndl,
Sched))
92 for (
auto *
I : Bndl) {
104 if (LI->getParent() != BB)
106 if (LI->hasNUsesOrMore(2))
118 Loads,
A.getScalarEvolution(), *DL);
121 if (!canVectorize(Loads,
Sched))
139 tryEraseDeadInstrs(Bndl, Loads);
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
void reserve(size_type N)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
static LLVM_ABI LoadInst * create(Type *Ty, Value *Ptr, MaybeAlign Align, InsertPosition Pos, bool IsVolatile, Context &Ctx, const Twine &Name="")
bool runOnRegion(Region &Rgn, 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.
const SmallVector< Instruction * > & getAux() const
\Returns the auxiliary vector.
static LLVM_ABI StoreInst * create(Value *V, Value *Ptr, MaybeAlign Align, InsertPosition Pos, bool IsVolatile, Context &Ctx)
Just like llvm::Type these are immutable, unique, never get freed and can only be created via static ...
static Type * getExpectedType(const Value *V)
\Returns the expected type of Value V.
A SandboxIR Value has users. This is the base class.
static Instruction * getLowest(ArrayRef< Instruction * > Instrs)
\Returns the instruction in Instrs that is lowest in the BB.
static Type * getCombinedVectorTypeFor(ArrayRef< Instruction * > Bndl, const DataLayout &DL)
\Returns the combined vector type for Bndl, even when the element types differ.
static bool areConsecutive(LoadOrStoreT *I1, LoadOrStoreT *I2, ScalarEvolution &SE, const DataLayout &DL)
\Returns true if I1 and I2 are load/stores accessing consecutive memory addresses.
BasicBlock(llvm::BasicBlock *BB, Context &SBCtx)
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
const Value * getPointerOperand(const Value *V)
A helper function that returns the pointer operand of a load, store or GEP instruction.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
This struct is a compact representation of a valid (non-zero power of two) alignment.