[llvm] r313555 - [AArch64] Adjust the cost model for Exynos M1 and M2

Evandro Menezes via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 12:00:38 PDT 2017


Author: evandro
Date: Mon Sep 18 12:00:38 2017
New Revision: 313555

URL: http://llvm.org/viewvc/llvm-project?rev=313555&view=rev
Log:
[AArch64] Adjust the cost model for Exynos M1 and M2

Refine the model of FP loads and stores.

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64SchedM1.td

Modified: llvm/trunk/lib/Target/AArch64/AArch64SchedM1.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64SchedM1.td?rev=313555&r1=313554&r2=313555&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64SchedM1.td (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64SchedM1.td Mon Sep 18 12:00:38 2017
@@ -88,13 +88,37 @@ def M1WriteBX : SchedWriteVariant<[Sched
                                                                    M1WriteC1]>]>;
 
 def M1WriteL5 : SchedWriteRes<[M1UnitL]> { let Latency = 5; }
+def M1WriteLA : SchedWriteRes<[M1UnitL,
+                               M1UnitL]> { let Latency = 5; }
+def M1WriteLB : SchedWriteRes<[M1UnitL]> { let Latency = 6;
+                                           let ResourceCycles = [2]; }
+def M1WriteLC : SchedWriteRes<[M1UnitA,
+                               M1UnitL]> { let Latency = 5; }
+def M1WriteLD : SchedWriteRes<[M1UnitA,
+                               M1UnitL,
+                               M1UnitL]> { let Latency = 5; }
 def M1WriteLX : SchedWriteVariant<[SchedVar<M1ShiftLeftFastPred, [M1WriteL5]>,
                                    SchedVar<NoSchedPred,         [M1WriteA1,
                                                                   M1WriteL5]>]>;
 
-def M1WriteS1 : SchedWriteRes<[M1UnitS]> { let Latency = 1; }
-def M1WriteS2 : SchedWriteRes<[M1UnitS]> { let Latency = 2; }
-def M1WriteS4 : SchedWriteRes<[M1UnitS]> { let Latency = 4; }
+def M1WriteS1 : SchedWriteRes<[M1UnitS]>   { let Latency = 1; }
+def M1WriteS2 : SchedWriteRes<[M1UnitS]>   { let Latency = 2; }
+def M1WriteS4 : SchedWriteRes<[M1UnitS]>   { let Latency = 4; }
+def M1WriteSA : SchedWriteRes<[M1UnitS,
+                               M1UnitFST,
+                               M1UnitS,
+                               M1UnitFST]> { let Latency = 1; }
+def M1WriteSB : SchedWriteRes<[M1UnitS,
+                               M1UnitFST,
+                               M1UnitA]>   { let Latency = 2; }
+def M1WriteSC : SchedWriteRes<[M1UnitS,
+                               M1UnitFST,
+                               M1UnitA]>   { let Latency = 1; }
+def M1WriteSD : SchedWriteRes<[M1UnitS,
+                               M1UnitFST,
+                               M1UnitS,
+                               M1UnitFST,
+                               M1UnitA]>   { let Latency = 1; }
 def M1WriteSX : SchedWriteVariant<[SchedVar<M1ShiftLeftFastPred, [M1WriteS1]>,
                                    SchedVar<NoSchedPred,         [M1WriteA1,
                                                                   M1WriteS1]>]>;
@@ -165,7 +189,8 @@ def : WriteRes<WriteFCopy, [M1UnitS]>
 def : WriteRes<WriteVLD, [M1UnitL]> { let Latency = 5; }
 
 // FP store instructions.
-def : WriteRes<WriteVST, [M1UnitS, M1UnitFST]> { let Latency = 1; }
+def : WriteRes<WriteVST, [M1UnitS,
+                          M1UnitFST]> { let Latency = 1; }
 
 // ASIMD FP instructions.
 def : WriteRes<WriteV, [M1UnitFADD]> { let Latency = 3; }
@@ -404,32 +429,46 @@ def : InstRW<[M1WriteS4],     (instregex
 def : InstRW<[M1WriteNEONI],  (instregex "^FMOV[DS][WX](High)?r")>;
 
 // FP load instructions.
+def : InstRW<[WriteVLD],    (instregex "^LDR[DSQ]l")>;
+def : InstRW<[WriteVLD],    (instregex "^LDUR[BDHSQ]i")>;
 def : InstRW<[WriteVLD,
               WriteAdr,
-              M1WriteA1],   (instregex "^LDP[DS](post|pre)")>;
-def : InstRW<[WriteVLD,
-              WriteVLD,
-              WriteAdr,
-              M1WriteA1],   (instregex "^LDPQ(post|pre)")>;
+              ReadAdrBase], (instregex "^LDR[BDHSQ](post|pre)")>;
+def : InstRW<[WriteVLD],    (instregex "^LDR[BDHSQ]ui")>;
 def : InstRW<[M1WriteLX,
               ReadAdrBase], (instregex "^LDR[BDHS]ro[WX]")>;
-def : InstRW<[M1WriteA1,
-              M1WriteL5,
+def : InstRW<[M1WriteLC,
               ReadAdrBase], (instregex "^LDRQro[WX]")>;
+def : InstRW<[WriteVLD,
+              WriteLDHi],   (instregex "^LDN?P[DS]i")>;
+def : InstRW<[M1WriteLB,
+              WriteLDHi],   (instregex "^LDN?PQi")>;
+def : InstRW<[M1WriteLC,
+              WriteLDHi,
+              WriteAdr,
+              ReadAdrBase], (instregex "^LDP[DS](post|pre)")>;
+def : InstRW<[M1WriteLD,
+              WriteLDHi,
+              WriteAdr,
+              ReadAdrBase], (instregex "^LDPQ(post|pre)")>;
 
 // FP store instructions.
+def : InstRW<[WriteVST],    (instregex "^STUR[BDHSQ]i")>;
 def : InstRW<[WriteVST,
               WriteAdr,
-              M1WriteA1],   (instregex "^STP[DS](post|pre)")>;
-def : InstRW<[WriteVST,
-              WriteVST,
-              WriteAdr,
-              M1WriteA1],   (instregex "^STPQ(post|pre)")>;
+              ReadAdrBase], (instregex "^STR[BDHSQ](post|pre)")>;
+def : InstRW<[WriteVST],    (instregex "^STR[BDHSQ]ui")>;
 def : InstRW<[M1WriteSY,
               ReadAdrBase], (instregex "^STR[BDHS]ro[WX]")>;
-def : InstRW<[M1WriteA1,
-              M1WriteS2,
+def : InstRW<[M1WriteSB,
               ReadAdrBase], (instregex "^STRQro[WX]")>;
+def : InstRW<[WriteVST],    (instregex "^STN?P[DSQ]i")>;
+def : InstRW<[M1WriteSC,
+              WriteAdr,
+              ReadAdrBase], (instregex "^STP[DS](post|pre)")>;
+def : InstRW<[M1WriteSD,
+              WriteAdr,
+              ReadAdrBase], (instregex "^STPQ(post|pre)")>;
 
 // ASIMD instructions.
 def : InstRW<[M1WriteNMISC3], (instregex "^[SU]ABAL?v")>;




More information about the llvm-commits mailing list