//===- InstCombineCalls.cpp -----------------------------------------------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file implements the visitCall and visitInvoke functions.////===----------------------------------------------------------------------===//#include"InstCombine.h"#include"llvm/Support/CallSite.h"#include"llvm/DataLayout.h"#include"llvm/Analysis/MemoryBuiltins.h"#include"llvm/Transforms/Utils/BuildLibCalls.h"#include"llvm/Transforms/Utils/Local.h"usingnamespacellvm;/// getPromotedType - Return the specified type promoted as it would be to pass/// though a va_arg area.staticType*getPromotedType(Type*Ty){if(IntegerType*ITy=dyn_cast<IntegerType>(Ty)){if(ITy->getBitWidth()<32)returnType::getInt32Ty(Ty->getContext());}returnTy;}/// reduceToSingleValueType - Given an aggregate type which ultimately holds a/// single scalar element, like {{{type}}} or [1 x type], return type.staticType*reduceToSingleValueType(Type*T){while(!T->isSingleValueType()){if(StructType*STy=dyn_cast<StructType>(T)){if(STy->getNumElements()==1)T=STy->getElementType(0);elsebreak;}elseif(ArrayType*ATy=dyn_cast<ArrayType>(T)){if(ATy->getNumElements()==1)T=ATy->getElementType();elsebreak;}elsebreak;}returnT;}Instruction*InstCombiner::SimplifyMemTransfer(MemIntrinsic*MI){unsignedDstAlign=getKnownAlignment(MI->getArgOperand(0),TD);unsignedSrcAlign=getKnownAlignment(<