[SystemZ] Immediate compare-and-branch support
[oota-llvm.git] / lib / Target / SystemZ / SystemZLongBranch.cpp
index 2fc85f50f0ffc8c0c28e661520c1bd1c18e62b68..24afb072ae80865952db6047efc2932c2097495e 100644 (file)
@@ -229,6 +229,11 @@ TerminatorInfo SystemZLongBranch::describeTerminator(MachineInstr *MI) {
       // Relaxes to a CGR/BRCL sequence, which is 4 bytes longer.
       Terminator.ExtraRelaxSize = 4;
       break;
+    case SystemZ::CIJ:
+    case SystemZ::CGIJ:
+      // Relaxes to a C(G)HI/BRCL sequence, which is 4 bytes longer.
+      Terminator.ExtraRelaxSize = 4;
+      break;
     default:
       llvm_unreachable("Unrecognized branch instruction");
     }
@@ -361,6 +366,12 @@ void SystemZLongBranch::relaxBranch(TerminatorInfo &Terminator) {
   case SystemZ::CGRJ:
     splitCompareBranch(Branch, SystemZ::CGR);
     break;
+  case SystemZ::CIJ:
+    splitCompareBranch(Branch, SystemZ::CHI);
+    break;
+  case SystemZ::CGIJ:
+    splitCompareBranch(Branch, SystemZ::CGHI);
+    break;
   default:
     llvm_unreachable("Unrecognized branch");
   }