llvm-6502/test
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
..
Analysis Add an Intraprocedural form of BasicAliasAnalysis, which aims to 2010-06-29 00:50:39 +00:00
Archive
Assembler
Bindings/Ocaml
Bitcode
BugPoint Fix this test to work under lit. 2010-06-07 20:58:11 +00:00
CodeGen Reapply my if-conversion cleanup from svn r106939 with fixes. 2010-06-29 00:55:23 +00:00
DebugInfo Fix some tests that didn't test anything. 2010-06-26 20:05:06 +00:00
ExecutionEngine
Feature
FrontendAda
FrontendC The comment string does not match for all targets. PowerPC uses ;. 2010-06-29 00:04:40 +00:00
FrontendC++ Less incorrect handling of zero-length bitfields. Radars 7992077 and 8093043. 2010-06-23 00:31:14 +00:00
FrontendFortran
FrontendObjC test case for r105504. 2010-06-04 23:47:41 +00:00
FrontendObjC++
Integer Delete useless trailing semicolons. 2010-01-05 17:55:26 +00:00
lib
Linker
LLVMC XFAIL tests from LLVMC on valgrind or valgrind+leak-checking. We 2010-03-21 08:12:46 +00:00
MC Described the missing AVX forms of SSE2 convert instructions 2010-06-29 00:36:02 +00:00
Other Don't write a file named "&1". 2010-06-18 01:49:17 +00:00
Scripts tests: Run macho-dump with binary unbuffered streams on Windows, I can't find a Python 2.6 way to change stdin to binary. 2010-06-12 17:05:28 +00:00
TableGen Fix a tblgen bug. 2010-06-23 19:50:39 +00:00
Transforms Constant fold x == undef to undef. 2010-06-28 21:30:07 +00:00
Unit
Verifier
CMakeLists.txt tests: Propogate LLVM_SRC_ROOT and PYTHON_EXECUTABLE environment variables to tests. 2010-06-12 16:21:19 +00:00
lit.cfg tests: Tweak lit.cfg to fix breakage with out-of-dir lookup. 2010-06-23 18:06:16 +00:00
lit.site.cfg.in tests: Propogate LLVM_SRC_ROOT and PYTHON_EXECUTABLE environment variables to tests. 2010-06-12 16:21:19 +00:00
Makefile Add more virtual memory to lit. The python in x86-64 fedora 13 needs it to run 2010-06-08 16:17:58 +00:00
Makefile.tests
site.exp.in
TestRunner.sh