[PowerPC] Fix readcyclecounter to be custom expanded for all 32-bit targets
authorHal Finkel <hfinkel@anl.gov>
Wed, 3 Dec 2014 00:19:17 +0000 (00:19 +0000)
committerHal Finkel <hfinkel@anl.gov>
Wed, 3 Dec 2014 00:19:17 +0000 (00:19 +0000)
We need to use the custom expansion of readcyclecounter on all 32-bit targets
(even those with 64-bit registers). This should fix the ppc64 buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223182 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCISelLowering.cpp
test/CodeGen/PowerPC/ppc32-cyclecounter.ll

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);
index 75d24c3834842376c9caf13588d422ef7c01f051..9e2cd0b12880cc01f6a74a2abf38e211c81a1b5c 100644 (file)
@@ -1,6 +1,7 @@
 target datalayout = "E-m:e-p:32:32-i64:64-n32"
 target triple = "powerpc"
-; RUN: llc < %s | FileCheck %s
+; RUN: llc -mcpu=ppc < %s | FileCheck %s
+; RUN: llc -mcpu=pwr7 < %s | FileCheck %s
 
 define i64 @test1() nounwind {
 entry: