mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[SLSR] handles non-canonicalized Mul candidates
such as (2 + B) * S. Tested by @non_canonicalized in slsr-mul.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237216 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -23,6 +23,27 @@ define void @slsr1(i32 %b, i32 %s) {
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @non_canonicalized(i32 %b, i32 %s) {
|
||||
; CHECK-LABEL: @non_canonicalized(
|
||||
; foo(b * s);
|
||||
%mul0 = mul i32 %b, %s
|
||||
; CHECK: mul i32
|
||||
; CHECK-NOT: mul i32
|
||||
call void @foo(i32 %mul0)
|
||||
|
||||
; foo((1 + b) * s);
|
||||
%b1 = add i32 1, %b
|
||||
%mul1 = mul i32 %b1, %s
|
||||
call void @foo(i32 %mul1)
|
||||
|
||||
; foo((2 + b) * s);
|
||||
%b2 = add i32 2, %b
|
||||
%mul2 = mul i32 %b2, %s
|
||||
call void @foo(i32 %mul2)
|
||||
|
||||
ret void
|
||||
}
|
||||
|
||||
; foo(a * b)
|
||||
; foo((a + 1) * b)
|
||||
; foo(a * (b + 1))
|
||||
|
||||
Reference in New Issue
Block a user