9#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVEC_PASSES_INSTRMAPS_H
10#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVEC_PASSES_INSTRMAPS_H
60 std::optional<Context::CallbackID> EraseInstrCB;
68 auto It = OrigToVectorMap.
find(Orig);
69 return It != OrigToVectorMap.
end() ? It->second :
nullptr;
74 auto It1 = VectorToOrigLaneMap.
find(Vec);
75 if (It1 == VectorToOrigLaneMap.
end())
77 const auto &OrigToLaneMap = It1->second;
78 auto It2 = OrigToLaneMap.find(Orig);
79 if (It2 == OrigToLaneMap.end())
85 auto &OrigToLaneMap = VectorToOrigLaneMap[Vec];
87 for (
Value *Orig : Origs) {
89 assert(Pair.second &&
"Orig already exists in the map!");
91 OrigToLaneMap[Orig] = Lane;
96 OrigToVectorMap.
clear();
97 VectorToOrigLaneMap.
clear();
101 OS <<
"OrigToVectorMap:\n";
102 for (
auto [Orig, Vec] : OrigToVectorMap)
103 OS << *Orig <<
" : " << *Vec <<
"\n";
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file defines the DenseMap class.
This file defines the SmallSet class.
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
iterator find(const_arg_type_t< KeyT > Val)
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This class implements an extremely fast bulk output stream that can only output to a stream.
Maps the original instructions to the vectorized instrs and the reverse.
std::optional< unsigned > getOrigLane(Action *Vec, Value *Orig) const
\Returns the lane of Orig before it got vectorized into Vec, or nullopt if not found.
void print(raw_ostream &OS) const
void registerVector(ArrayRef< Value * > Origs, Action *Vec)
Update the map to reflect that Origs got vectorized into Vec.
Action * getVectorForOrig(Value *Orig) const
\Returns the vector value that we got from vectorizing Orig, or nullptr if not found.
LLVM_DUMP_METHOD void dump() const
The legality outcome is represented by a class rather than an enum class because in some cases the le...
A SandboxIR Value has users. This is the base class.
static unsigned getNumLanes(Type *Ty)
\Returns the number of vector lanes of Ty or 1 if not a vector.
Action(const LegalityResult *LR, ArrayRef< Value * > B, ArrayRef< Value * > UB, unsigned Depth)
SmallVector< Value * > UserBndl
SmallVector< Value *, 4 > Bndl
SmallVector< Action * > Operands
void print(raw_ostream &OS) const
friend raw_ostream & operator<<(raw_ostream &OS, const Action &A)
const LegalityResult * LegalityRes