Index: lib/Target/X86/X86InstrFMA.td =================================================================== --- lib/Target/X86/X86InstrFMA.td +++ lib/Target/X86/X86InstrFMA.td @@ -51,7 +51,7 @@ "\t{$src3, $src2, $dst|$dst, $src2, $src3}"), [(set RC:$dst, (VT (Op RC:$src2, RC:$src1, (MemFrag addr:$src3))))]>, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; } multiclass fma3p_rm_231 opc, string OpcodeStr, RegisterClass RC, @@ -70,7 +70,8 @@ !strconcat(OpcodeStr, "\t{$src3, $src2, $dst|$dst, $src2, $src3}"), [(set RC:$dst, (VT (Op RC:$src2, (MemFrag addr:$src3), - RC:$src1)))]>, Sched<[WriteFMALd, ReadAfterLd]>; + RC:$src1)))]>, + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; } multiclass fma3p_rm_132 opc, string OpcodeStr, RegisterClass RC, @@ -91,7 +92,8 @@ !strconcat(OpcodeStr, "\t{$src3, $src2, $dst|$dst, $src2, $src3}"), [(set RC:$dst, (VT (Op (MemFrag addr:$src3), RC:$src1, - RC:$src2)))]>, Sched<[WriteFMALd, ReadAfterLd]>; + RC:$src2)))]>, + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; } let Constraints = "$src1 = $dst", hasSideEffects = 0, isCommutable = 1 in @@ -184,7 +186,7 @@ "\t{$src3, $src2, $dst|$dst, $src2, $src3}"), [(set RC:$dst, (OpNode RC:$src2, RC:$src1, (load addr:$src3)))]>, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; } multiclass fma3s_rm_231 opc, string OpcodeStr, @@ -204,7 +206,7 @@ "\t{$src3, $src2, $dst|$dst, $src2, $src3}"), [(set RC:$dst, (OpNode RC:$src2, (load addr:$src3), RC:$src1))]>, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; } multiclass fma3s_rm_132 opc, string OpcodeStr, @@ -226,7 +228,7 @@ "\t{$src3, $src2, $dst|$dst, $src2, $src3}"), [(set RC:$dst, (OpNode (load addr:$src3), RC:$src1, RC:$src2))]>, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; } let Constraints = "$src1 = $dst", isCommutable = 1, hasSideEffects = 0 in @@ -270,7 +272,7 @@ (ins RC:$src1, RC:$src2, memopr:$src3), !strconcat(OpcodeStr, "\t{$src3, $src2, $dst|$dst, $src2, $src3}"), - []>, Sched<[WriteFMALd, ReadAfterLd]>; + []>, Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; } // The FMA 213 form is created for lowering of scalar FMA intrinscis @@ -374,14 +376,19 @@ "\t{$src3, $src2, $src1, $dst|$dst, $src1, $src2, $src3}"), [(set RC:$dst, (OpNode RC:$src1, RC:$src2, (mem_frag addr:$src3)))]>, VEX_W, VEX_LIG, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; def mr : FMA4S, VEX_LIG, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, + // x86memop:$src2 + ReadDefault, ReadDefault, ReadDefault, ReadDefault, + ReadDefault, + // RC:$src3 + ReadAfterLd]>; // For disassembler let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in def rr_REV : FMA4S, VEX_W, VEX_LIG, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; def mr_Int : FMA4S_Int, - VEX_LIG, Sched<[WriteFMALd, ReadAfterLd]>; + VEX_LIG, Sched<[WriteFMALd, ReadAfterLd, + // memop:$src2 + ReadDefault, ReadDefault, ReadDefault, + ReadDefault, ReadDefault, + // VR128::$src3 + ReadAfterLd]>; let hasSideEffects = 0 in def rr_Int_REV : FMA4S_Int, VEX_W, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; def mr : FMA4, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, + // f128mem:$src2 + ReadDefault, ReadDefault, ReadDefault, ReadDefault, + ReadDefault, + // VR128::$src3 + ReadAfterLd]>; let isCommutable = 1 in def Yrr : FMA4, VEX_W, VEX_L, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, ReadAfterLd]>; def Ymr : FMA4, VEX_L, - Sched<[WriteFMALd, ReadAfterLd]>; + Sched<[WriteFMALd, ReadAfterLd, + // f256mem:$src2 + ReadDefault, ReadDefault, ReadDefault, ReadDefault, + ReadDefault, + // VR256::$src3 + ReadAfterLd]>; // For disassembler let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in { def rr_REV : FMA4, TAPD, VEX_4V, - Sched<[Sched.Folded, ReadAfterLd]>; + Sched<[Sched.Folded, ReadAfterLd, + // x86memop:$src2 + ReadDefault, ReadDefault, ReadDefault, ReadDefault, + ReadDefault, + // RC::$src3 + ReadAfterLd]>; } let Predicates = [HasAVX] in { Index: lib/Target/X86/X86InstrShiftRotate.td =================================================================== --- lib/Target/X86/X86InstrShiftRotate.td +++ lib/Target/X86/X86InstrShiftRotate.td @@ -897,7 +897,7 @@ // x86memop:$src1 ReadDefault, ReadDefault, ReadDefault, ReadDefault, ReadDefault, - // RC:$src1 + // RC:$src2 ReadAfterLd]>; } } Index: lib/Target/X86/X86InstrXOP.td =================================================================== --- lib/Target/X86/X86InstrXOP.td +++ lib/Target/X86/X86InstrXOP.td @@ -287,7 +287,7 @@ [(set VR128:$dst, (vt128 (OpNode (vt128 VR128:$src1), (vt128 VR128:$src2), (vt128 (bitconvert (loadv2i64 addr:$src3))))))]>, - XOP_4V, VEX_W, Sched<[WriteShuffleLd, ReadAfterLd]>; + XOP_4V, VEX_W, Sched<[WriteShuffleLd, ReadAfterLd, ReadAfterLd]>; def rmr : IXOPi8Reg, - XOP_4V, Sched<[WriteShuffleLd, ReadAfterLd]>; + XOP_4V, Sched<[WriteShuffleLd, ReadAfterLd, + // 128mem:$src2 + ReadDefault, ReadDefault, ReadDefault, ReadDefault, + ReadDefault, + // VR128:$src3 + ReadAfterLd]>; // For disassembler let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in def rrr_REV : IXOPi8Reg, - XOP_4V, VEX_W, Sched<[WriteShuffleLd, ReadAfterLd]>; + XOP_4V, VEX_W, Sched<[WriteShuffleLd, ReadAfterLd, ReadAfterLd]>; def rmr : IXOPi8Reg, - XOP_4V, Sched<[WriteShuffleLd, ReadAfterLd]>; + XOP_4V, Sched<[WriteShuffleLd, ReadAfterLd, + // x86memop:$src2 + ReadDefault, ReadDefault, ReadDefault, ReadDefault, + ReadDefault, + // RC::$src3 + ReadAfterLd]>; // For disassembler let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in def rrr_REV : IXOPi8Reg, VEX_W, - Sched<[WriteFShuffleLd, ReadAfterLd]>; + Sched<[WriteFShuffleLd, ReadAfterLd, ReadAfterLd]>; def mr : IXOP5, - Sched<[WriteFShuffleLd, ReadAfterLd]>; + Sched<[WriteFShuffleLd, ReadAfterLd, + // fpmemop:$src2 + ReadDefault, ReadDefault, ReadDefault, ReadDefault, ReadDefault, + // RC:$src3 + ReadAfterLd]>; // For disassembler let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in def rr_REV : IXOP5