23 #define DEBUG_TYPE "mips-os16" 26 "mips32-function-mask",
28 cl::desc(
"Force function to be mips32"),
38 StringRef getPassName()
const override {
return "MIPS Os16 Optimization"; }
40 bool runOnModule(
Module &M)
override;
82 case Instruction::FAdd:
83 case Instruction::FSub:
84 case Instruction::FMul:
85 case Instruction::FDiv:
86 case Instruction::FRem:
87 case Instruction::FPToUI:
88 case Instruction::FPToSI:
89 case Instruction::UIToFP:
90 case Instruction::SIToFP:
91 case Instruction::FPTrunc:
92 case Instruction::FPExt:
93 case Instruction::FCmp:
98 if (
const CallInst *CI = dyn_cast<CallInst>(
I)) {
101 Function &F_ = *CI->getCalledFunction();
110 bool MipsOs16::runOnModule(
Module &M) {
112 bool doneUsingMask =
false;
119 unsigned int functionIndex = 0;
120 bool modified =
false;
123 if (
F.isDeclaration())
128 if (!doneUsingMask) {
134 F.addFnAttr(
"nomips16");
137 doneUsingMask =
true;
148 F.addFnAttr(
"nomips16");
152 F.addFnAttr(
"mips16");
This class represents an incoming formal argument to a Function.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
2: 32-bit floating point type
This class represents a function call, abstracting a target machine's calling convention.
static cl::opt< std::string > Mips32FunctionMask("mips32-function-mask", cl::init(""), cl::desc("Force function to be mips32"), cl::Hidden)
TypeID getTypeID() const
Return the type id for the type.
static bool needsFPFromSig(Function &F)
static bool needsFP(Function &F)
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.
ModulePass * createMipsOs16Pass()
initializer< Ty > init(const Ty &Val)
Type * getReturnType() const
Returns the type of the ret val.
The instances of the Type class are immutable: once they are created, they are never changed...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Iterator for intrusive lists based on ilist_node.
Module.h This file contains the declarations for the Module class.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
amdgpu Simplify well known AMD library false Value Value * Arg
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
3: 64-bit floating point type
StringRef - Represent a constant reference to a string, i.e.