[llvm-commits] CVS: llvm/lib/Target/X86/FloatingPoint.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Apr 13 21:43:01 PDT 2004
Changes in directory llvm/lib/Target/X86:
FloatingPoint.cpp updated: 1.30 -> 1.31
---
Log message:
This is the real fix for Codegen/X86/2004-04-13-FPCMOV-Crash.llx which works
even when the "optimization" I added before is turned off. It generates this
extremely pointless code:
test:
fld QWORD PTR [%ESP + 4]
mov %AL, 0
test %AL, %AL
fcmove %ST(0), %ST(0)
ret
Good thing the optimizer will have removed this before code generation
anyway. :)
---
Diffs of the changes: (+8 -7)
Index: llvm/lib/Target/X86/FloatingPoint.cpp
diff -u llvm/lib/Target/X86/FloatingPoint.cpp:1.30 llvm/lib/Target/X86/FloatingPoint.cpp:1.31
--- llvm/lib/Target/X86/FloatingPoint.cpp:1.30 Sun Apr 11 22:02:48 2004
+++ llvm/lib/Target/X86/FloatingPoint.cpp Tue Apr 13 21:42:32 2004
@@ -682,13 +682,14 @@
MI->getOperand(0).setReg(getSTReg(Op1));
// If we kill the second operand, make sure to pop it from the stack.
- for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
- E = LV->killed_end(MI); KI != E; ++KI)
- if (KI->second == X86::FP0+Op1) {
- // Get this value off of the register stack.
- freeStackSlotAfter(I, Op1);
- break;
- }
+ if (Op0 != Op1)
+ for (LiveVariables::killed_iterator KI = LV->killed_begin(MI),
+ E = LV->killed_end(MI); KI != E; ++KI)
+ if (KI->second == X86::FP0+Op1) {
+ // Get this value off of the register stack.
+ freeStackSlotAfter(I, Op1);
+ break;
+ }
}
More information about the llvm-commits
mailing list