//===- SimplifyLibCalls.cpp - Optimize specific well-known library calls --===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file implements a simple pass that applies a variety of small// optimizations for calls to specific well-known function calls (e.g. runtime// library functions). For example, a call to the function "exit(3)" that// occurs within the main() function can be transformed into a simple "return 3"// instruction. Any optimization that takes this form (replace call to library// function with simpler code that provides the same result) belongs in this// file.////===----------------------------------------------------------------------===//#define DEBUG_TYPE "simplify-libcalls"#include"llvm/Transforms/Scalar.h"#include"llvm/Intrinsics.h"#include"llvm/Module.h"#include"llvm/Pass.h"#include"llvm/Support/IRBuilder.h"#include"llvm/Target/TargetData.h"#include"llvm/ADT/SmallPtrSet.h"#include"llvm/ADT/StringMap.h"#include"llvm/ADT/Statistic.h"#include"llvm/Support/Compiler.h"#include"llvm/Support/Debug.h"#include"llvm/Config/config.h"usingnamespacellvm;STATISTIC(NumSimplified,<