//===------ SimplifyLibCalls.cpp - Library calls simplifier ---------------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This is a utility pass used for testing the InstructionSimplify analysis.// The analysis is applied to every instruction, and if it simplifies then the// instruction is replaced by the simplification. If you are looking for a pass// that performs serious instruction folding, use the instcombine pass instead.////===----------------------------------------------------------------------===//#include"llvm/Transforms/Utils/SimplifyLibCalls.h"#include"llvm/DataLayout.h"#include"llvm/ADT/StringMap.h"#include"llvm/Analysis/ValueTracking.h"#include"llvm/Function.h"#include"llvm/IRBuilder.h"#include"llvm/Intrinsics.h"#include"llvm/Module.h"#include"llvm/LLVMContext.h"#include"llvm/Target/TargetLibraryInfo.h"#include"llvm/Transforms/Utils/BuildLibCalls.h"usingnamespacellvm;/// This class is the abstract base class for the set of optimizations that/// corresponds to one library call.namespace{classLibCallOptimization{protected:Function*Caller;constDataLayout*TD;constTargetLibraryInfo