43 cl::desc(
"No extract instruction with offset 0"));
46 cl::desc(
"Require & in extract patterns"));
66 return "Hexagon generate \"extract\" instructions";
81 unsigned ExtractCount;
90 "\"extract\" instructions",
false,
false)
96 using namespace PatternMatch;
99 ConstantInt *CSL =
nullptr, *CSR =
nullptr, *CM =
nullptr;
157 Type *Ty = BF->getType();
158 if (!Ty->isIntegerTy())
161 if (BW != 32 && BW != 64)
171 if (!LogicalSR && (SR > SL))
200 if (M.intersects(C) || !M.isMask(W))
206 if (!M.getLoBits(U).isMask(W))
211 Intrinsic::ID IntId = (BW == 32) ? Intrinsic::hexagon_S2_extractu
212 : Intrinsic::hexagon_S2_extractup;
213 Module *Mod = BB->getParent()->getParent();
217 NewIn = IRB.
CreateShl(NewIn, SL, CSL->getName());
222 bool HexagonGenExtract::visitBlock(
BasicBlock *
B) {
224 for (
auto *DTN : children<DomTreeNode*>(DT->getNode(B)))
225 visitBlock(DTN->getBlock());
231 bool Changed =
false;
234 if (HasCutoff && (ExtractCount >= Cutoff))
236 bool Last = (I == Begin);
238 NextI = std::prev(I);
240 bool Done = convert(In);
241 if (HasCutoff && Done)
251 bool HexagonGenExtract::runOnFunction(
Function &
F) {
255 DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
261 Changed = visitBlock(Entry);
267 return new HexagonGenExtract();
BinaryOp_match< LHS, RHS, Instruction::And > m_And(const LHS &L, const RHS &R)
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
A Module instance is used to store all the information related to an LLVM module. ...
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
BinaryOp_match< LHS, RHS, Instruction::AShr > m_AShr(const LHS &L, const RHS &R)
const Function * getParent() const
Return the enclosing method, or null if none.
void initializeHexagonGenExtractPass(PassRegistry &)
iterator begin()
Instruction iterator methods.
bool match(Val *V, const Pattern &P)
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
This file implements a class to represent arbitrary precision integral constant values and operations...
APInt shl(unsigned shiftAmt) const
Left-shift function.
class_match< ConstantInt > m_ConstantInt()
Match an arbitrary ConstantInt and ignore it.
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet)
Get a value with high bits set.
initializer< Ty > init(const Ty &Val)
BinaryOp_match< LHS, RHS, Instruction::LShr > m_LShr(const LHS &L, const RHS &R)
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Represent the analysis usage information of a pass.
BinaryOp_match< LHS, RHS, Instruction::Shl > m_Shl(const LHS &L, const RHS &R)
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE,"Assign register bank of generic virtual registers", false, false) RegBankSelect
FunctionPass class - This class is used to implement most global optimizations.
Iterator for intrusive lists based on ilist_node.
This is the shared class of boolean and integer constants.
ConstantInt * getInt32(uint32_t C)
Get a constant 32-bit value.
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
Class for arbitrary precision integers.
Value * CreateShl(Value *LHS, Value *RHS, const Twine &Name="", bool HasNUW=false, bool HasNSW=false)
static IntegerType * getInt32Ty(LLVMContext &C)
CallInst * CreateCall(Value *Callee, ArrayRef< Value * > Args=None, const Twine &Name="", MDNode *FPMathTag=nullptr)
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
LLVM Value Representation.
FunctionPass * createHexagonGenExtract()
StringRef - Represent a constant reference to a string, i.e.
inst_range instructions(Function *F)
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Legacy analysis pass which computes a DominatorTree.
APInt lshr(unsigned shiftAmt) const
Logical right-shift function.