21 cl::desc(
"Limit the number of a seed's users that getNextUserBundles() "
22 "will examine as candidates for a matching bundle, to cap "
23 "compilation time."));
28 if (U->getOperand(Idx) ==
Op)
33static std::optional<BundleTy>
39 assert(!OpIdxVec0.
empty() &&
"U0 does not use Seed!");
42 Claimed.
insert(SeedUserInst);
48 UI->getOpcode() != SeedUserInst->
getOpcode() ||
49 UI->getType() != SeedUserInst->
getType() ||
50 UI->getParent() != SeedUserInst->
getParent() ||
62 for (
auto *
I : NextUserBndl)
83 if (!SeenUsers.
insert(U0).second)
88 std::optional<BundleTy> NextUserBndl =
101 for (
unsigned ShiftBy = 1; ShiftBy <
sizeof(Num) * 8; ShiftBy <<= 1)
102 Mask |= Mask >> ShiftBy;
109 dbgs() << Idx <<
"." << *V <<
"\n";
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static ManagedStatic< cl::opt< uint64_t >, CreateSeed > Seed
Provides some synthesis utilities to produce sequences of values.
This file defines the SmallPtrSet class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool empty() const
Check if the array is empty.
Implements a dense probed hash-table based set.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
bool contains(ConstPtrType Ptr) const
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
std::pair< iterator, bool > insert(const ValueT &V)
Maps the original instructions to the vectorized instrs and the reverse.
bool isVectorized(Value *Orig) const
\Returns true if Orig was vectorized
A sandboxir::User with operands, opcode and linked with previous/next instructions in an instruction ...
Opcode getOpcode() const
\Returns this Instruction's opcode.
LLVM_ABI BasicBlock * getParent() const
\Returns the BasicBlock containing this Instruction, or null if it is detached.
A sandboxir::User has operands.
A SandboxIR Value has users. This is the base class.
LLVM_ABI Type * getType() const
iterator_range< user_iterator > users()
static LLVM_DUMP_METHOD void dump(ArrayRef< Value * > Bndl)
Helper dump function for debugging.
static LLVM_ABI unsigned getFloorPowerOf2(unsigned Num)
\Returns the first integer power of 2 that is <= Num.
static LLVM_ABI SmallVector< BundleTy > getNextUserBundles(ArrayRef< Value * > Bndl, const InstrMaps &IMaps, SmallPtrSet< Instruction *, 4 > &Claimed)
For each user of lane 0 in Bndl, try to form a bundle of matching users for all lanes.
initializer< Ty > init(const Ty &Val)
static cl::opt< unsigned > MaxUsersToConsider("sbvec-max-users-to-consider", cl::init(16), cl::Hidden, cl::desc("Limit the number of a seed's users that getNextUserBundles() " "will examine as candidates for a matching bundle, to cap " "compilation time."))
static SmallVector< unsigned, 2 > getOperandIndicesInUser(User *U, Value *Op)
static void dumpImpl(ArrayRef< T * > Bndl)
SmallVector< Value *, 4 > BundleTy
static std::optional< BundleTy > getMatchingBundle(ArrayRef< Value * > Bndl, const InstrMaps &IMaps, Value *Seed, Instruction *SeedUserInst, SmallPtrSet< Instruction *, 4 > &Claimed)
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
DWARFExpression::Operation Op
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
constexpr auto seq(T Begin, T End)
Iterate over an integral type from Begin up to - but not including - End.