12#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_LEGALITY_H
13#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_LEGALITY_H
24class LegalityAnalysis;
60 return "NotInstructions";
66 return "DiffMathFlags";
68 return "DiffWrapFlags";
70 return "NotConsecutive";
72 return "CantSchedule";
74 return "Unimplemented";
158 std::optional<ResultReason>
167 : Sched(AA, Ctx), SE(SE),
DL(
DL) {}
169 template <
typename ResultT,
typename... ArgsT>
171 ResultPool.
push_back(std::unique_ptr<ResultT>(
new ResultT(Args...)));
172 return cast<ResultT>(*ResultPool.
back());
179 bool SkipScheduling =
false);
static SDValue Widen(SelectionDAG *CurDAG, SDValue N)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
BlockVerifier::State From
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
A parsed version of the target data layout string in and methods for querying it.
The main scalar evolution driver.
void push_back(const T &Elt)
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.
Performs the legality analysis and returns a LegalityResult object.
LegalityAnalysis(AAResults &AA, ScalarEvolution &SE, const DataLayout &DL, Context &Ctx)
ResultT & createLegalityResult(ArgsT... Args)
A LegalityResult factory.
const LegalityResult & canVectorize(ArrayRef< Value * > Bndl, bool SkipScheduling=false)
Checks if it's legal to vectorize the instructions in Bndl.
Base class for results with reason.
ResultReason getReason() const
void print(raw_ostream &OS) const override
The legality outcome is represented by a class rather than an enum class because in some cases the le...
LegalityResult & operator=(const LegalityResult &)=delete
friend raw_ostream & operator<<(raw_ostream &OS, const LegalityResult &LR)
virtual ~LegalityResult()
LLVM_DUMP_METHOD void dump() const
LegalityResultID getSubclassID() const
virtual void print(raw_ostream &OS) const
LegalityResult(LegalityResultID ID)
Only Legality can create LegalityResults.
LegalityResult(const LegalityResult &)=delete
We shouldn't need copies.
static bool classof(const LegalityResult *From)
static bool classof(const LegalityResult *From)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ Widen
ā€¨Collect scalar values.
ResultReason
The reason for vectorizing or not vectorizing.
static const char * getVecReason(ResultReason Reason)
static const char * getLegalityResultID(LegalityResultID ID)