Skip to content

Commit f8a3850

Browse files
committed
[InstCombine] [NFC] Add a test for fneg.ll
1 parent cbcdd5f commit f8a3850

File tree

1 file changed

+13
-0
lines changed
  • llvm/test/Transforms/InstCombine

1 file changed

+13
-0
lines changed

llvm/test/Transforms/InstCombine/fneg.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,19 @@ define float @fnabs(float %a) {
730730
ret float %fneg1
731731
}
732732

733+
define float @fnabs_1(float %a) {
734+
; CHECK-LABEL: @fnabs_1(
735+
; CHECK-NEXT: [[TMP1:%.*]] = call nsz float @llvm.fabs.f32(float [[A:%.*]])
736+
; CHECK-NEXT: [[FNEG1:%.*]] = fneg float [[TMP1]]
737+
; CHECK-NEXT: ret float [[FNEG1]]
738+
;
739+
%fneg = fneg float %a
740+
%cmp = fcmp olt float %a, %fneg
741+
%sel = select nsz i1 %cmp, float %fneg, float %a
742+
%fneg1 = fneg float %sel
743+
ret float %fneg1
744+
}
745+
733746
define float @select_fneg_both(float %x, float %y, i1 %b) {
734747
; CHECK-LABEL: @select_fneg_both(
735748
; CHECK-NEXT: [[S_V:%.*]] = select i1 [[B:%.*]], float [[X:%.*]], float [[Y:%.*]]

0 commit comments

Comments
 (0)