diff options
Diffstat (limited to 'llvm/include/llvm/IR/Function.h')
-rw-r--r-- | llvm/include/llvm/IR/Function.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h index d9cbcc63fa629..bb4ec13c7610f 100644 --- a/llvm/include/llvm/IR/Function.h +++ b/llvm/include/llvm/IR/Function.h @@ -55,6 +55,8 @@ template <typename T> class Optional; class raw_ostream; class Type; class User; +class BranchProbabilityInfo; +class BlockFrequencyInfo; class Function : public GlobalObject, public ilist_node<Function> { public: @@ -197,6 +199,11 @@ public: /// returns Intrinsic::not_intrinsic! bool isIntrinsic() const { return HasLLVMReservedName; } + /// Returns true if the function is one of the "Constrained Floating-Point + /// Intrinsics". Returns false if not, and returns false when + /// getIntrinsicID() returns Intrinsic::not_intrinsic. + bool isConstrainedFPIntrinsic() const; + static Intrinsic::ID lookupIntrinsicID(StringRef Name); /// Recalculate the ID for this function if it is an Intrinsic defined @@ -349,6 +356,13 @@ public: return 0; } + /// Return the stack alignment for the function. + MaybeAlign getFnStackAlign() const { + if (!hasFnAttribute(Attribute::StackAlignment)) + return None; + return AttributeSets.getStackAlignment(AttributeList::FunctionIndex); + } + /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm /// to use during code generation. bool hasGC() const { @@ -780,6 +794,10 @@ public: /// void viewCFG() const; + /// Extended form to print edge weights. + void viewCFG(bool ViewCFGOnly, const BlockFrequencyInfo *BFI, + const BranchProbabilityInfo *BPI) const; + /// viewCFGOnly - This function is meant for use from the debugger. It works /// just like viewCFG, but it does not include the contents of basic blocks /// into the nodes, just the label. If you are only interested in the CFG @@ -787,6 +805,10 @@ public: /// void viewCFGOnly() const; + /// Extended form to print edge weights. + void viewCFGOnly(const BlockFrequencyInfo *BFI, + const BranchProbabilityInfo *BPI) const; + /// Methods for support type inquiry through isa, cast, and dyn_cast: static bool classof(const Value *V) { return V->getValueID() == Value::FunctionVal; @@ -808,9 +830,11 @@ public: /// hasAddressTaken - returns true if there are any uses of this function /// other than direct calls or invokes to it, or blockaddress expressions. - /// Optionally passes back an offending user for diagnostic purposes. + /// Optionally passes back an offending user for diagnostic purposes and + /// ignores callback uses. /// - bool hasAddressTaken(const User** = nullptr) const; + bool hasAddressTaken(const User ** = nullptr, + bool IgnoreCallbackUses = false) const; /// isDefTriviallyDead - Return true if it is trivially safe to remove /// this function definition from the module (because it isn't externally |