[llvm] r179807 - Disable PPC comparison optimization by default

Hal Finkel hfinkel at anl.gov
Thu Apr 18 15:54:26 PDT 2013


Author: hfinkel
Date: Thu Apr 18 17:54:25 2013
New Revision: 179807

URL: http://llvm.org/viewvc/llvm-project?rev=179807&view=rev
Log:
Disable PPC comparison optimization by default

This seems to cause a stage-2 LLVM compile failure (by crashing TableGen); do
I'm disabling this for now.

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
    llvm/trunk/test/CodeGen/PowerPC/optcmp.ll

Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp?rev=179807&r1=179806&r2=179807&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp Thu Apr 18 17:54:25 2013
@@ -42,6 +42,9 @@ static cl::
 opt<bool> DisableCTRLoopAnal("disable-ppc-ctrloop-analysis", cl::Hidden,
             cl::desc("Disable analysis for CTR loops"));
 
+static cl::opt<bool> DisableCmpOpt("disable-ppc-cmp-opt", cl::init(true),
+cl::desc("Disable compare instruction optimization"), cl::Hidden);
+
 PPCInstrInfo::PPCInstrInfo(PPCTargetMachine &tm)
   : PPCGenInstrInfo(PPC::ADJCALLSTACKDOWN, PPC::ADJCALLSTACKUP),
     TM(tm), RI(*TM.getSubtargetImpl(), *this) {}
@@ -1088,6 +1091,9 @@ bool PPCInstrInfo::optimizeCompareInstr(
                                         unsigned SrcReg, unsigned SrcReg2,
                                         int Mask, int Value,
                                         const MachineRegisterInfo *MRI) const {
+  if (DisableCmpOpt)
+    return false;
+
   int OpC = CmpInstr->getOpcode();
   unsigned CRReg = CmpInstr->getOperand(0).getReg();
   bool isFP = OpC == PPC::FCMPUS || OpC == PPC::FCMPUD;

Modified: llvm/trunk/test/CodeGen/PowerPC/optcmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/optcmp.ll?rev=179807&r1=179806&r2=179807&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/optcmp.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/optcmp.ll Thu Apr 18 17:54:25 2013
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2 | FileCheck %s
+; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2 -disable-ppc-cmp-opt=0 | FileCheck %s
 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
 target triple = "powerpc64-unknown-linux-gnu"
 





More information about the llvm-commits mailing list