mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 18:31:04 +00:00
a10756ee65
This new version is much more aggressive about doing "full" reduction in cases where it reduces register pressure, and also more aggressive about rewriting induction variables to count down (or up) to zero when doing so reduces register pressure. It currently uses fairly simplistic algorithms for finding reuse opportunities, but it introduces a new framework allows it to combine multiple strategies at once to form hybrid solutions, instead of doing all full-reduction or all base+index. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94061 91177308-0d34-0410-b5e6-96231b3b80d8
34 lines
594 B
LLVM
34 lines
594 B
LLVM
; RUN: llc < %s -march=x86-64 | FileCheck %s
|
|
|
|
; CodeGen should remat the zero instead of spilling it.
|
|
|
|
declare void @foo(i64 %p)
|
|
|
|
; CHECK: bar:
|
|
; CHECK: xorl %edi, %edi
|
|
; CHECK: xorl %edi, %edi
|
|
define void @bar() nounwind {
|
|
call void @foo(i64 0)
|
|
call void @foo(i64 0)
|
|
ret void
|
|
}
|
|
|
|
; CHECK: bat:
|
|
; CHECK: movq $-1, %rdi
|
|
; CHECK: movq $-1, %rdi
|
|
define void @bat() nounwind {
|
|
call void @foo(i64 -1)
|
|
call void @foo(i64 -1)
|
|
ret void
|
|
}
|
|
|
|
; CHECK: bau:
|
|
; CHECK: movl $1, %edi
|
|
; CHECK: movl $1, %edi
|
|
define void @bau() nounwind {
|
|
call void @foo(i64 1)
|
|
call void @foo(i64 1)
|
|
ret void
|
|
}
|
|
|