BlockHasNoFallThrough() now returns true if block ends with a return instruction.
authorEvan Cheng <evan.cheng@apple.com>
Mon, 21 May 2007 18:44:17 +0000 (18:44 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 21 May 2007 18:44:17 +0000 (18:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37266 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaInstrInfo.cpp
lib/Target/PowerPC/PPCInstrInfo.cpp
lib/Target/X86/X86InstrInfo.cpp

index 2a72d180193f870b0dff3017a25316c9a06982bf..299a6071488ec3c148c137ca08f24ec70b519587 100644 (file)
@@ -239,6 +239,8 @@ bool AlphaInstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {
   if (MBB.empty()) return false;
   
   switch (MBB.back().getOpcode()) {
+  case Alpha::RETDAG: // Return.
+  case Alpha::RETDAGp:
   case Alpha::BR:     // Uncond branch.
   case Alpha::JMP:  // Indirect branch.
     return true;
index e861b2e9ab948445341e66a9cd2bd198deb9e96c..7659a570800320de30369271a35cbc2eae5e0f44 100644 (file)
@@ -276,6 +276,7 @@ bool PPCInstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {
   if (MBB.empty()) return false;
   
   switch (MBB.back().getOpcode()) {
+  case PPC::BLR:   // Return.
   case PPC::B:     // Uncond branch.
   case PPC::BCTR:  // Indirect branch.
     return true;
index 6018337b9d9f22681219f48b371f3eb7bf914d44..291c3dce08520cc7c510d7076f5fc80140bc180e 100644 (file)
@@ -486,6 +486,11 @@ bool X86InstrInfo::BlockHasNoFallThrough(MachineBasicBlock &MBB) const {
   if (MBB.empty()) return false;
   
   switch (MBB.back().getOpcode()) {
+  case X86::RET:     // Return.
+  case X86::RETI:
+  case X86::TAILJMPd:
+  case X86::TAILJMPr:
+  case X86::TAILJMPm:
   case X86::JMP:     // Uncond branch.
   case X86::JMP32r:  // Indirect branch.
   case X86::JMP32m:  // Indirect branch through mem.