Index: lib/Target/X86/X86SchedBroadwell.td =================================================================== --- lib/Target/X86/X86SchedBroadwell.td +++ lib/Target/X86/X86SchedBroadwell.td @@ -80,7 +80,8 @@ // folded loads. multiclass BWWriteResPair ExePorts, - int Lat, list Res = [1], int UOps = 1> { + int Lat, list Res = [1], int UOps = 1, + int LoadLat = 5> { // Register variant is using a single cycle on ExePort. def : WriteRes { let Latency = Lat; @@ -88,12 +89,12 @@ let NumMicroOps = UOps; } - // Memory variant also uses a cycle on port 2/3 and adds 5 cycles to the - // latency. + // Memory variant also uses a cycle on port 2/3 and adds LoadLat cycles to + // the latency (default = 5). def : WriteRes { - let Latency = !add(Lat, 5); + let Latency = !add(Lat, LoadLat); let ResourceCycles = !listconcat([1], Res); - let NumMicroOps = UOps; + let NumMicroOps = !add(UOps, 1); } } Index: lib/Target/X86/X86SchedHaswell.td =================================================================== --- lib/Target/X86/X86SchedHaswell.td +++ lib/Target/X86/X86SchedHaswell.td @@ -81,7 +81,8 @@ // folded loads. multiclass HWWriteResPair ExePorts, - int Lat, list Res = [1], int UOps = 1> { + int Lat, list Res = [1], int UOps = 1, + int LoadLat = 5> { // Register variant is using a single cycle on ExePort. def : WriteRes { let Latency = Lat; @@ -89,12 +90,12 @@ let NumMicroOps = UOps; } - // Memory variant also uses a cycle on port 2/3 and adds 5 cycles to the - // latency. + // Memory variant also uses a cycle on port 2/3 and adds LoadLat cycles to + // the latency (default = 5). def : WriteRes { - let Latency = !add(Lat, 5); + let Latency = !add(Lat, LoadLat); let ResourceCycles = !listconcat([1], Res); - let NumMicroOps = UOps; + let NumMicroOps = !add(UOps, 1); } } Index: lib/Target/X86/X86SchedSandyBridge.td =================================================================== --- lib/Target/X86/X86SchedSandyBridge.td +++ lib/Target/X86/X86SchedSandyBridge.td @@ -72,7 +72,8 @@ // folded loads. multiclass SBWriteResPair ExePorts, - int Lat, list Res = [1], int UOps = 1> { + int Lat, list Res = [1], int UOps = 1, + int LoadLat = 4> { // Register variant is using a single cycle on ExePort. def : WriteRes { let Latency = Lat; @@ -80,12 +81,12 @@ let NumMicroOps = UOps; } - // Memory variant also uses a cycle on port 2/3 and adds 4 cycles to the - // latency. + // Memory variant also uses a cycle on port 2/3 and adds LoadLat cycles to + // the latency (default = 4). def : WriteRes { - let Latency = !add(Lat, 4); + let Latency = !add(Lat, LoadLat); let ResourceCycles = !listconcat([1], Res); - let NumMicroOps = UOps; + let NumMicroOps = !add(UOps, 1); } } Index: lib/Target/X86/X86SchedSkylakeClient.td =================================================================== --- lib/Target/X86/X86SchedSkylakeClient.td +++ lib/Target/X86/X86SchedSkylakeClient.td @@ -78,7 +78,8 @@ // folded loads. multiclass SKLWriteResPair ExePorts, - int Lat, list Res = [1], int UOps = 1> { + int Lat, list Res = [1], int UOps = 1, + int LoadLat = 5> { // Register variant is using a single cycle on ExePort. def : WriteRes { let Latency = Lat; @@ -86,12 +87,12 @@ let NumMicroOps = UOps; } - // Memory variant also uses a cycle on port 2/3 and adds 5 cycles to the - // latency. + // Memory variant also uses a cycle on port 2/3 and adds LoadLat cycles to + // the latency (default = 5). def : WriteRes { - let Latency = !add(Lat, 5); + let Latency = !add(Lat, LoadLat); let ResourceCycles = !listconcat([1], Res); - let NumMicroOps = UOps; + let NumMicroOps = !add(UOps, 1); } } Index: lib/Target/X86/X86SchedSkylakeServer.td =================================================================== --- lib/Target/X86/X86SchedSkylakeServer.td +++ lib/Target/X86/X86SchedSkylakeServer.td @@ -78,7 +78,8 @@ // folded loads. multiclass SKXWriteResPair ExePorts, - int Lat, list Res = [1], int UOps = 1> { + int Lat, list Res = [1], int UOps = 1, + int LoadLat = 5> { // Register variant is using a single cycle on ExePort. def : WriteRes { let Latency = Lat; @@ -86,12 +87,12 @@ let NumMicroOps = UOps; } - // Memory variant also uses a cycle on port 2/3 and adds 5 cycles to the - // latency. + // Memory variant also uses a cycle on port 2/3 and adds LoadLat cycles to + // the latency (default = 5). def : WriteRes { - let Latency = !add(Lat, 5); + let Latency = !add(Lat, LoadLat); let ResourceCycles = !listconcat([1], Res); - let NumMicroOps = UOps; + let NumMicroOps = !add(UOps, 1); } } Index: lib/Target/X86/X86ScheduleSLM.td =================================================================== --- lib/Target/X86/X86ScheduleSLM.td +++ lib/Target/X86/X86ScheduleSLM.td @@ -57,7 +57,8 @@ // folded loads. multiclass SMWriteResPair ExePorts, - int Lat, list Res = [1], int UOps = 1> { + int Lat, list Res = [1], int UOps = 1, + int LoadLat = 3> { // Register variant is using a single cycle on ExePort. def : WriteRes { let Latency = Lat; @@ -65,10 +66,10 @@ let NumMicroOps = UOps; } - // Memory variant also uses a cycle on MEC_RSV and adds 3 cycles to the - // latency. + // Memory variant also uses a cycle on MEC_RSV and adds LoadLat cycles to + // the latency (default = 3). def : WriteRes { - let Latency = !add(Lat, 3); + let Latency = !add(Lat, LoadLat); let ResourceCycles = !listconcat([1], Res); let NumMicroOps = UOps; }