diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-07-18 08:34:51 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-07-18 08:34:51 +0000 |
commit | ff9bf97cebf273c678019af636e1ab30ae8d0d7f (patch) | |
tree | 0b1994cb6967d00ab20e9c8cba6210d81f87781b /llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp | |
parent | a78d809abc6d3a4a6db0a5f8ca6a80bfa20508a0 (diff) | |
download | bcm5719-llvm-ff9bf97cebf273c678019af636e1ab30ae8d0d7f.tar.gz bcm5719-llvm-ff9bf97cebf273c678019af636e1ab30ae8d0d7f.zip |
Fix simplifylibcalls memset recognition to work on 64-bit platforms
where int is 32 bits.
llvm-svn: 76293
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp index f285406b190..7e6b3534625 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp @@ -994,12 +994,12 @@ struct VISIBILITY_HIDDEN MemSetOpt : public LibCallOptimization { const FunctionType *FT = Callee->getFunctionType(); if (FT->getNumParams() != 3 || FT->getReturnType() != FT->getParamType(0) || !isa<PointerType>(FT->getParamType(0)) || - FT->getParamType(1) != TD->getIntPtrType() || + !isa<IntegerType>(FT->getParamType(1)) || FT->getParamType(2) != TD->getIntPtrType()) return 0; // memset(p, v, n) -> llvm.memset(p, v, n, 1) - Value *Val = B.CreateTrunc(CI->getOperand(2), Type::Int8Ty); + Value *Val = B.CreateIntCast(CI->getOperand(2), Type::Int8Ty, false); EmitMemSet(CI->getOperand(1), Val, CI->getOperand(3), B); return CI->getOperand(1); } |