mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Add support for simplifying a load from a computed value to a load from a global when it
is provable that they're equivalent. This fixes PR4855. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112994 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -39,3 +39,21 @@ bb3: ; preds = %bb1
|
||||
; CHECK: ret i1 %res
|
||||
ret i1 %res
|
||||
}
|
||||
|
||||
; PR4855
|
||||
@gv = internal constant i8 7
|
||||
; CHECK: @test3
|
||||
define i8 @test3(i8* %a) nounwind {
|
||||
entry:
|
||||
%cond = icmp eq i8* %a, @gv
|
||||
br i1 %cond, label %bb2, label %bb
|
||||
|
||||
bb: ; preds = %entry
|
||||
ret i8 0
|
||||
|
||||
bb2: ; preds = %entry
|
||||
; CHECK-NOT: load i8* %a
|
||||
%should_be_const = load i8* %a
|
||||
; CHECK: ret i8 7
|
||||
ret i8 %should_be_const
|
||||
}
|
Reference in New Issue
Block a user