]> granicus.if.org Git - llvm/commitdiff
[NFC][InstCombine] Add unary FNeg tests to AMDGPU/amdgcn-intrinsics.ll
authorCameron McInally <cameron.mcinally@nyu.edu>
Fri, 31 May 2019 19:12:59 +0000 (19:12 +0000)
committerCameron McInally <cameron.mcinally@nyu.edu>
Fri, 31 May 2019 19:12:59 +0000 (19:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362255 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll

index 9abb489f1adcb7eeca94e60c41254b711f6a99e2..ca5dd63bd5ca8572e5eccc2ffc1905678f82099e 100644 (file)
@@ -769,6 +769,16 @@ define float @cos_fneg_f32(float %x) {
   ret float %cos
 }
 
+define float @cos_unary_fneg_f32(float %x) {
+; CHECK-LABEL: @cos_unary_fneg_f32(
+; CHECK-NEXT:    [[COS:%.*]] = call float @llvm.amdgcn.cos.f32(float [[X:%.*]])
+; CHECK-NEXT:    ret float [[COS]]
+;
+  %x.fneg = fneg float %x
+  %cos = call float @llvm.amdgcn.cos.f32(float %x.fneg)
+  ret float %cos
+}
+
 define float @cos_fabs_f32(float %x) {
 ; CHECK-LABEL: @cos_fabs_f32(
 ; CHECK-NEXT:    [[COS:%.*]] = call float @llvm.amdgcn.cos.f32(float [[X:%.*]])
@@ -790,6 +800,17 @@ define float @cos_fabs_fneg_f32(float %x) {
   ret float %cos
 }
 
+define float @cos_fabs_unary_fneg_f32(float %x) {
+; CHECK-LABEL: @cos_fabs_unary_fneg_f32(
+; CHECK-NEXT:    [[COS:%.*]] = call float @llvm.amdgcn.cos.f32(float [[X:%.*]])
+; CHECK-NEXT:    ret float [[COS]]
+;
+  %x.fabs = call float @llvm.fabs.f32(float %x)
+  %x.fabs.fneg = fneg float %x.fabs
+  %cos = call float @llvm.amdgcn.cos.f32(float %x.fabs.fneg)
+  ret float %cos
+}
+
 ; --------------------------------------------------------------------
 ; llvm.amdgcn.cvt.pkrtz
 ; --------------------------------------------------------------------