aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SimplifyLibCalls.cpp
diff options
context:
space:
mode:
authorMeador Inge <meadori@codesourcery.com>2012-11-26 03:10:07 +0000
committerMeador Inge <meadori@codesourcery.com>2012-11-26 03:10:07 +0000
commit017bb750ab99b2ca54771fc86a6b2fed4ad90eec (patch)
tree9d2d0e7563f4df87ed93464587b56f09313c9726 /lib/Transforms/Scalar/SimplifyLibCalls.cpp
parenta0798ec3774de21f3ae3a7eba237e274e4c05ac3 (diff)
instcombine: Migrate isascii optimizations
This patch migrates the isascii optimizations from the simplify-libcalls pass into the instcombine library call simplifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SimplifyLibCalls.cpp')
-rw-r--r--lib/Transforms/Scalar/SimplifyLibCalls.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index 8ae00d8b3a..64384debf6 100644
--- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
@@ -100,24 +100,6 @@ namespace {
//===----------------------------------------------------------------------===//
//===---------------------------------------===//
-// 'isascii' Optimizations
-
-struct IsAsciiOpt : public LibCallOptimization {
- virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder<> &B) {
- FunctionType *FT = Callee->getFunctionType();
- // We require integer(i32)
- if (FT->getNumParams() != 1 || !FT->getReturnType()->isIntegerTy() ||
- !FT->getParamType(0)->isIntegerTy(32))
- return 0;
-
- // isascii(c) -> c <u 128
- Value *Op = CI->getArgOperand(0);
- Op = B.CreateICmpULT(Op, B.getInt32(128), "isascii");
- return B.CreateZExt(Op, CI->getType());
- }
-};
-
-//===---------------------------------------===//
// 'toascii' Optimizations
struct ToAsciiOpt : public LibCallOptimization {
@@ -502,7 +484,6 @@ namespace {
StringMap<LibCallOptimization*> Optimizations;
// Integer Optimizations
- IsAsciiOpt IsAscii;
ToAsciiOpt ToAscii;
// Formatting and IO Optimizations
SPrintFOpt SPrintF; PrintFOpt PrintF;
@@ -563,7 +544,6 @@ void SimplifyLibCalls::AddOpt(LibFunc::Func F1, LibFunc::Func F2,
/// we know.
void SimplifyLibCalls::InitOptimizations() {
// Integer Optimizations
- Optimizations["isascii"] = &IsAscii;
Optimizations["toascii"] = &ToAscii;
// Formatting and IO Optimizations