40 StringRef getPassName()
const override {
return "Remove sign extends"; }
54 "Remove Sign and Zero Extends for Args",
false,
false)
56 bool HexagonOptimizeSZextends::intrinsicAlreadySextended(Intrinsic::
ID IntID) {
78 if (isa<SExtInst>(*UI)) {
107 if (!(Ashr && Ashr->
getOpcode() == Instruction::AShr))
117 if (!(Shl && Shl->
getOpcode() == Instruction::Shl))
128 if (!intrinsicAlreadySextended(
I->getIntrinsicID()))
133 const Use &TheUse = UI.getUse();
135 J->replaceUsesOfWith(Ashr,
I);
147 return new HexagonOptimizeSZextends();
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes 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...
INITIALIZE_PASS(HexagonOptimizeSZextends, "reargs", "Remove Sign and Zero Extends for Args", false, false) bool HexagonOptimizeSZextends
This class represents lattice values for constants.
BinaryOps getOpcode() const
This class represents a sign extension of integer types.
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
FunctionPass * createHexagonOptimizeSZextends()
A Use represents the edge between a Value definition and its users.
User * getUser() const LLVM_READONLY
Returns the User that contains this Use.
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Type * getType() const
All values are typed, get the type of this value.
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
AttributeList getAttributes() const
Return the attribute list for this Function.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
Value * getOperand(unsigned i) const
const BasicBlock & getEntryBlock() const
static bool runOnFunction(Function &F, bool PostInlining)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void insertBefore(Instruction *InsertPos)
Insert an unlinked instruction into a basic block immediately before the specified instruction...
void initializeHexagonOptimizeSZextendsPass(PassRegistry &)
const Instruction & front() const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
This is the shared class of boolean and integer constants.
amdgpu Simplify well known AMD library false Value Value * Arg
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
user_iterator user_begin()
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
int64_t getSExtValue() const
Return the constant as a 64-bit integer value after it has been sign extended as appropriate for the ...
iterator_range< arg_iterator > args()
A wrapper class for inspecting calls to intrinsic functions.