//===- CodeGenPrepare.cpp - Prepare a function for code generation --------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This pass munges the code in the input function to better prepare it for// SelectionDAG-based code generation. This works around limitations in it's// basic-block-at-a-time approach. It should eventually be removed.////===----------------------------------------------------------------------===//#define DEBUG_TYPE "codegenprepare"#include"llvm/Transforms/Scalar.h"#include"llvm/Constants.h"#include"llvm/DerivedTypes.h"#include"llvm/Function.h"#include"llvm/InlineAsm.h"#include"llvm/Instructions.h"#include"llvm/Pass.h"#include"llvm/Target/TargetAsmInfo.h"#include"llvm/Target/TargetData.h"#include"llvm/Target/TargetLowering.h"#include"llvm/Target/TargetMachine.h"#include"llvm/Transforms/Utils/BasicBlockUtils.h"#include"llvm/Transforms/Utils/Local.h"#include"llvm/ADT/DenseMap.h"#include"llvm/ADT/SmallSet.h"#include"llvm/Support/CallSite.h"#include"llvm/Support/Compiler.h"#include"llvm/Support/Debug.h"#include"llvm/Support/GetElementPtrTypeIterator.h"#include"llvm/Support/PatternMatch.h"usingnamespacellvm;usingnamespacellvm::PatternMatch;namespace{classVISIBILITY_HIDDENCodeGenPrepare:publicFunctionPass{/// TLI - Keep a pointer of a TargetLowering to consult for determining/// transformation profitability.constTargetLowering*TLI;public:staticcharID;// Pass identification, replacement for typeidexplicit