Lines Matching refs:Function
26 // -- We define Function* container class with custom "operator<" (FunctionPtr).
101 #include "llvm/IR/Function.h"
173 mutable AssertingVH<Function> F;
178 FunctionNode(Function *F) : F(F), Hash(StructuralHash(*F)) {}
180 Function *getFunc() const { return F; }
185 void replaceBy(Function *G) const {
200 DenseMap<Function *, Function *> runOnFunctions(ArrayRef<Function *> F);
240 bool insert(Function *NewFunction);
242 /// Remove a Function from the FnTree and queue it up for a second sweep of
244 void remove(Function *F);
252 void replaceDirectCallers(Function *Old, Function *New);
257 void mergeTwoFunctions(Function *F, Function *G);
268 void eraseTail(Function *G);
281 void writeThunk(Function *F, Function *G);
284 void writeAlias(Function *F, Function *G);
288 bool writeThunkOrAlias(Function *F, Function *G);
291 void replaceFunctionInTree(const FunctionNode &FN, Function *G);
302 DenseMap<AssertingVH<Function>, FnTreeType::iterator> FNodesInTree;
305 DenseMap<Function *, Function *> DelToNewMap;
327 DenseMap<Function *, Function *>
328 MergeFunctionsPass::runOnFunctions(ArrayRef<Function *> F) {
348 Function *F1 = cast<Function>(*I);
349 Function *F2 = cast<Function>(*J);
370 Function *F3 = cast<Function>(*K);
409 static bool hasDistinctMetadataIntrinsic(const Function &F) {
429 static bool isEligibleForMerging(Function &F) {
434 inline Function *asPtr(Function *Fn) { return Fn; }
435 inline Function *asPtr(Function &Fn) { return &Fn; }
442 std::vector<std::pair<stable_hash, Function *>> HashedFuncs;
444 Function *FuncPtr = asPtr(Func);
475 Function *F = cast<Function>(I);
491 DenseMap<Function *, Function *>
492 MergeFunctions::runOnFunctions(ArrayRef<Function *> F) {
499 void MergeFunctions::replaceDirectCallers(Function *Old, Function *New) {
504 // Function comparison ensures that the attributes are the same up to
572 void MergeFunctions::eraseTail(Function *G) {
726 static bool canCreateThunkFor(Function *F) {
743 static void copyMetadataIfPresent(Function *From, Function *To,
759 void MergeFunctions::writeThunk(Function *F, Function *G) {
764 Function *NewG = nullptr;
778 NewG = Function::Create(G->getFunctionType(), G->getLinkage(),
786 Function *H = MergeFunctionsPDI ? G : NewG;
844 static bool canCreateAliasFor(Function *F) {
855 void MergeFunctions::writeAlias(Function *F, Function *G) {
880 bool MergeFunctions::writeThunkOrAlias(Function *F, Function *G) {
892 // Merge two equivalent functions. Upon completion, Function G is deleted.
893 void MergeFunctions::mergeTwoFunctions(Function *F, Function *G) {
905 Function *NewF = Function::Create(F->getFunctionType(), F->getLinkage(),
969 Function *G) {
970 Function *F = FN.getFunc();
988 static bool isFuncOrderCorrect(const Function *F, const Function *G) {
1007 bool MergeFunctions::insert(Function *NewFunction) {
1023 Function *F = OldF.getFunc();
1032 Function *DeleteF = NewFunction;
1040 void MergeFunctions::remove(Function *F) {