From a45c20b0492633fa346720c15a0b62ea166fd84d Mon Sep 17 00:00:00 2001
From: Rafael Espindola
Date: Tue, 30 Aug 2011 23:03:45 +0000
Subject: [PATCH] Remove the old tail duplication pass. It is not used and is
unable to update ssa, so it has to be run really early in the pipeline. Any
replacement should probably use the SSAUpdater.
llvm-svn: 138841
---
llvm/docs/ReleaseNotes.html | 2 +
llvm/include/llvm/InitializePasses.h | 1 -
llvm/include/llvm/LinkAllPasses.h | 1 -
llvm/include/llvm/Transforms/Scalar.h | 7 -
llvm/lib/Transforms/Scalar/CMakeLists.txt | 1 -
llvm/lib/Transforms/Scalar/Scalar.cpp | 1 -
.../lib/Transforms/Scalar/TailDuplication.cpp | 373 ------------------
.../Transforms/LoopDeletion/2008-05-06-Phi.ll | 2 +-
.../LoopSimplify/2003-08-15-PreheadersFail.ll | 2 +-
.../TailDup/2003-06-24-Simpleloop.ll | 15 -
.../TailDup/2003-07-22-InfiniteLoop.ll | 11 -
.../TailDup/2003-08-23-InvalidatedPointers.ll | 29 --
.../TailDup/2003-08-31-UnreachableBlocks.ll | 17 -
.../TailDup/2004-04-01-DemoteRegToStack.ll | 20 -
.../TailDup/2008-05-13-InfiniteLoop.ll | 26 --
.../Transforms/TailDup/2009-07-31-phicrash.ll | 14 -
llvm/test/Transforms/TailDup/MergeTest.ll | 27 --
llvm/test/Transforms/TailDup/PHIUpdateTest.ll | 16 -
.../Transforms/TailDup/X86/if-tail-dup.ll | 49 ---
llvm/test/Transforms/TailDup/basictest.ll | 20 -
llvm/test/Transforms/TailDup/basictest2.ll | 15 -
21 files changed, 4 insertions(+), 645 deletions(-)
delete mode 100644 llvm/lib/Transforms/Scalar/TailDuplication.cpp
delete mode 100644 llvm/test/Transforms/TailDup/2003-06-24-Simpleloop.ll
delete mode 100644 llvm/test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll
delete mode 100644 llvm/test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll
delete mode 100644 llvm/test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll
delete mode 100644 llvm/test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll
delete mode 100644 llvm/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll
delete mode 100644 llvm/test/Transforms/TailDup/2009-07-31-phicrash.ll
delete mode 100644 llvm/test/Transforms/TailDup/MergeTest.ll
delete mode 100644 llvm/test/Transforms/TailDup/PHIUpdateTest.ll
delete mode 100644 llvm/test/Transforms/TailDup/X86/if-tail-dup.ll
delete mode 100644 llvm/test/Transforms/TailDup/basictest.ll
delete mode 100644 llvm/test/Transforms/TailDup/basictest2.ll
diff --git a/llvm/docs/ReleaseNotes.html b/llvm/docs/ReleaseNotes.html
index 6188ffd4c88f..4feb907d367f 100644
--- a/llvm/docs/ReleaseNotes.html
+++ b/llvm/docs/ReleaseNotes.html
@@ -583,6 +583,8 @@ it run faster:
- The
LowerSetJmp
pass wasn't used effectively by any
target and has been removed.
+ - The old
TailDup
pass was not used in the standard pipeline
+ and was unable to update ssa form, so it has been removed.
- The syntax of volatile loads and stores in IR has been changed to
"
load volatile
"/"store volatile
". The old
syntax ("volatile load
"/"volatile store
")
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index 780ab8e00839..c91fbf8de812 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -219,7 +219,6 @@ void initializeStripNonDebugSymbolsPass(PassRegistry&);
void initializeStripSymbolsPass(PassRegistry&);
void initializeStrongPHIEliminationPass(PassRegistry&);
void initializeTailCallElimPass(PassRegistry&);
-void initializeTailDupPass(PassRegistry&);
void initializeTargetDataPass(PassRegistry&);
void initializeTargetLibraryInfoPass(PassRegistry&);
void initializeTwoAddressInstructionPassPass(PassRegistry&);
diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
index e427f40aae2e..f690d045d172 100644
--- a/llvm/include/llvm/LinkAllPasses.h
+++ b/llvm/include/llvm/LinkAllPasses.h
@@ -127,7 +127,6 @@ namespace {
(void) llvm::createStripDeadDebugInfoPass();
(void) llvm::createStripDeadPrototypesPass();
(void) llvm::createTailCallEliminationPass();
- (void) llvm::createTailDuplicationPass();
(void) llvm::createJumpThreadingPass();
(void) llvm::createUnifyFunctionExitNodesPass();
(void) llvm::createInstCountPass();
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index 2187d4eb7651..b1536f906d8c 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -174,13 +174,6 @@ extern char &DemoteRegisterToMemoryID;
//
FunctionPass *createReassociatePass();
-//===----------------------------------------------------------------------===//
-//
-// TailDuplication - Eliminate unconditional branches through controlled code
-// duplication, creating simpler CFG structures.
-//
-FunctionPass *createTailDuplicationPass();
-
//===----------------------------------------------------------------------===//
//
// JumpThreading - Thread control through mult-pred/multi-succ blocks where some
diff --git a/llvm/lib/Transforms/Scalar/CMakeLists.txt b/llvm/lib/Transforms/Scalar/CMakeLists.txt
index 728f9fb2d2c3..79bcae58250f 100644
--- a/llvm/lib/Transforms/Scalar/CMakeLists.txt
+++ b/llvm/lib/Transforms/Scalar/CMakeLists.txt
@@ -29,7 +29,6 @@ add_llvm_library(LLVMScalarOpts
SimplifyCFGPass.cpp
SimplifyLibCalls.cpp
Sink.cpp
- TailDuplication.cpp
TailRecursionElimination.cpp
)
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index c4ee3f6e50ea..f6918deafebd 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -63,7 +63,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializeCFGSimplifyPassPass(Registry);
initializeSimplifyLibCallsPass(Registry);
initializeSinkingPass(Registry);
- initializeTailDupPass(Registry);
initializeTailCallElimPass(Registry);
}
diff --git a/llvm/lib/Transforms/Scalar/TailDuplication.cpp b/llvm/lib/Transforms/Scalar/TailDuplication.cpp
deleted file mode 100644
index 9dd83c04fa61..000000000000
--- a/llvm/lib/Transforms/Scalar/TailDuplication.cpp
+++ /dev/null
@@ -1,373 +0,0 @@
-//===- TailDuplication.cpp - Simplify CFG through tail duplication --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This pass performs a limited form of tail duplication, intended to simplify
-// CFGs by removing some unconditional branches. This pass is necessary to
-// straighten out loops created by the C front-end, but also is capable of
-// making other code nicer. After this pass is run, the CFG simplify pass
-// should be run to clean up the mess.
-//
-// This pass could be enhanced in the future to use profile information to be
-// more aggressive.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "tailduplicate"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constant.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Pass.h"
-#include "llvm/Type.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Analysis/InstructionSimplify.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Transforms/Utils/Local.h"
-#include