llvm-6502/test/CodeGen/Thumb2
Bob Wilson 8eab75f390 Reapply my if-conversion cleanup from svn r106939 with fixes.
There are 2 changes relative to the previous version of the patch:

1) For the "simple" if-conversion case, there's no need to worry about
RemoveExtraEdges not handling an unanalyzable branch.  Predicated terminators
are ignored in this context, so RemoveExtraEdges does the right thing.
This might break someday if we ever treat indirect branches (BRIND) as
predicable, but for now, I just removed this part of the patch, because
in the case where we do not add an unconditional branch, we rely on keeping
the fall-through edge to CvtBBI (which is empty after this transformation).

The change relative to the previous patch is:

@@ -1036,10 +1036,6 @@
     IterIfcvt = false;
   }
 
-  // RemoveExtraEdges won't work if the block has an unanalyzable branch,
-  // which is typically the case for IfConvertSimple, so explicitly remove
-  // CvtBBI as a successor.
-  BBI.BB->removeSuccessor(CvtBBI->BB);
   RemoveExtraEdges(BBI);
 
   // Update block info. BB can be iteratively if-converted.


2) My patch exposed a bug in the code for merging the tail of a "diamond",
which had previously never been exercised.  The code was simply checking that
the tail had a single predecessor, but there was a case in
MultiSource/Benchmarks/VersaBench/dbms where that single predecessor was
neither edge of the diamond.  I added the following change to check for
that:

