[llvm-commits] CVS: llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Sat Dec 11 22:22:46 PST 2004



Changes in directory llvm/lib/Target/SparcV8:

SparcV8ISelSimple.cpp updated: 1.83 -> 1.84
---
Log message:

Add (currently disabled) code for canFoldSetCC


---
Diffs of the changes:  (+10 -0)

Index: llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp
diff -u llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.83 llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.84
--- llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.83	Sun Dec 12 00:01:26 2004
+++ llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp	Sun Dec 12 00:22:30 2004
@@ -1016,6 +1016,16 @@
 ///
 static SetCondInst *canFoldSetCCIntoBranch(Value *V) {
   return 0; // disable.
+  if (SetCondInst *SCI = dyn_cast<SetCondInst>(V))
+    if (SCI->hasOneUse()) {
+      BranchInst *User = dyn_cast<BranchInst>(SCI->use_back());
+      if (User
+          && (SCI->getNext() == User)
+          && (getClassB(SCI->getOperand(0)->getType()) != cLong)
+          && User->isConditional() && (User->getCondition() == V))
+        return SCI;
+    }
+  return 0;
 }
 
 /// visitBranchInst - Handles conditional and unconditional branches.






More information about the llvm-commits mailing list