Skip to content
  1. Jan 14, 2014
    • Renato Golin's avatar
      Fix Remote MCJIT on Windows · fd99af50
      Renato Golin authored
      llvm-svn: 199268
      fd99af50
    • Renato Golin's avatar
      Sanitize MCJIT remote execution · 695895ca
      Renato Golin authored
      MCJIT remote execution (ChildTarget+RemoteTargetExternal) protocol was in
      dire need of refactoring. It was fail-prone, had no error reporting and
      implemented the same message logic on every single function.
      
      This patch rectifies it, and makes it work on ARM, where it was randomly
      failing. Other architectures shall profit from this change as well, making
      their buildbots and releases more reliable.
      
      llvm-svn: 199261
      695895ca
    • Duncan P. N. Exon Smith's avatar
      Reapply "LTO: add API to set strategy for -internalize" · 93be7c4f
      Duncan P. N. Exon Smith authored
      Reapply r199191, reverted in r199197 because it carelessly broke
      Other/link-opts.ll.  The problem was that calling
      createInternalizePass("main") would select
      createInternalizePass(bool("main")) instead of
      createInternalizePass(ArrayRef<const char *>("main")).  This commit
      fixes the bug.
      
      The original commit message follows.
      
      Add API to LTOCodeGenerator to specify a strategy for the -internalize
      pass.
      
      This is a new attempt at Bill's change in r185882, which he reverted in
      r188029 due to problems with the gold linker.  This puts the onus on the
      linker to decide whether (and what) to internalize.
      
      In particular, running internalize before outputting an object file may
      change a 'weak' symbol into an internal one, even though that symbol
      could be needed by an external object file --- e.g., with arclite.
      
      This patch enables three strategies:
      
      - LTO_INTERNALIZE_FULL: the default (and the old behaviour).
      - LTO_INTERNALIZE_NONE: skip -internalize.
      - LTO_INTERNALIZE_HIDDEN: only -internalize symbols with hidden
        visibility.
      
      LTO_INTERNALIZE_FULL should be used when linking an executable.
      
      Outputting an object file (e.g., via ld -r) is more complicated, and
      depends on whether hidden symbols should be internalized.  E.g., for
      ld -r, LTO_INTERNALIZE_NONE can be used when -keep_private_externs, and
      LTO_INTERNALIZE_HIDDEN can be used otherwise.  However,
      LTO_INTERNALIZE_FULL is inappropriate, since the output object file will
      eventually need to link with others.
      
      lto_codegen_set_internalize_strategy() sets the strategy for subsequent
      calls to lto_codegen_write_merged_modules() and lto_codegen_compile*().
      
      <rdar://problem/14334895>
      
      llvm-svn: 199244
      93be7c4f
    • Rafael Espindola's avatar
      Handle UIDs and GIDs that don't fit in 6 decimal places. · ed90030f
      Rafael Espindola authored
      Newer unix systems have 32 bit uid and gid types, but the archive format was
      not updated. Fortunately, these fields are not normally used. Just truncate
      the data to fit in 6 chars.
      
      llvm-svn: 199223
      ed90030f
    • NAKAMURA Takumi's avatar
      Revert r199191, "LTO: add API to set strategy for -internalize" · 23c0ab53
      NAKAMURA Takumi authored
      Please update also Other/link-opts.ll, in next time.
      
      llvm-svn: 199197
      23c0ab53
    • Duncan P. N. Exon Smith's avatar
      LTO: add API to set strategy for -internalize · 43ea3478
      Duncan P. N. Exon Smith authored
      Add API to LTOCodeGenerator to specify a strategy for the -internalize
      pass.
      
      This is a new attempt at Bill's change in r185882, which he reverted in
      r188029 due to problems with the gold linker.  This puts the onus on the
      linker to decide whether (and what) to internalize.
      
      In particular, running internalize before outputting an object file may
      change a 'weak' symbol into an internal one, even though that symbol
      could be needed by an external object file --- e.g., with arclite.
      
      This patch enables three strategies:
      
      - LTO_INTERNALIZE_FULL: the default (and the old behaviour).
      - LTO_INTERNALIZE_NONE: skip -internalize.
      - LTO_INTERNALIZE_HIDDEN: only -internalize symbols with hidden
        visibility.
      
      LTO_INTERNALIZE_FULL should be used when linking an executable.
      
      Outputting an object file (e.g., via ld -r) is more complicated, and
      depends on whether hidden symbols should be internalized.  E.g., for
      ld -r, LTO_INTERNALIZE_NONE can be used when -keep_private_externs, and
      LTO_INTERNALIZE_HIDDEN can be used otherwise.  However,
      LTO_INTERNALIZE_FULL is inappropriate, since the output object file will
      eventually need to link with others.
      
      lto_codegen_set_internalize_strategy() sets the strategy for subsequent
      calls to lto_codegen_write_merged_modules() and lto_codegen_compile*().
      
      <rdar://problem/14334895>
      
      llvm-svn: 199191
      43ea3478
  2. Jan 13, 2014
    • Chandler Carruth's avatar
      [PM] Split DominatorTree into a concrete analysis result object which · 73523021
      Chandler Carruth authored
      can be used by both the new pass manager and the old.
      
      This removes it from any of the virtual mess of the pass interfaces and
      lets it derive cleanly from the DominatorTreeBase<> template. In turn,
      tons of boilerplate interface can be nuked and it turns into a very
      straightforward extension of the base DominatorTree interface.
      
      The old analysis pass is now a simple wrapper. The names and style of
      this split should match the split between CallGraph and
      CallGraphWrapperPass. All of the users of DominatorTree have been
      updated to match using many of the same tricks as with CallGraph. The
      goal is that the common type remains the resulting DominatorTree rather
      than the pass. This will make subsequent work toward the new pass
      manager significantly easier.
      
      Also in numerous places things became cleaner because I switched from
      re-running the pass (!!! mid way through some other passes run!!!) to
      directly recomputing the domtree.
      
      llvm-svn: 199104
      73523021
    • Chandler Carruth's avatar
      [cleanup] Move the Dominators.h and Verifier.h headers into the IR · 5ad5f15c
      Chandler Carruth authored
      directory. These passes are already defined in the IR library, and it
      doesn't make any sense to have the headers in Analysis.
      
      Long term, I think there is going to be a much better way to divide
      these matters. The dominators code should be fully separated into the
      abstract graph algorithm and have that put in Support where it becomes
      obvious that evn Clang's CFGBlock's can use it. Then the verifier can
      manually construct dominance information from the Support-driven
      interface while the Analysis library can provide a pass which both
      caches, reconstructs, and supports a nice update API.
      
      But those are very long term, and so I don't want to leave the really
      confusing structure until that day arrives.
      
      llvm-svn: 199082
      5ad5f15c
    • Chandler Carruth's avatar
      [cleanup] Add a missing include exposed by resorting other includes. · 01e5037f
      Chandler Carruth authored
      Should fix the build.
      
      llvm-svn: 199081
      01e5037f
    • Chandler Carruth's avatar
      Re-sort #include lines again, prior to moving headers around. · 07baed53
      Chandler Carruth authored
      llvm-svn: 199080
      07baed53
    • Chandler Carruth's avatar
      [PM] Wire up support for writing bitcode with new PM. · b7bdfd65
      Chandler Carruth authored
      This moves the old pass creation functionality to its own header and
      updates the callers of that routine. Then it adds a new PM supporting
      bitcode writer to the header file, and wires that up in the opt tool.
      A test is added that round-trips code into bitcode and back out using
      the new pass manager.
      
      llvm-svn: 199078
      b7bdfd65
    • Chandler Carruth's avatar
      [PM] Wire up support for printing assembly output from the opt command. · b353c3f7
      Chandler Carruth authored
      This lets us round-trip IR in the expected manner with the opt tool.
      
      llvm-svn: 199075
      b353c3f7
    • Chandler Carruth's avatar
      [PM] Add an enum for describing the desired output strategy, and run · 949282ef
      Chandler Carruth authored
      that through the interface rather than a simple bool. This should allow
      starting to wire up real output to round-trip IR through opt with the
      new pass manager.
      
      llvm-svn: 199071
      949282ef
  3. Jan 12, 2014
  4. Jan 11, 2014
    • Chandler Carruth's avatar
      [PM] Actually nest pass managers correctly when parsing the pass · 258dbb3b
      Chandler Carruth authored
      pipeline string. Add tests that cover this now that we have execution
      dumping in the pass managers.
      
      llvm-svn: 199005
      258dbb3b
    • Chandler Carruth's avatar
      [PM] Add names to passes under the new pass manager, and a debug output · a13f27cc
      Chandler Carruth authored
      mode that can be used to debug the execution of everything.
      
      No support for analyses here, that will come later. This already helps
      show parts of the opt commandline integration that isn't working. Tests
      of that will start using it as the bugs are fixed.
      
      llvm-svn: 199004
      a13f27cc
    • Chandler Carruth's avatar
      [PM] Add (very skeletal) support to opt for running the new pass · 66445382
      Chandler Carruth authored
      manager. I cannot emphasize enough that this is a WIP. =] I expect it
      to change a great deal as things stabilize, but I think its really
      important to get *some* functionality here so that the infrastructure
      can be tested more traditionally from the commandline.
      
      The current design is looking something like this:
      
        ./bin/opt -passes='module(pass_a,pass_b,function(pass_c,pass_d))'
      
      So rather than custom-parsed flags, there is a single flag with a string
      argument that is parsed into the pass pipeline structure. This makes it
      really easy to have nice structural properties that are very explicit.
      There is one obvious and important shortcut. You can start off the
      pipeline with a pass, and the minimal context of pass managers will be
      built around the entire specified pipeline. This makes the common case
      for tests super easy:
      
        ./bin/opt -passes=instcombine,sroa,gvn
      
      But this won't introduce any of the complexity of the fully inferred old
      system -- we only ever do this for the *entire* argument, and we only
      look at the first pass. If the other passes don't fit in the pass
      manager selected it is a hard error.
      
      The other interesting aspect here is that I'm not relying on any
      registration facilities. Such facilities may be unavoidable for
      supporting plugins, but I have alternative ideas for plugins that I'd
      like to try first. My plan is essentially to build everything without
      registration until we hit an absolute requirement.
      
      Instead of registration of pass names, there will be a library dedicated
      to parsing pass names and the pass pipeline strings described above.
      Currently, this is directly embedded into opt for simplicity as it is
      very early, but I plan to eventually pull this into a library that opt,
      bugpoint, and even Clang can depend on. It should end up as a good home
      for things like the existing PassManagerBuilder as well.
      
      There are a bunch of FIXMEs in the code for the parts of this that are
      just stubbed out to make the patch more incremental. A quick list of
      what's coming up directly after this:
      - Support for function passes and building the structured nesting.
      - Support for printing the pass structure, and FileCheck tests of all of
        this code.
      - The .def-file based pass name parsing.
      - IR priting passes and the corresponding tests.
      
      Some obvious things that I'm not going to do right now, but am
      definitely planning on as the pass manager work gets a bit further:
      - Pull the parsing into library, including the builders.
      - Thread the rest of the target stuff into the new pass manager.
      - Wire support for the new pass manager up to llc.
      - Plugin support.
      
      Some things that I'd like to have, but are significantly lower on my
      priority list. I'll get to these eventually, but they may also be places
      where others want to contribute:
      - Adding nice error reporting for broken pass pipeline descriptions.
      - Typo-correction for pass names.
      
      llvm-svn: 198998
      66445382
    • Tom Roeder's avatar
      Space formatting fix for r198966. · 583a77e0
      Tom Roeder authored
      llvm-svn: 198971
      583a77e0
  5. Jan 10, 2014
  6. Jan 09, 2014
  7. Jan 08, 2014
  8. Jan 07, 2014
    • Chandler Carruth's avatar
      Move the LLVM IR asm writer header files into the IR directory, as they · 9aca918d
      Chandler Carruth authored
      are part of the core IR library in order to support dumping and other
      basic functionality.
      
      Rename the 'Assembly' include directory to 'AsmParser' to match the
      library name and the only functionality left their -- printing has been
      in the core IR library for quite some time.
      
      Update all of the #includes to match.
      
      All of this started because I wanted to have the layering in good shape
      before I started adding support for printing LLVM IR using the new pass
      infrastructure, and commandline support for the new pass infrastructure.
      
      llvm-svn: 198688
      9aca918d
Loading