X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FIntrinsicLowering.cpp;h=5b4de27b8a9db6ca2ad17016329d0788cbc2faa3;hb=236aa8a5032282d8793b537c0f3f7ffb381a83d4;hp=960d660cb946866a1d50a01e9bbe5622d5ddbfa5;hpb=219ab405e6bea993da14cf3ce7b50983c3bb7a6f;p=oota-llvm.git diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 960d660cb94..5b4de27b8a9 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -34,22 +34,25 @@ static void EnsureFunctionExists(Module &M, const char *Name, M.getOrInsertFunction(Name, FunctionType::get(RetTy, ParamTys, false)); } -static void EnsureFPIntrinsicsExist(Module &M, Module::iterator I, - const char *FName, - const char *DName, const char *LDName) { +static void EnsureFPIntrinsicsExist(Module &M, Function *Fn, + const char *FName, + const char *DName, const char *LDName) { // Insert definitions for all the floating point types. - switch((int)I->arg_begin()->getType()->getTypeID()) { + switch((int)Fn->arg_begin()->getType()->getTypeID()) { case Type::FloatTyID: - EnsureFunctionExists(M, FName, I->arg_begin(), I->arg_end(), + EnsureFunctionExists(M, FName, Fn->arg_begin(), Fn->arg_end(), Type::FloatTy); + break; case Type::DoubleTyID: - EnsureFunctionExists(M, DName, I->arg_begin(), I->arg_end(), + EnsureFunctionExists(M, DName, Fn->arg_begin(), Fn->arg_end(), Type::DoubleTy); + break; case Type::X86_FP80TyID: case Type::FP128TyID: case Type::PPC_FP128TyID: - EnsureFunctionExists(M, LDName, I->arg_begin(), I->arg_end(), - I->arg_begin()->getType()); + EnsureFunctionExists(M, LDName, Fn->arg_begin(), Fn->arg_end(), + Fn->arg_begin()->getType()); + break; } } @@ -533,6 +536,8 @@ static Instruction *LowerPartSet(CallInst *CI) { Lo = new ZExtInst(Lo_pn, ValTy, "", entry); } else if (ValBits < 32) { Lo = new TruncInst(Lo_pn, ValTy, "", entry); + } else { + Lo = Lo_pn; } // Determine if the replacement bits are larger than the number of bits we // are replacing and deal with it.