From 7eb589d3f9294dbfe4d5205045bd8119a9666532 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Thu, 30 Sep 2010 20:51:52 +0000 Subject: [PATCH] Try again to disable critical edge splitting in CodeGenPrepare. The bug that broke i386 linux has been fixed in r115191. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115204 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/CodeGenPrepare.cpp | 6 +++++- test/CodeGen/ARM/lsr-on-unrolled-loops.ll | 4 ++-- test/CodeGen/Thumb/2010-07-15-debugOrdering.ll | 2 +- test/CodeGen/X86/2008-02-18-TailMergingBug.ll | 2 +- test/CodeGen/X86/lsr-reuse.ll | 5 ++--- test/CodeGen/X86/phi-immediate-factoring.ll | 2 +- test/CodeGen/X86/phys_subreg_coalesce-2.ll | 2 +- test/CodeGen/X86/postra-licm.ll | 2 +- test/CodeGen/X86/pr2659.ll | 7 ++++--- test/CodeGen/X86/tail-opts.ll | 15 ++++++--------- 10 files changed, 24 insertions(+), 23 deletions(-) diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 3221e143476..880a4e5eb89 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -31,6 +31,7 @@ #include "llvm/Transforms/Utils/BuildLibCalls.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/Statistic.h" #include "llvm/Assembly/Writer.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CommandLine.h" @@ -42,10 +43,12 @@ using namespace llvm; using namespace llvm::PatternMatch; +STATISTIC(NumElim, "Number of blocks eliminated"); + static cl::opt CriticalEdgeSplit("cgp-critical-edge-splitting", cl::desc("Split critical edges during codegen prepare"), - cl::init(true), cl::Hidden); + cl::init(false), cl::Hidden); namespace { class CodeGenPrepare : public FunctionPass { @@ -302,6 +305,7 @@ void CodeGenPrepare::EliminateMostlyEmptyBlock(BasicBlock *BB) { PFI->removeEdge(ProfileInfo::getEdge(BB, DestBB)); } BB->eraseFromParent(); + ++NumElim; DEBUG(dbgs() << "AFTER:\n" << *DestBB << "\n\n\n"); } diff --git a/test/CodeGen/ARM/lsr-on-unrolled-loops.ll b/test/CodeGen/ARM/lsr-on-unrolled-loops.ll index d7f3a0e5bbe..3bc8fee6d33 100644 --- a/test/CodeGen/ARM/lsr-on-unrolled-loops.ll +++ b/test/CodeGen/ARM/lsr-on-unrolled-loops.ll @@ -624,11 +624,11 @@ bb23: ; preds = %bb22, %bb20, %bb9, bb24: ; preds = %bb23 ; LSR should use count-down iteration to avoid requiring the trip count -; in a register, and it shouldn't require any reloads here. +; in a register. ; CHECK: @ %bb24 ; CHECK: subs{{.*}} [[REGISTER:(r[0-9]+)|(lr)]], #1 -; CHECK-NEXT: bne.w +; CHECK: bne.w %92 = icmp eq i32 %tmp81, %indvar78 ; [#uses=1] %indvar.next79 = add i32 %indvar78, 1 ; [#uses=1] diff --git a/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll b/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll index 9a6321bb43c..06c0dfec5ba 100644 --- a/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll +++ b/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll @@ -10,7 +10,7 @@ define void @_Z19getClosestDiagonal3ii(%0* noalias sret, i32, i32) nounwind { ; CHECK: blx ___muldf3 ; CHECK: blx ___muldf3 -; CHECK: beq LBB0_8 +; CHECK: beq LBB0_7 ; CHECK: blx ___muldf3 ;