Skip to content

Commit 2b34fdc

Browse files
committed
[X86] Remove hasSideEffects=1 from the X87 pseudos with folded load.
This was done in r321424 to prevent scheduling from reordering things. But now that we model FPCW as a dependency, I don't think the same scheduling we were trying to prevent can occur. llvm-svn: 354628
1 parent b5321d7 commit 2b34fdc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

llvm/lib/Target/X86/X86InstrFPStack.td

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def _Fp80 : FpI_<(outs RFP80:$dst), (ins RFP80:$src1, RFP80:$src2), TwoArgFP,
180180
// These instructions cannot address 80-bit memory.
181181
multiclass FPBinary<SDNode OpNode, Format fp, string asmstring,
182182
bit Forward = 1> {
183-
let mayLoad = 1, hasSideEffects = 1 in {
184183
// ST(0) = ST(0) + [mem]
185184
def _Fp32m : FpIf32<(outs RFP32:$dst),
186185
(ins RFP32:$src1, f32mem:$src2), OneArgFPRW,
@@ -217,8 +216,10 @@ def _Fp80m64: FpI_<(outs RFP80:$dst),
217216
(OpNode RFP80:$src1, (f80 (extloadf64 addr:$src2)))),
218217
(set RFP80:$dst,
219218
(OpNode (f80 (extloadf64 addr:$src2)), RFP80:$src1)))]>;
219+
let mayLoad = 1 in
220220
def _F32m : FPI<0xD8, fp, (outs), (ins f32mem:$src),
221221
!strconcat("f", asmstring, "{s}\t$src")>;
222+
let mayLoad = 1 in
222223
def _F64m : FPI<0xDC, fp, (outs), (ins f64mem:$src),
223224
!strconcat("f", asmstring, "{l}\t$src")>;
224225
// ST(0) = ST(0) + [memint]
@@ -264,11 +265,12 @@ def _FpI32m80 : FpI_<(outs RFP80:$dst), (ins RFP80:$src1, i32mem:$src2),
264265
(OpNode RFP80:$src1, (X86fild32 addr:$src2))),
265266
(set RFP80:$dst,
266267
(OpNode (X86fild32 addr:$src2), RFP80:$src1)))]>;
268+
let mayLoad = 1 in
267269
def _FI16m : FPI<0xDE, fp, (outs), (ins i16mem:$src),
268270
!strconcat("fi", asmstring, "{s}\t$src")>;
271+
let mayLoad = 1 in
269272
def _FI32m : FPI<0xDA, fp, (outs), (ins i32mem:$src),
270273
!strconcat("fi", asmstring, "{l}\t$src")>;
271-
} // mayLoad = 1, hasSideEffects = 1
272274
}
273275

274276
let Defs = [FPSW], Uses = [FPCW] in {

llvm/test/CodeGen/X86/pr34080-2.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ define void @computeJD(%struct.DateTime*) nounwind {
6262
; CHECK-NEXT: imull $60000, 24(%ebx), %ecx # imm = 0xEA60
6363
; CHECK-NEXT: addl %eax, %ecx
6464
; CHECK-NEXT: fldl 28(%ebx)
65-
; CHECK-NEXT: fmuls {{\.LCPI.*}}
6665
; CHECK-NEXT: fnstcw {{[0-9]+}}(%esp)
6766
; CHECK-NEXT: movzwl {{[0-9]+}}(%esp), %eax
6867
; CHECK-NEXT: orl $3072, %eax # imm = 0xC00
6968
; CHECK-NEXT: movw %ax, {{[0-9]+}}(%esp)
7069
; CHECK-NEXT: movl %ecx, %eax
7170
; CHECK-NEXT: sarl $31, %eax
71+
; CHECK-NEXT: fmuls {{\.LCPI.*}}
7272
; CHECK-NEXT: fldcw {{[0-9]+}}(%esp)
7373
; CHECK-NEXT: fistpll {{[0-9]+}}(%esp)
7474
; CHECK-NEXT: fldcw {{[0-9]+}}(%esp)

0 commit comments

Comments
 (0)