[llvm] 7f5c2f6 - [x86] consolidate tests and auto-gen complete check lines; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 29 11:58:16 PDT 2022
Author: Sanjay Patel
Date: 2022-03-29T14:55:04-04:00
New Revision: 7f5c2f6a762416874cae494668e34dcc673fd4af
URL: https://github.com/llvm/llvm-project/commit/7f5c2f6a762416874cae494668e34dcc673fd4af
DIFF: https://github.com/llvm/llvm-project/commit/7f5c2f6a762416874cae494668e34dcc673fd4af.diff
LOG: [x86] consolidate tests and auto-gen complete check lines; NFC
The same test was duplicated in 2 files.
Added:
Modified:
llvm/test/CodeGen/X86/fp-stack-compare.ll
Removed:
llvm/test/CodeGen/X86/fp-stack-compare-cmov.ll
################################################################################
diff --git a/llvm/test/CodeGen/X86/fp-stack-compare-cmov.ll b/llvm/test/CodeGen/X86/fp-stack-compare-cmov.ll
deleted file mode 100644
index d0e816db3b693..0000000000000
--- a/llvm/test/CodeGen/X86/fp-stack-compare-cmov.ll
+++ /dev/null
@@ -1,12 +0,0 @@
-; RUN: llc < %s -mtriple=i686-- -mcpu=pentiumpro | FileCheck %s
-; PR1012
-
-define float @foo(float* %col.2.0) {
-; CHECK: fucompi
-; CHECK: fcmov
- %tmp = load float, float* %col.2.0
- %tmp16 = fcmp olt float %tmp, 0.000000e+00
- %tmp20 = fsub float -0.000000e+00, %tmp
- %iftmp.2.0 = select i1 %tmp16, float %tmp20, float %tmp
- ret float %iftmp.2.0
-}
diff --git a/llvm/test/CodeGen/X86/fp-stack-compare.ll b/llvm/test/CodeGen/X86/fp-stack-compare.ll
index 8ff0dd442f9d5..83796b39e4b85 100644
--- a/llvm/test/CodeGen/X86/fp-stack-compare.ll
+++ b/llvm/test/CodeGen/X86/fp-stack-compare.ll
@@ -1,14 +1,44 @@
-; RUN: llc < %s -mtriple=i686-- -mcpu=i386 | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=i686-- -mcpu=i386 | FileCheck %s --check-prefix=BASE
+; RUN: llc < %s -mtriple=i686-- -mcpu=pentiumpro | FileCheck %s --check-prefix=CMOV
; PR6679
-define float @foo(float* %col.2.0) {
-; CHECK: fucomp
-; CHECK-NOT: fucompi
-; CHECK: j
-; CHECK-NOT: fcmov
- %tmp = load float, float* %col.2.0
- %tmp16 = fcmp olt float %tmp, 0.000000e+00
- %tmp20 = fsub float -0.000000e+00, %tmp
- %iftmp.2.0 = select i1 %tmp16, float %tmp20, float %tmp
- ret float %iftmp.2.0
+define float @foo(float* %col) {
+; BASE-LABEL: foo:
+; BASE: # %bb.0:
+; BASE-NEXT: movl {{[0-9]+}}(%esp), %eax
+; BASE-NEXT: flds (%eax)
+; BASE-NEXT: fldz
+; BASE-NEXT: fucomp %st(1)
+; BASE-NEXT: fnstsw %ax
+; BASE-NEXT: # kill: def $ah killed $ah killed $ax
+; BASE-NEXT: sahf
+; BASE-NEXT: fld %st(0)
+; BASE-NEXT: fchs
+; BASE-NEXT: ja .LBB0_2
+; BASE-NEXT: # %bb.1:
+; BASE-NEXT: fstp %st(0)
+; BASE-NEXT: fldz
+; BASE-NEXT: fxch %st(1)
+; BASE-NEXT: .LBB0_2:
+; BASE-NEXT: fstp %st(1)
+; BASE-NEXT: retl
+;
+; CMOV-LABEL: foo:
+; CMOV: # %bb.0:
+; CMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
+; CMOV-NEXT: flds (%eax)
+; CMOV-NEXT: fldz
+; CMOV-NEXT: fucompi %st(1), %st
+; CMOV-NEXT: fld %st(0)
+; CMOV-NEXT: fchs
+; CMOV-NEXT: fxch %st(1)
+; CMOV-NEXT: fcmovnbe %st(1), %st
+; CMOV-NEXT: fstp %st(1)
+; CMOV-NEXT: retl
+ %t = load float, float* %col
+ %t16 = fcmp olt float %t, 0.0
+ %t20 = fsub float -0.000000e+00, %t
+ %ift = select i1 %t16, float %t20, float %t
+ ret float %ift
}
More information about the llvm-commits
mailing list