@@ -1276,7 +1276,18 @@
   // tail, add a unconditional branch to it.
   if (TailBB) {
     BBInfo TailBBI = BBAnalysis[TailBB->getNumber()];
-    if (TailBB->pred_size() == 1 && !TailBBI.HasFallThrough) {
+    bool CanMergeTail = !TailBBI.HasFallThrough;
+    // There may still be a fall-through edge from BBI1 or BBI2 to TailBB;
+    // check if there are any other predecessors besides those.
+    unsigned NumPreds = TailBB->pred_size();
+    if (NumPreds > 1)
+      CanMergeTail = false;
+    else if (NumPreds == 1 && CanMergeTail) {
+      MachineBasicBlock::pred_iterator PI = TailBB->pred_begin();
+      if (*PI != BBI1->BB && *PI != BBI2->BB)
+        CanMergeTail = false;
+    }
+    if (CanMergeTail) {
       MergeBlocks(BBI, TailBBI);
       TailBBI.IsDone = true;
     } else {

With these fixes, I was able to run all the SingleSource and MultiSource
tests successfully.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 00:55:23 +00:00
..
2009-07-17-CrossRegClassCopy.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-07-21-ISelBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-07-23-CPIslandBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-07-30-PEICrash.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-08-01-WrongLDRBOpc.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-08-02-CoalescerBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-08-04-CoalescerAssert.ll Remove the arm_aapcscc marker from the tests. It is the default 2010-06-15 19:04:29 +00:00
2009-08-04-CoalescerBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-08-04-ScavengerAssert.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-08-04-SubregLoweringBug2.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-08-04-SubregLoweringBug3.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-08-04-SubregLoweringBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-08-06-SpDecBug.ll Remove the arm_aapcscc marker from the tests. It is the default 2010-06-15 19:04:29 +00:00
2009-08-07-CoalescerBug.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
2009-08-07-NeonFPBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-08-08-ScavengerAssert.ll Remove the arm_aapcscc marker from the tests. It is the default 2010-06-15 19:04:29 +00:00
2009-08-10-ISelBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-09-28-ITBlockBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-10-15-ITBlockBranch.ll Fix an inverted condition. 2010-06-18 22:17:13 +00:00
2009-11-01-CopyReg2RegBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-11-11-ScavengerAssert.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-11-13-STRDBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2009-12-01-LoopIVUsers.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-01-06-TailDuplicateLabels.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-01-19-RemovePredicates.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-02-11-phi-cycle.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-02-24-BigStack.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-03-08-addi12-ccout.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-03-15-AsmCCClobber.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-04-15-DynAllocBug.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-04-26-CopyRegCrash.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-05-24-rsbs.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-06-14-NEONCoalescer.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
2010-06-19-ITBlockCrash.ll Fix a crash caused by dereference of MBB.end(). rdar://8110842 2010-06-20 00:54:38 +00:00
2010-06-21-TailMergeBug.ll Tail merging pass shall not break up IT blocks. rdar://8115404 2010-06-22 01:18:16 +00:00
bfx.ll Update ARM DAGtoDAG for matching UBFX instruction for unsigned bitfield 2010-04-22 23:24:18 +00:00
carry.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
crash.ll TwoAddressInstructionPass::CoalesceExtSubRegs can insert INSERT_SUBREG 2010-06-18 22:29:44 +00:00
cross-rc-coalescing-1.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
cross-rc-coalescing-2.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
dg.exp
div.ll fix copy/paste oops. 2010-05-05 21:07:46 +00:00
frameless2.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
frameless.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
ifcvt-neon.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
large-stack.ll Stop using the old pre-UAL syntax for LDM/STM instruction suffixes. 2010-03-16 16:19:07 +00:00
ldr-str-imm12.ll Eliminate the first have of the optimization which eliminates BRCOND 2010-06-24 15:04:11 +00:00
load-global.ll Start function numbering at 0. 2010-04-17 16:29:15 +00:00
lsr-deficiency.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
machine-licm.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
mul_const.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
pic-load.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
thumb2-adc.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-add2.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-add3.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-add4.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-add5.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-add6.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-add.ll Delete useless trailing semicolons. 2010-01-05 17:55:26 +00:00
thumb2-and2.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-and.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-asr2.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-asr.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-bcc.ll Fix tests. 2009-11-01 18:13:29 +00:00
thumb2-bfc.ll Fix Thumb2 failures by converting them to FileCheck. 2009-10-27 06:31:02 +00:00
thumb2-bic.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-branch.ll Fix a bug which prevented tail merging of return instructions in 2010-05-03 14:35:47 +00:00
thumb2-call-tc.ll Disable sibcall optimization for Thumb1 for now since Thumb1RegisterInfo::emitEpilogue is not expecting them. 2010-06-19 01:01:32 +00:00
thumb2-call.ll Remove tail call to preserve this test. A tail 2010-06-03 21:57:48 +00:00
thumb2-cbnz.ll Allow ARM if-converter to be run after post allocation scheduling. 2010-06-18 23:09:54 +00:00
thumb2-clz.ll Fix Thumb2 failures by converting them to FileCheck. 2009-10-27 06:31:02 +00:00
thumb2-cmn2.ll Fix Thumb2 failures by converting them to FileCheck. 2009-10-27 06:31:02 +00:00
thumb2-cmn.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-cmp2.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-cmp.ll Cast MO.getImm() to unsigned before comparing with an unsigned limit. 2009-09-09 06:05:16 +00:00
thumb2-eor2.ll Fix Thumb2 failures by converting them to FileCheck. 2009-10-27 06:31:02 +00:00
thumb2-eor.ll PR7458: Try commuting Thumb2 instruction operands to put them into 2-address 2010-06-24 16:50:20 +00:00
thumb2-ifcvt1-tc.ll Enable tail calls on ARM by default, with some 2010-06-18 19:00:18 +00:00
thumb2-ifcvt1.ll Remove tail call. A tail call version will follow. 2010-06-04 00:03:37 +00:00
thumb2-ifcvt2.ll Allow ARM if-converter to be run after post allocation scheduling. 2010-06-18 23:09:54 +00:00
thumb2-ifcvt3.ll Reapply my if-conversion cleanup from svn r106939 with fixes. 2010-06-29 00:55:23 +00:00
thumb2-jtb.ll Enable arm jumpt table adjustment. 2009-11-17 21:24:11 +00:00
thumb2-ldm.ll Make this test not use tail calls. A tail call 2010-06-03 21:53:01 +00:00
thumb2-ldr_ext.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-ldr_post.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-ldr_pre.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-ldr.ll Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm 2010-03-17 17:52:21 +00:00
thumb2-ldrb.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-ldrd.ll Enable pre-regalloc load / store multiple pass for Thumb2. 2009-09-27 09:46:04 +00:00
thumb2-ldrh.ll Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm 2010-03-17 17:52:21 +00:00
thumb2-lsl2.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-lsl.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-lsr2.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-lsr3.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-lsr.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-mla.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-mls.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-mov.ll Consolidate test files 2009-10-31 22:20:56 +00:00
thumb2-mul.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-mulhi.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-mvn2.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-mvn.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-neg.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-orn2.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-orn.ll Miss two, PR5307. 2009-11-22 15:35:28 +00:00
thumb2-orr2.ll Miss two, PR5307. 2009-11-22 15:35:28 +00:00
thumb2-orr.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-pack.ll Cleanup of ARMv7M support. Move hardware divide and Thumb2 extract/pack 2010-05-05 23:44:43 +00:00
thumb2-rev16.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-rev.ll Cleanup of ARMv7M support. Move hardware divide and Thumb2 extract/pack 2010-05-05 23:44:43 +00:00
thumb2-ror2.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-ror.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-rsb2.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-rsb.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-sbc.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-select_xform.ll Move ARM if-conversion before post-ra scheduling. 2010-06-18 23:32:07 +00:00
thumb2-select.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-shifter.ll Cleanup of ARMv7M support. Move hardware divide and Thumb2 extract/pack 2010-05-05 23:44:43 +00:00
thumb2-smla.ll Cleanup of ARMv7M support. Move hardware divide and Thumb2 extract/pack 2010-05-05 23:44:43 +00:00
thumb2-smul.ll Cleanup of ARMv7M support. Move hardware divide and Thumb2 extract/pack 2010-05-05 23:44:43 +00:00
thumb2-spill-q.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
thumb2-str_post.ll Fix Thumb2 failures by converting them to FileCheck. 2009-10-27 06:31:02 +00:00
thumb2-str_pre.ll Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm 2010-03-17 17:52:21 +00:00
thumb2-str.ll Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm 2010-03-17 17:52:21 +00:00
thumb2-strb.ll Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm 2010-03-17 17:52:21 +00:00
thumb2-strh.ll Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm 2010-03-17 17:52:21 +00:00
thumb2-sub2.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-sub4.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-sub5.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-sub.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-sxt_rot.ll Cleanup of ARMv7M support. Move hardware divide and Thumb2 extract/pack 2010-05-05 23:44:43 +00:00
thumb2-tbb.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-tbh.ll Remove arm_apcscc from the test files. It is the default and doing this 2010-06-17 15:18:27 +00:00
thumb2-teq2.ll Convert to FileCheck 2009-11-16 20:04:15 +00:00
thumb2-teq.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-tst2.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
thumb2-tst.ll Convert Thumb2 tests to FileCheck for PR5307. 2009-11-22 15:18:27 +00:00
thumb2-uxt_rot.ll Cleanup of ARMv7M support. Move hardware divide and Thumb2 extract/pack 2010-05-05 23:44:43 +00:00
thumb2-uxtb.ll PR7458: Try commuting Thumb2 instruction operands to put them into 2-address 2010-06-24 16:50:20 +00:00
tls1.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00
tls2.ll Eliminate more uses of llvm-as and llvm-dis. 2009-09-09 00:09:15 +00:00