[llvm] r179252 - Make PPCInstrInfo::isPredicated always return false

Hal Finkel hfinkel at anl.gov
Wed Apr 10 18:23:35 PDT 2013


Author: hfinkel
Date: Wed Apr 10 20:23:34 2013
New Revision: 179252

URL: http://llvm.org/viewvc/llvm-project?rev=179252&view=rev
Log:
Make PPCInstrInfo::isPredicated always return false

Because of how predication in implemented on PPC (only for branches), I think
that this is the right thing to do.  No functionality change intended.

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp?rev=179252&r1=179251&r2=179252&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp Wed Apr 10 20:23:34 2013
@@ -900,22 +900,14 @@ bool PPCInstrInfo::isProfitableToIfCvt(M
 
 
 bool PPCInstrInfo::isPredicated(const MachineInstr *MI) const {
-  unsigned OpC = MI->getOpcode();
-  switch (OpC) {
-  default:
-    return false;
-  case PPC::BCC:
-  case PPC::BCCTR:
-  case PPC::BCCTR8:
-  case PPC::BCCTRL:
-  case PPC::BCCTRL8:
-  case PPC::BCLR:
-  case PPC::BDZLR:
-  case PPC::BDZLR8:
-  case PPC::BDNZLR:
-  case PPC::BDNZLR8:
-    return true;
-  }
+  // The predicated branches are identified by their type, not really by the
+  // explicit presence of a predicate. Furthermore, some of them can be
+  // predicated more than once. Because if conversion won't try to predicate
+  // any instruction which already claims to be predicated (by returning true
+  // here), always return false. In doing so, we let isPredicable() be the
+  // final word on whether not the instruction can be (further) predicated.
+
+  return false;
 }
 
 bool PPCInstrInfo::isUnpredicatedTerminator(const MachineInstr *MI) const {





More information about the llvm-commits mailing list