From 0badf27c16e4928826f313e55be22c18c142f54d Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 28 Nov 2017 16:57:20 +0000 Subject: [PATCH] [X86][X87] Tag FTST x87 instruction scheduler class Looking through Agner, FTST is very similar to generic float compare behaviour, so I've added them to the existing IIC_FCOMI (WriteFAdd) tags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319184 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrFPStack.td | 3 ++- test/CodeGen/X86/x87-schedule.ll | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/Target/X86/X86InstrFPStack.td b/lib/Target/X86/X86InstrFPStack.td index 1ac62a74bce..00e85553254 100644 --- a/lib/Target/X86/X86InstrFPStack.td +++ b/lib/Target/X86/X86InstrFPStack.td @@ -327,7 +327,8 @@ def TST_Fp64 : FpIf64<(outs), (ins RFP64:$src), OneArgFP, []>; def TST_Fp80 : FpI_<(outs), (ins RFP80:$src), OneArgFP, []>; } // hasSideEffects -def TST_F : FPI<0xD9, MRM_E4, (outs), (ins), "ftst">; +let SchedRW = [WriteFAdd] in +def TST_F : FPI<0xD9, MRM_E4, (outs), (ins), "ftst", IIC_FCOMI>; } // Defs = [FPSW] // Versions of FP instructions that take a single memory operand. Added for the diff --git a/test/CodeGen/X86/x87-schedule.ll b/test/CodeGen/X86/x87-schedule.ll index 05e4ac7cdc8..2b134aaae58 100644 --- a/test/CodeGen/X86/x87-schedule.ll +++ b/test/CodeGen/X86/x87-schedule.ll @@ -3778,21 +3778,21 @@ define void @test_ftst() optsize { ; ATOM-LABEL: test_ftst: ; ATOM: # BB#0: ; ATOM-NEXT: #APP -; ATOM-NEXT: ftst +; ATOM-NEXT: ftst # sched: [9:4.50] ; ATOM-NEXT: #NO_APP ; ATOM-NEXT: retl # sched: [79:39.50] ; ; SLM-LABEL: test_ftst: ; SLM: # BB#0: ; SLM-NEXT: #APP -; SLM-NEXT: ftst +; SLM-NEXT: ftst # sched: [3:1.00] ; SLM-NEXT: #NO_APP ; SLM-NEXT: retl # sched: [4:1.00] ; ; SANDY-LABEL: test_ftst: ; SANDY: # BB#0: ; SANDY-NEXT: #APP -; SANDY-NEXT: ftst +; SANDY-NEXT: ftst # sched: [3:1.00] ; SANDY-NEXT: #NO_APP ; SANDY-NEXT: retl # sched: [5:1.00] ; @@ -3806,28 +3806,28 @@ define void @test_ftst() optsize { ; BROADWELL-LABEL: test_ftst: ; BROADWELL: # BB#0: ; BROADWELL-NEXT: #APP -; BROADWELL-NEXT: ftst +; BROADWELL-NEXT: ftst # sched: [3:1.00] ; BROADWELL-NEXT: #NO_APP ; BROADWELL-NEXT: retl # sched: [6:0.50] ; ; SKYLAKE-LABEL: test_ftst: ; SKYLAKE: # BB#0: ; SKYLAKE-NEXT: #APP -; SKYLAKE-NEXT: ftst +; SKYLAKE-NEXT: ftst # sched: [3:1.00] ; SKYLAKE-NEXT: #NO_APP ; SKYLAKE-NEXT: retl # sched: [6:0.50] ; ; SKX-LABEL: test_ftst: ; SKX: # BB#0: ; SKX-NEXT: #APP -; SKX-NEXT: ftst +; SKX-NEXT: ftst # sched: [3:1.00] ; SKX-NEXT: #NO_APP ; SKX-NEXT: retl # sched: [6:0.50] ; ; BTVER2-LABEL: test_ftst: ; BTVER2: # BB#0: ; BTVER2-NEXT: #APP -; BTVER2-NEXT: ftst +; BTVER2-NEXT: ftst # sched: [3:1.00] ; BTVER2-NEXT: #NO_APP ; BTVER2-NEXT: retl # sched: [4:1.00] ; -- 2.50.1