[PowerPC] Fix readcyclecounter to be custom expanded for all 32-bit targets
[oota-llvm.git] / lib / Target / PowerPC / PPCISelLowering.cpp
index 3668a87b0ec001a071c64c6ccdfd277bf271d84c..d913f3bbf7cb5514b4ad71d54f728f47e56bee52 100644 (file)
@@ -599,12 +599,10 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM)
     }
   }
 
-  if (Subtarget.has64BitSupport()) {
+  if (Subtarget.has64BitSupport())
     setOperationAction(ISD::PREFETCH, MVT::Other, Legal);
-    setOperationAction(ISD::READCYCLECOUNTER, MVT::i64, Legal);
-  } else {
-    setOperationAction(ISD::READCYCLECOUNTER, MVT::i64, Custom);
-  }
+
+  setOperationAction(ISD::READCYCLECOUNTER, MVT::i64, isPPC64 ? Legal : Custom);
 
   if (!isPPC64) {
     setOperationAction(ISD::ATOMIC_LOAD,  MVT::i64, Expand);