[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Nov 20 14:01:52 PST 2005



Changes in directory llvm/lib/Target/X86:

X86ISelLowering.cpp updated: 1.2 -> 1.3
---
Log message:

use chain operands to ensure the copies don't wander from the rdtsc instruction.


---
Diffs of the changes:  (+9 -3)

 X86ISelLowering.cpp |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)


Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.2 llvm/lib/Target/X86/X86ISelLowering.cpp:1.3
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.2	Sun Nov 20 15:41:10 2005
+++ llvm/lib/Target/X86/X86ISelLowering.cpp	Sun Nov 20 16:01:40 2005
@@ -914,9 +914,15 @@
                        DAG.getSrcValue(NULL));
   }
   case ISD::READCYCLECOUNTER: {
-    SDOperand rd = DAG.getNode(X86ISD::RDTSC_DAG, MVT::Other, Op.getOperand(0));
-    SDOperand Lo = DAG.getCopyFromReg(rd, X86::EAX, MVT::i32);
-    SDOperand Hi = DAG.getCopyFromReg(rd, X86::EDX, MVT::i32);
+    std::vector<MVT::ValueType> Tys;
+    Tys.push_back(MVT::Other);
+    Tys.push_back(MVT::Flag);
+    std::vector<SDOperand> Ops;
+    Ops.push_back(Op.getOperand(0));
+    SDOperand rd = DAG.getNode(X86ISD::RDTSC_DAG, Tys, Ops);
+    SDOperand Lo = DAG.getCopyFromReg(rd, X86::EAX, MVT::i32, rd.getValue(1));
+    SDOperand Hi = DAG.getCopyFromReg(Lo.getValue(1), X86::EDX, 
+                                      MVT::i32, Lo.getValue(2));
     return DAG.getNode(ISD::BUILD_PAIR, MVT::i64, Lo, Hi);
   }
   }






More information about the llvm-commits mailing list