[PowerPC] Implement readcyclecounter for PPC32
[oota-llvm.git] / lib / Target / PowerPC / PPCISelDAGToDAG.cpp
index 49ba58b3e4bf93cb1f188e7c53d54441830d638c..cb7d73a04c2f1791535868caa0ccc710c92c3b9d 100644 (file)
@@ -1026,6 +1026,11 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
                                   N->getOperand(0), InFlag);
   }
 
+  case PPCISD::READ_TIME_BASE: {
+    return CurDAG->getMachineNode(PPC::ReadTB, dl, MVT::i32, MVT::i32,
+                                  MVT::Other, N->getOperand(0));
+  }
+
   case ISD::SDIV: {
     // FIXME: since this depends on the setting of the carry flag from the srawi
     //        we should really be making notes about that for the scheduler.