[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.td PPCRegisterInfo.cpp

Evan Cheng evan.cheng at apple.com
Fri Dec 23 14:14:45 PST 2005



Changes in directory llvm/lib/Target/PowerPC:

PPCInstrInfo.td updated: 1.164 -> 1.165
PPCRegisterInfo.cpp updated: 1.37 -> 1.38
---
Log message:

* Removed the use of FLAG. Now use hasFlagIn and hasFlagOut instead.
* Added a pseudo instruction (for each target) that represent "return void".
  This is a workaround for lack of optional flag operand (return void is not
  lowered so it does not have a flag operand.)


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

 PPCInstrInfo.td     |    9 ++++++---
 PPCRegisterInfo.cpp |    3 ++-
 2 files changed, 8 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.164 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.165
--- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.164	Tue Dec 20 14:08:53 2005
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.td	Fri Dec 23 16:14:32 2005
@@ -46,7 +46,7 @@
 def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_PPCCallSeq,[SDNPHasChain]>;
 def callseq_end   : SDNode<"ISD::CALLSEQ_END",   SDT_PPCCallSeq,[SDNPHasChain]>;
 
-def SDT_PPCRetFlag : SDTypeProfile<0, 1, [ SDTCisVT<0, FlagVT>]>;
+def SDT_PPCRetFlag : SDTypeProfile<0, 0, []>;
 def retflag       : SDNode<"PPCISD::RET_FLAG", SDT_PPCRetFlag, [SDNPHasChain]>;
 
 //===----------------------------------------------------------------------===//
@@ -223,8 +223,11 @@
 
 
 let isTerminator = 1 in {
+  // FIXME: temporary workaround for return without an incoming flag.
   let isReturn = 1 in
-    def BLR : XLForm_2_ext<19, 16, 20, 0, 0, (ops), "blr", BrB, [(ret)]>;
+    def BLRVOID : XLForm_2_ext<19, 16, 20, 0, 0, (ops), "blr", BrB, [(ret)]>;
+  let isReturn = 1, hasInFlag = 1 in
+    def BLR : XLForm_2_ext<19, 16, 20, 0, 0, (ops), "blr", BrB, []>;
   def BCTR : XLForm_2_ext<19, 528, 20, 0, 0, (ops), "bctr", BrB, []>;
 }
 
@@ -1056,7 +1059,7 @@
 def : Pat<(f64 (extload xaddr:$src, f32)),
           (FMRSD (LFSX xaddr:$src))>;
 
-def : Pat<(retflag FLAG), (BLR)>;
+def : Pat<(retflag), (BLR)>;
 
 // Same as above, but using a temporary. FIXME: implement temporaries :)
 /*


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.37 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.38
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.37	Sun Nov  6 03:00:38 2005
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp	Fri Dec 23 16:14:32 2005
@@ -373,7 +373,8 @@
   const MachineFrameInfo *MFI = MF.getFrameInfo();
   MachineBasicBlock::iterator MBBI = prior(MBB.end());
   MachineInstr *MI;
-  assert(MBBI->getOpcode() == PPC::BLR &&
+  // FIXME: BLRVOID should be removed. See PPCInstrInfo.td
+  assert((MBBI->getOpcode() == PPC::BLR || MBBI->getOpcode() == PPC::BLRVOID) &&
          "Can only insert epilog into returning blocks");
 
   // Get the number of bytes allocated from the FrameInfo...






More information about the llvm-commits mailing list