[LLVMdev] Tail Duplication Questions

dag at cray.com dag at cray.com
Wed Oct 31 08:17:29 PDT 2012


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



More information about the llvm-dev mailing list