X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FIntrinsicLowering.cpp;h=2c95e9e7d0d3f5f3dae887c54b3304720a4cbd04;hb=4a524934577d85e5095df8ea62ad6a3261076d0c;hp=9977c6bc08169758e4fa2488928c0417f694bfbe;hpb=4bbfbdf7d7a3c4dbdd2d7bb190ef8a0a8246c218;p=oota-llvm.git diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 9977c6bc081..2c95e9e7d0d 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -115,21 +115,21 @@ void IntrinsicLowering::AddPrototypes(Module &M) { Type::getInt8PtrTy(Context), Type::getInt8PtrTy(Context), Type::getInt8PtrTy(Context), - DL.getIntPtrType(Context), (Type *)0); + DL.getIntPtrType(Context), nullptr); break; case Intrinsic::memmove: M.getOrInsertFunction("memmove", Type::getInt8PtrTy(Context), Type::getInt8PtrTy(Context), Type::getInt8PtrTy(Context), - DL.getIntPtrType(Context), (Type *)0); + DL.getIntPtrType(Context), nullptr); break; case Intrinsic::memset: M.getOrInsertFunction("memset", Type::getInt8PtrTy(Context), Type::getInt8PtrTy(Context), Type::getInt32Ty(M.getContext()), - DL.getIntPtrType(Context), (Type *)0); + DL.getIntPtrType(Context), nullptr); break; case Intrinsic::sqrt: EnsureFPIntrinsicsExist(M, I, "sqrtf", "sqrt", "sqrtl"); @@ -459,9 +459,10 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { CI->replaceAllUsesWith(CI->getOperand(0)); break; + case Intrinsic::assume: case Intrinsic::var_annotation: - break; // Strip out annotate intrinsic - + break; // Strip out these intrinsics + case Intrinsic::memcpy: { Type *IntPtr = DL.getIntPtrType(Context); Value *Size = Builder.CreateIntCast(CI->getArgOperand(2), IntPtr, @@ -527,6 +528,34 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { ReplaceFPIntrinsicWithCall(CI, "powf", "pow", "powl"); break; } + case Intrinsic::sin: { + ReplaceFPIntrinsicWithCall(CI, "sinf", "sin", "sinl"); + break; + } + case Intrinsic::cos: { + ReplaceFPIntrinsicWithCall(CI, "cosf", "cos", "cosl"); + break; + } + case Intrinsic::floor: { + ReplaceFPIntrinsicWithCall(CI, "floorf", "floor", "floorl"); + break; + } + case Intrinsic::ceil: { + ReplaceFPIntrinsicWithCall(CI, "ceilf", "ceil", "ceill"); + break; + } + case Intrinsic::trunc: { + ReplaceFPIntrinsicWithCall(CI, "truncf", "trunc", "truncl"); + break; + } + case Intrinsic::round: { + ReplaceFPIntrinsicWithCall(CI, "roundf", "round", "roundl"); + break; + } + case Intrinsic::copysign: { + ReplaceFPIntrinsicWithCall(CI, "copysignf", "copysign", "copysignl"); + break; + } case Intrinsic::flt_rounds: // Lower to "round to the nearest" if (!CI->getType()->isVoidTy())