From f940a1a869b4fe6f857e7fd8aeb97e7b7e9b390e 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138841 91177308-0d34-0410-b5e6-96231b3b80d8
---
docs/ReleaseNotes.html | 2 +
include/llvm/InitializePasses.h | 1 -
include/llvm/LinkAllPasses.h | 1 -
include/llvm/Transforms/Scalar.h | 7 -
lib/Transforms/Scalar/CMakeLists.txt | 1 -
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 -
test/Transforms/TailDup/MergeTest.ll | 27 --
test/Transforms/TailDup/PHIUpdateTest.ll | 16 -
test/Transforms/TailDup/X86/if-tail-dup.ll | 49 ---
test/Transforms/TailDup/basictest.ll | 20 -
test/Transforms/TailDup/basictest2.ll | 15 -
21 files changed, 4 insertions(+), 645 deletions(-)
delete mode 100644 lib/Transforms/Scalar/TailDuplication.cpp
delete mode 100644 test/Transforms/TailDup/2003-06-24-Simpleloop.ll
delete mode 100644 test/Transforms/TailDup/2003-07-22-InfiniteLoop.ll
delete mode 100644 test/Transforms/TailDup/2003-08-23-InvalidatedPointers.ll
delete mode 100644 test/Transforms/TailDup/2003-08-31-UnreachableBlocks.ll
delete mode 100644 test/Transforms/TailDup/2004-04-01-DemoteRegToStack.ll
delete mode 100644 test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll
delete mode 100644 test/Transforms/TailDup/2009-07-31-phicrash.ll
delete mode 100644 test/Transforms/TailDup/MergeTest.ll
delete mode 100644 test/Transforms/TailDup/PHIUpdateTest.ll
delete mode 100644 test/Transforms/TailDup/X86/if-tail-dup.ll
delete mode 100644 test/Transforms/TailDup/basictest.ll
delete mode 100644 test/Transforms/TailDup/basictest2.ll
diff --git a/docs/ReleaseNotes.html b/docs/ReleaseNotes.html
index 6188ffd4c88..4feb907d367 100644
--- a/docs/ReleaseNotes.html
+++ b/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/include/llvm/InitializePasses.h b/include/llvm/InitializePasses.h
index 780ab8e0083..c91fbf8de81 100644
--- a/include/llvm/InitializePasses.h
+++ b/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/include/llvm/LinkAllPasses.h b/include/llvm/LinkAllPasses.h
index e427f40aae2..f690d045d17 100644
--- a/include/llvm/LinkAllPasses.h
+++ b/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/include/llvm/Transforms/Scalar.h b/include/llvm/Transforms/Scalar.h
index 2187d4eb765..b1536f906d8 100644
--- a/include/llvm/Transforms/Scalar.h
+++ b/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/lib/Transforms/Scalar/CMakeLists.txt b/lib/Transforms/Scalar/CMakeLists.txt
index 728f9fb2d2c..79bcae58250 100644
--- a/lib/Transforms/Scalar/CMakeLists.txt
+++ b/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/lib/Transforms/Scalar/Scalar.cpp b/lib/Transforms/Scalar/Scalar.cpp
index c4ee3f6e50e..f6918deafeb 100644
--- a/lib/Transforms/Scalar/Scalar.cpp
+++ b/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/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp
deleted file mode 100644
index 9dd83c04fa6..00000000000
--- a/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