33 bool IsInteger =
false;
34 for ([[maybe_unused]]
auto *
I : Bndl) {
40 if (IsFloat && IsInteger)
44 if (!Sched.trySchedule(Bndl))
52 SmallPtrSet<Instruction *, 8> DeadCandidates;
53 for (
auto *SI : Stores) {
56 DeadCandidates.insert(PtrI);
57 SI->eraseFromParent();
59 for (
auto *
Op : Operands) {
63 DeadCandidates.insert(PtrI);
67 for (
auto *PtrI : DeadCandidates)
68 if (!PtrI->hasNUsesOrMore(1))
69 PtrI->eraseFromParent();
76 Function &
F = *Bndl[0]->getParent()->getParent();
77 DL = &
F.getParent()->getDataLayout();
78 auto &Ctx =
F.getContext();
81 Bndl,
A.getScalarEvolution(), *DL))
83 if (!canVectorize(Bndl,
Sched))
88 for (
auto *
I : Bndl) {
101 if (LI->getParent() != BB)
103 if (LI->hasNUsesOrMore(2))
109 if (!AllLoads && !AllConstants)
112 Value *VecOp =
nullptr;
121 Loads,
A.getScalarEvolution(), *DL);
124 if (!canVectorize(Loads,
Sched))
134 }
else if (AllConstants) {
141 for (
Value *Elm : AggrCOp->operands())
145 Constants.push_back(SeqCOp->getElementAsConstant(ElmIdx));
147 auto *ZeroElm = Zero->getSequentialElement();
148 for ([[maybe_unused]]
auto Cnt :
150 Constants.push_back(ZeroElm);
152 Constants.push_back(COp);
165 tryEraseDeadInstrs(Bndl, Operands);
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 Constant * get(ArrayRef< Constant * > V)
static bool differentBlock(ArrayRef< ValueT * > Instrs)
static bool areUnique(ArrayRef< ValueT * > Values)
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.
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 isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
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.
auto seq(T Begin, T End)
Iterate over an integral type from Begin up to - but not including - End.
This struct is a compact representation of a valid (non-zero power of two) alignment.