summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2012-08-03 23:29:17 +0000
committerBob Wilson <bob.wilson@apple.com>2012-08-03 23:29:17 +0000
commit874886cd66261b7e5039a975769503f53cdd42db (patch)
tree76d59bee74b823a48cec2a54c9228e3144cfca9d /llvm/test/CodeGen/ARM
parent1162a1548b5ea42b255cd81ad66f4878a0b235c3 (diff)
downloadbcm5719-llvm-874886cd66261b7e5039a975769503f53cdd42db.tar.gz
bcm5719-llvm-874886cd66261b7e5039a975769503f53cdd42db.zip
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. llvm-svn: 161282
Diffstat (limited to 'llvm/test/CodeGen/ARM')
-rw-r--r--llvm/test/CodeGen/ARM/fabss.ll2
-rw-r--r--llvm/test/CodeGen/ARM/fcopysign.ll6
-rw-r--r--llvm/test/CodeGen/ARM/fparith.ll4
-rw-r--r--llvm/test/CodeGen/ARM/vfp.ll4
4 files changed, 8 insertions, 8 deletions
diff --git a/llvm/test/CodeGen/ARM/fabss.ll b/llvm/test/CodeGen/ARM/fabss.ll
index 45c322dce8b..5c0db88407a 100644
--- a/llvm/test/CodeGen/ARM/fabss.ll
+++ b/llvm/test/CodeGen/ARM/fabss.ll
@@ -6,7 +6,7 @@
define float @test(float %a, float %b) {
entry:
%dum = fadd float %a, %b
- %0 = tail call float @fabsf(float %dum)
+ %0 = tail call float @fabsf(float %dum) readnone
%dum1 = fadd float %0, %b
ret float %dum1
}
diff --git a/llvm/test/CodeGen/ARM/fcopysign.ll b/llvm/test/CodeGen/ARM/fcopysign.ll
index 27fa2b093d8..5511d24cb28 100644
--- a/llvm/test/CodeGen/ARM/fcopysign.ll
+++ b/llvm/test/CodeGen/ARM/fcopysign.ll
@@ -11,7 +11,7 @@ entry:
; HARD: test1:
; HARD: vmov.i32 [[REG1:(d[0-9]+)]], #0x80000000
; HARD: vbsl [[REG1]], d
- %0 = tail call float @copysignf(float %x, float %y) nounwind
+ %0 = tail call float @copysignf(float %x, float %y) nounwind readnone
ret float %0
}
@@ -25,7 +25,7 @@ entry:
; HARD: vmov.i32 [[REG2:(d[0-9]+)]], #0x80000000
; HARD: vshl.i64 [[REG2]], [[REG2]], #32
; HARD: vbsl [[REG2]], d1, d0
- %0 = tail call double @copysign(double %x, double %y) nounwind
+ %0 = tail call double @copysign(double %x, double %y) nounwind readnone
ret double %0
}
@@ -36,7 +36,7 @@ entry:
; SOFT: vshl.i64 [[REG3]], [[REG3]], #32
; SOFT: vbsl [[REG3]],
%0 = fmul double %x, %y
- %1 = tail call double @copysign(double %0, double %z) nounwind
+ %1 = tail call double @copysign(double %0, double %z) nounwind readnone
ret double %1
}
diff --git a/llvm/test/CodeGen/ARM/fparith.ll b/llvm/test/CodeGen/ARM/fparith.ll
index ce6d6b29e9d..a8bae3b9519 100644
--- a/llvm/test/CodeGen/ARM/fparith.ll
+++ b/llvm/test/CodeGen/ARM/fparith.ll
@@ -84,7 +84,7 @@ define float @f11(float %a) {
;CHECK: f11:
;CHECK: bic
entry:
- %tmp1 = call float @fabsf( float %a ) ; <float> [#uses=1]
+ %tmp1 = call float @fabsf( float %a ) readnone ; <float> [#uses=1]
ret float %tmp1
}
@@ -94,7 +94,7 @@ define double @f12(double %a) {
;CHECK: f12:
;CHECK: vabs.f64
entry:
- %tmp1 = call double @fabs( double %a ) ; <double> [#uses=1]
+ %tmp1 = call double @fabs( double %a ) readnone ; <double> [#uses=1]
ret double %tmp1
}
diff --git a/llvm/test/CodeGen/ARM/vfp.ll b/llvm/test/CodeGen/ARM/vfp.ll
index 49a69827bc0..bf0f3680c13 100644
--- a/llvm/test/CodeGen/ARM/vfp.ll
+++ b/llvm/test/CodeGen/ARM/vfp.ll
@@ -17,11 +17,11 @@ define void @test_abs(float* %P, double* %D) {
;CHECK: test_abs:
%a = load float* %P ; <float> [#uses=1]
;CHECK: vabs.f32
- %b = call float @fabsf( float %a ) ; <float> [#uses=1]
+ %b = call float @fabsf( float %a ) readnone ; <float> [#uses=1]
store float %b, float* %P
%A = load double* %D ; <double> [#uses=1]
;CHECK: vabs.f64
- %B = call double @fabs( double %A ) ; <double> [#uses=1]
+ %B = call double @fabs( double %A ) readnone ; <double> [#uses=1]
store double %B, double* %D
ret void
}
OpenPOWER on IntegriCloud