[LLVMdev] Tail Duplication Questions

Arnold Schwaighofer arnold.schwaighofer at gmail.com
Wed Oct 31 09:11:45 PDT 2012


We used to have an LLVM-IR pass did tail duplication
(http://llvm.org/viewvc/llvm-project/llvm/tags/RELEASE_29/final/lib/Transforms/Scalar/TailDuplication.cpp)
It was not used and went away with 3.0. The documentation is out of
date.

commit f940a1a869b4fe6f857e7fd8aeb97e7b7e9b390e
Author: Rafael Espindola <rafael.espindola at gmail.com>
Date:   Tue Aug 30 23:03:45 2011 +0000

    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

diff --git a/docs/ReleaseNotes.html b/docs/ReleaseNotes.html
index 6188ffd4..4feb907 100644
--- a/docs/ReleaseNotes.html
+++ b/docs/ReleaseNotes.html
@@ -583,6 +583,8 @@ it run faster:</p>
 <ul>
   <li>The <code>LowerSetJmp</code> pass wasn't used effectively by any
       target and has been removed.</li>
+  <li>The old <code>TailDup</code> pass was not used in the standard pipeline
+      and was unable to update ssa form, so it has been removed.
   <li>The syntax of volatile loads and stores in IR has been changed to
       "<code>load volatile</code>"/"<code>store volatile</code>".  The old
       syntax ("<code>volatile load</code>"/"<code>volatile store</code>")


On Wed, Oct 31, 2012 at 10:17 AM,  <dag at cray.com> wrote:
> I'm reading up on LLVM's implementation of tail duplication and the
> description is confusing:
>
> http://llvm.org/docs/Passes.html
>
>   -tailduplicate: Tail Duplication
>
>   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.
>
> First, lib/CodeGen/TailDuplication.cpp says the pass name is
> -tailduplication, not -tailduplicate.  Am I looking at the right pass?
>
>   INITIALIZE_PASS(TailDuplicatePass, "tailduplication", "Tail Duplication",
>                   false, false)
>
> Second, SimplifyCFG is a FunctionPass, not a MachineFunctionPass.  What
> cleanup pass is this description really referring to?
>
> Thanks!
>
>                          -David
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list