OSDN Git Service

Fix code causing fallthrough warnings in the PPC back end.
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 15 Dec 2017 11:47:48 +0000 (11:47 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 15 Dec 2017 11:47:48 +0000 (11:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320806 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCInstrInfo.cpp
lib/Target/PowerPC/PPCMIPeephole.cpp

index cf5c3e8..5e7a933 100644 (file)
@@ -2224,6 +2224,7 @@ public:
       if (CmpInGPR == ICGPR_Sext || CmpInGPR == ICGPR_SextI32 ||
           CmpInGPR == ICGPR_SextI64)
         return nullptr;
+      LLVM_FALLTHROUGH;
     case ISD::SIGN_EXTEND:
       if (CmpInGPR == ICGPR_Zext || CmpInGPR == ICGPR_ZextI32 ||
           CmpInGPR == ICGPR_ZextI64)
index 5c8ef7f..ac864ba 100644 (file)
@@ -13045,6 +13045,7 @@ PPCTargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
         return std::make_pair(0U, &PPC::QSRCRegClass);
       if (Subtarget.hasAltivec())
         return std::make_pair(0U, &PPC::VRRCRegClass);
+      break;
     case 'y':   // crrc
       return std::make_pair(0U, &PPC::CRRCRegClass);
     }
index e047179..879bb4c 100644 (file)
@@ -2415,6 +2415,7 @@ bool PPCInstrInfo::convertToImmediateForm(MachineInstr &MI,
       NewImm = Addend + SExtImm;
       break;
     }
+    return false;
   }
   case PPC::RLDICL:
   case PPC::RLDICLo:
index 45647a2..64c5e4e 100644 (file)
@@ -774,7 +774,7 @@ bool PPCMIPeephole::simplifyCode(void) {
   // Eliminate all the TOC save instructions which are redundant.
   Simplified |= eliminateRedundantTOCSaves(TOCSaves);
   // We try to eliminate redundant compare instruction.
-  //Simplified |= eliminateRedundantCompare();
+  Simplified |= eliminateRedundantCompare();
 
   return Simplified;
 }
@@ -1025,6 +1025,9 @@ bool PPCMIPeephole::eliminateRedundantTOCSaves(
 //   bge    0, .LBB0_4
 
 bool PPCMIPeephole::eliminateRedundantCompare(void) {
+  // FIXME: this transformation is causing miscompiles. Disabling it for now
+  // until we can resolve the issue.
+  return false;
   bool Simplified = false;
 
   for (MachineBasicBlock &MBB2 : *MF) {