[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp

Nate Begeman natebegeman at mac.com
Mon Apr 4 21:32:27 PDT 2005



Changes in directory llvm/lib/Target/PowerPC:

PPC32ISelPattern.cpp updated: 1.45 -> 1.46
---
Log message:

Back out the previous change to SelectBranchCC, since there are cases it
could miscompile.  A correct solution will be found in the near future.


---
Diffs of the changes:  (+11 -4)

 PPC32ISelPattern.cpp |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.45 llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.46
--- llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.45	Mon Apr  4 23:22:58 2005
+++ llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp	Mon Apr  4 23:32:16 2005
@@ -667,13 +667,20 @@
 
   // Get the MBB we will fall through to so that we can hand it off to the
   // branch selection pass as an argument to the PPC::COND_BRANCH pseudo op.
-  ilist<MachineBasicBlock>::iterator It = BB;
-  MachineBasicBlock *Fallthrough = ++It;
+  //ilist<MachineBasicBlock>::iterator It = BB;
+  //MachineBasicBlock *Fallthrough = ++It;
   
   Select(N.getOperand(0));  //chain
   unsigned Opc = SelectSetCR0(N.getOperand(1));
-  BuildMI(BB, PPC::COND_BRANCH, 4).addReg(PPC::CR0).addImm(Opc)
-    .addMBB(Dest).addMBB(Fallthrough);
+  // FIXME: Use this once we have something approximating two-way branches
+  // We cannot currently use this in case the ISel hands us something like
+  // BRcc MBBx
+  // BR MBBy
+  // since the fallthrough basic block for the conditional branch does not start
+  // with the unconditional branch (it is skipped over).
+  //BuildMI(BB, PPC::COND_BRANCH, 4).addReg(PPC::CR0).addImm(Opc)
+  //  .addMBB(Dest).addMBB(Fallthrough);
+  BuildMI(BB, Opc, 2).addReg(PPC::CR0).addMBB(Dest);
   return;
 }
 






More information about the llvm-commits mailing list