Skip to content

Provide post-link-optimization in llvmc and gccld #884

@llvmbot

Description

@llvmbot
Bugzilla Link 512
Resolution FIXED
Resolved on Feb 22, 2010 12:54
Version trunk
OS All
Reporter LLVM Bugzilla Contributor

Extended Description

This enhancement requests that the llvmc and gccld tools support a
-post-link-opt= option that allows the user to specify a "pass" to be run on the
linked bytecode before code generation occurs. For example, we want to be able
to say:

llvmc x.bc y.bc -o a.out -post-link-opt=FOO

which means that the following steps would occur:

  1. x.bc and y.bc are linked together to produce llvm.bc
  2. The "FOO" program is invoked to process llvm.bc and return a new bytecode
    file. FOO is passed the full path to llvm.bc in the first argument and the
    name of a temporary file it should create as the second argument.
  3. If FOO returns a non-zero result code, processing stops.
  4. If FOO returns a zero result code, the temporary file is read in and
    validated.
  5. If the file validates correctly, it is used for code generation resulting in
    the creation of the a.out file.

The idea is to allow separate programs to post-process a linked program. For
example, the pool allocator could be just a program that gets downloaded and
used like:

llvmc x.c y.c -postlinkopt=poolalloc -o xy.out

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaenhancementImproving things as opposed to bug fixing, e.g. new or missing featurellvm-toolsAll llvm tools that do not have corresponding tag

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions