Add a prototype of a new peephole optimizing pass that uses LazyValue info to simplify PHIs and select's.

This pass addresses the missed optimizations from PR2581 and PR4420.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112325 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2010-08-27 23:31:36 +00:00
parent ee61fcf98b
commit a0b59f6bd2
6 changed files with 165 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
; RUN: opt < %s -value-propagation -S | FileCheck %s
; PR2581
; CHECK: @run
define i32 @run(i1 %C) nounwind {
br i1 %C, label %exit, label %body
body: ; preds = %0
; CHECK-NOT: select
%A = select i1 %C, i32 10, i32 11 ; <i32> [#uses=1]
; CHECK: ret i32 11
ret i32 %A
exit: ; preds = %0
; CHECK: ret i32 10
ret i32 10
}