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))
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) {
226 typedef GTN::ChildIteratorType Iter;
227 for (Iter
I = GTN::child_begin(DTN),
E = GTN::child_end(DTN);
I !=
E; ++
I)
228 visitBlock((*I)->getBlock());
234 bool Changed =
false;
237 if (HasCutoff && (ExtractCount >= Cutoff))
239 bool Last = (I == Begin);
241 NextI = std::prev(I);
243 bool Done = convert(In);
244 if (HasCutoff && Done)
254 bool HexagonGenExtract::runOnFunction(
Function &
F) {
258 DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
264 Changed = visitBlock(Entry);
270 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...
A Module instance is used to store all the information related to an LLVM module. ...
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)
bool isMask(unsigned numBits, const APInt &APIVal)
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)
APInt lshr(unsigned shiftAmt) const
Logical right-shift function.
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.
Base class for the actual dominator tree node.
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.
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
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...
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 etc Experimental Use value profile to guide fuzzing Number of simultaneous worker processes to run the jobs If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
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.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
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.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")