AArch64: Assert on analyzeBranch failing
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 11 Aug 2016 17:22:59 +0000 (17:22 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 11 Aug 2016 17:22:59 +0000 (17:22 +0000)
llvm-svn: 278366

llvm/lib/Target/AArch64/AArch64BranchRelaxation.cpp

index a6d07c6..9d2577e 100644 (file)
@@ -424,9 +424,11 @@ bool AArch64BranchRelaxation::fixupConditionalBranch(MachineInstr &MI) {
 
   if (NeedSplit) {
     // Analyze the branch so we know how to update the successor lists.
-    MachineBasicBlock *TBB, *FBB;
+    MachineBasicBlock *TBB = nullptr, *FBB = nullptr;
     SmallVector<MachineOperand, 2> Cond;
-    TII->analyzeBranch(*MBB, TBB, FBB, Cond, false);
+    bool Fail = TII->analyzeBranch(*MBB, TBB, FBB, Cond, false);
+    assert(!Fail && "branches to relax should be analyzable");
+    (void)Fail;
 
     MachineBasicBlock *NewBB = splitBlockBeforeInstr(MI);
     // No need for the branch to the next block. We're adding an unconditional