instcombine: Migrate puts optimizations

This patch migrates the puts optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

All the simplifiers from simplify-libcalls have now been migrated to
instcombine.  Yay!  Just a few other bits to migrate (prototype attribute
inference and a few statistics) and simplify-libcalls can finally be put
to rest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168925 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Meador Inge
2012-11-29 19:15:17 +00:00
parent f2c87b1c05
commit aa8cccf129
4 changed files with 58 additions and 54 deletions

View File

@@ -1,15 +0,0 @@
; Test that the PutsOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | FileCheck %s
target datalayout = "p:64:64:64"
@.str = private constant [1 x i8] zeroinitializer
declare i32 @puts(i8*)
define void @foo() {
entry:
; CHECK: call i32 @putchar(i32 10)
%call = call i32 @puts(i8* getelementptr inbounds ([1 x i8]* @.str, i32 0, i32 0))
ret void
}