[llvm] r362255 - [NFC][InstCombine] Add unary FNeg tests to AMDGPU/amdgcn-intrinsics.ll
Cameron McInally via llvm-commits
llvm-commits at lists.llvm.org
Fri May 31 12:12:59 PDT 2019
Author: mcinally
Date: Fri May 31 12:12:59 2019
New Revision: 362255
URL: http://llvm.org/viewvc/llvm-project?rev=362255&view=rev
Log:
[NFC][InstCombine] Add unary FNeg tests to AMDGPU/amdgcn-intrinsics.ll
Modified:
llvm/trunk/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll
Modified: llvm/trunk/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll?rev=362255&r1=362254&r2=362255&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll Fri May 31 12:12:59 2019
@@ -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:%.*]])
@@ -789,6 +799,17 @@ define float @cos_fabs_fneg_f32(float %x
%cos = call float @llvm.amdgcn.cos.f32(float %x.fabs.fneg)
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
More information about the llvm-commits
mailing list