mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Refactor and check "onlyReadsMemory" before optimizing builtins.
This patch is mostly just refactoring a bunch of copy-and-pasted code, but it also adds a check that the call instructions are readnone or readonly. That check was already present for sin, cos, sqrt, log2, and exp2 calls, but it was missing for the rest of the builtins being handled in this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161282 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -11,7 +11,7 @@ declare x86_fp80 @fabsl(x86_fp80)
|
||||
; UNSAFE: test1:
|
||||
; NOOPT: test1:
|
||||
define float @test1(float %X) {
|
||||
%Y = call float @fabsf(float %X)
|
||||
%Y = call float @fabsf(float %X) readnone
|
||||
ret float %Y
|
||||
}
|
||||
; CHECK: {{^[ \t]+fabs$}}
|
||||
@@ -42,7 +42,7 @@ define double @test2(double %X) {
|
||||
; UNSAFE: test3:
|
||||
; NOOPT: test3:
|
||||
define x86_fp80 @test3(x86_fp80 %X) {
|
||||
%Y = call x86_fp80 @fabsl(x86_fp80 %X)
|
||||
%Y = call x86_fp80 @fabsl(x86_fp80 %X) readnone
|
||||
ret x86_fp80 %Y
|
||||
}
|
||||
; CHECK: {{^[ \t]+fabs$}}
|
||||
|
Reference in New Issue
Block a user