mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
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:
17
test/Transforms/ValuePropagation/phi.ll
Normal file
17
test/Transforms/ValuePropagation/phi.ll
Normal 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
|
||||
}
|
Reference in New Issue
Block a user