Skip to content
  1. Jan 11, 2013
  2. Jan 10, 2013
  3. Jan 07, 2013
    • Eli Bendersky's avatar
      Add the align_to_end option to .bundle_lock in the MC implementation of aligned · 802b6287
      Eli Bendersky authored
      bundling. The document describing this feature and the implementation has also
      been updated:
      
      https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/aligned-bundling-support-in-llvm
      
      llvm-svn: 171797
      802b6287
    • Chandler Carruth's avatar
      Move CallGraphSCCPass.h into the Analysis tree; that's where the · 839a98e6
      Chandler Carruth authored
      implementation lives already.
      
      llvm-svn: 171746
      839a98e6
    • Chandler Carruth's avatar
      Switch TargetTransformInfo from an immutable analysis pass that requires · 664e354d
      Chandler Carruth authored
      a TargetMachine to construct (and thus isn't always available), to an
      analysis group that supports layered implementations much like
      AliasAnalysis does. This is a pretty massive change, with a few parts
      that I was unable to easily separate (sorry), so I'll walk through it.
      
      The first step of this conversion was to make TargetTransformInfo an
      analysis group, and to sink the nonce implementations in
      ScalarTargetTransformInfo and VectorTargetTranformInfo into
      a NoTargetTransformInfo pass. This allows other passes to add a hard
      requirement on TTI, and assume they will always get at least on
      implementation.
      
      The TargetTransformInfo analysis group leverages the delegation chaining
      trick that AliasAnalysis uses, where the base class for the analysis
      group delegates to the previous analysis *pass*, allowing all but tho
      NoFoo analysis passes to only implement the parts of the interfaces they
      support. It also introduces a new trick where each pass in the group
      retains a pointer to the top-most pass that has been initialized. This
      allows passes to implement one API in terms of another API and benefit
      when some other pass above them in the stack has more precise results
      for the second API.
      
      The second step of this conversion is to create a pass that implements
      the TargetTransformInfo analysis using the target-independent
      abstractions in the code generator. This replaces the
      ScalarTargetTransformImpl and VectorTargetTransformImpl classes in
      lib/Target with a single pass in lib/CodeGen called
      BasicTargetTransformInfo. This class actually provides most of the TTI
      functionality, basing it upon the TargetLowering abstraction and other
      information in the target independent code generator.
      
      The third step of the conversion adds support to all TargetMachines to
      register custom analysis passes. This allows building those passes with
      access to TargetLowering or other target-specific classes, and it also
      allows each target to customize the set of analysis passes desired in
      the pass manager. The baseline LLVMTargetMachine implements this
      interface to add the BasicTTI pass to the pass manager, and all of the
      tools that want to support target-aware TTI passes call this routine on
      whatever target machine they end up with to add the appropriate passes.
      
      The fourth step of the conversion created target-specific TTI analysis
      passes for the X86 and ARM backends. These passes contain the custom
      logic that was previously in their extensions of the
      ScalarTargetTransformInfo and VectorTargetTransformInfo interfaces.
      I separated them into their own file, as now all of the interface bits
      are private and they just expose a function to create the pass itself.
      Then I extended these target machines to set up a custom set of analysis
      passes, first adding BasicTTI as a fallback, and then adding their
      customized TTI implementations.
      
      The fourth step required logic that was shared between the target
      independent layer and the specific targets to move to a different
      interface, as they no longer derive from each other. As a consequence,
      a helper functions were added to TargetLowering representing the common
      logic needed both in the target implementation and the codegen
      implementation of the TTI pass. While technically this is the only
      change that could have been committed separately, it would have been
      a nightmare to extract.
      
      The final step of the conversion was just to delete all the old
      boilerplate. This got rid of the ScalarTargetTransformInfo and
      VectorTargetTransformInfo classes, all of the support in all of the
      targets for producing instances of them, and all of the support in the
      tools for manually constructing a pass based around them.
      
      Now that TTI is a relatively normal analysis group, two things become
      straightforward. First, we can sink it into lib/Analysis which is a more
      natural layer for it to live. Second, clients of this interface can
      depend on it *always* being available which will simplify their code and
      behavior. These (and other) simplifications will follow in subsequent
      commits, this one is clearly big enough.
      
      Finally, I'm very aware that much of the comments and documentation
      needs to be updated. As soon as I had this working, and plausibly well
      commented, I wanted to get it committed and in front of the build bots.
      I'll be doing a few passes over documentation later if it sticks.
      
      Commits to update DragonEgg and Clang will be made presently.
      
      llvm-svn: 171681
      664e354d
  4. Jan 06, 2013
  5. Jan 05, 2013
    • Chandler Carruth's avatar
      Fix another place where we build the TTI pass to the new interface. · 441c2ac9
      Chandler Carruth authored
      Sorry for the noise here, 'make check' doesn't build this code. =/
      
      llvm-svn: 171623
      441c2ac9
    • Chandler Carruth's avatar
      Convert the TargetTransformInfo from an immutable pass with dynamic · 539edf4e
      Chandler Carruth authored
      interfaces which could be extracted from it, and must be provided on
      construction, to a chained analysis group.
      
      The end goal here is that TTI works much like AA -- there is a baseline
      "no-op" and target independent pass which is in the group, and each
      target can expose a target-specific pass in the group. These passes will
      naturally chain allowing each target-specific pass to delegate to the
      generic pass as needed.
      
      In particular, this will allow a much simpler interface for passes that
      would like to use TTI -- they can have a hard dependency on TTI and it
      will just be satisfied by the stub implementation when that is all that
      is available.
      
      This patch is a WIP however. In particular, the "stub" pass is actually
      the one and only pass, and everything there is implemented by delegating
      to the target-provided interfaces. As a consequence the tools still have
      to explicitly construct the pass. Switching targets to provide custom
      passes and sinking the stub behavior into the NoTTI pass is the next
      step.
      
      llvm-svn: 171621
      539edf4e
  6. Jan 02, 2013
    • Chandler Carruth's avatar
      Move all of the header files which are involved in modelling the LLVM IR · 9fb823bb
      Chandler Carruth authored
      into their new header subdirectory: include/llvm/IR. This matches the
      directory structure of lib, and begins to correct a long standing point
      of file layout clutter in LLVM.
      
      There are still more header files to move here, but I wanted to handle
      them in separate commits to make tracking what files make sense at each
      layer easier.
      
      The only really questionable files here are the target intrinsic
      tablegen files. But that's a battle I'd rather not fight today.
      
      I've updated both CMake and Makefile build systems (I think, and my
      tests think, but I may have missed something).
      
      I've also re-sorted the includes throughout the project. I'll be
      committing updates to Clang, DragonEgg, and Polly momentarily.
      
      llvm-svn: 171366
      9fb823bb
    • Chandler Carruth's avatar
      b034cb77
  7. Jan 01, 2013
  8. Dec 31, 2012
  9. Dec 21, 2012
    • Rafael Espindola's avatar
      Add a function to get the segment name of a section. · a9f810b6
      Rafael Espindola authored
      On MachO, sections also have segment names. When a tool looking at a .o file
      prints a segment name, this is what they mean. In reality, a .o has only one
      anonymous, segment.
      
      This patch adds a MachO only function to fetch that segment name. I named it
      getSectionFinalSegmentName since the main use for the name seems to be inform
      the linker with segment this section should go to.
      
      The patch also changes MachOObjectFile::getSectionName to return just the
      section name instead of computing SegmentName,SectionName.
      
      The main difference from the previous patch is that it doesn't use
      InMemoryStruct. It is extremely dangerous: if the endians match it returns
      a pointer to the file buffer, if not, it returns a pointer to an internal buffer
      that is overwritten in the next API call.
      
      We should change all of this code to use
      support::detail::packed_endian_specific_integral like ELF, but since these
      functions only handle strings, they work with big and little endian machines
      as is.
      
      I have tested this by installing ubuntu 12.10 ppc on qemu, that is why it took
      so long :-)
      
      llvm-svn: 170838
      a9f810b6
  10. Dec 20, 2012
  11. Dec 19, 2012
    • Roman Divacky's avatar
      Remove edis - the enhanced disassembler. Fixes PR14654. · e3d32305
      Roman Divacky authored
      llvm-svn: 170578
      e3d32305
    • Rafael Espindola's avatar
      Revert 170545 while I debug the ppc failures. · 0f00de40
      Rafael Espindola authored
      llvm-svn: 170547
      0f00de40
    • Rafael Espindola's avatar
      Add r170095 back. · aa7b2780
      Rafael Espindola authored
      I cannot reproduce it the failures locally, so I will keep an eye at the ppc
      bots. This patch does add the change to the "Disassembly of section" message,
      but that is not what was failing on the bots.
      
      Original message:
      
      Add a funciton to get the segment name of a section.
      
      On MachO, sections also have segment names. When a tool looking at a .o file
      prints a segment name, this is what they mean. In reality, a .o has only one
      anonymous, segment.
      
      This patch adds a MachO only function to fetch that segment name. I named it
      getSectionFinalSegmentName since the main use for the name seems to be infor
      the linker with segment this section should go to.
      
      The patch also changes MachOObjectFile::getSectionName to return just the
      section name instead of computing SegmentName,SectionName.
      
      llvm-svn: 170545
      aa7b2780
  12. Dec 18, 2012
  13. Dec 17, 2012
  14. Dec 16, 2012
    • Reed Kotler's avatar
      This patch is needed to make c++ exceptions work for mips16. · aee4d5d1
      Reed Kotler authored
      Mips16 is really a processor decoding mode (ala thumb 1) and in the same
      program, mips16 and mips32 functions can exist and can call each other.
      
      If a jal type instruction encounters an address with the lower bit set, then
      the processor switches to mips16 mode (if it is not already in it). If the
      lower bit is not set, then it switches to mips32 mode.
      
      The linker knows which functions are mips16 and which are mips32.
      When relocation is performed on code labels, this lower order bit is
      set if the code label is a mips16 code label.
      
      In general this works just fine, however when creating exception handling
      tables and dwarf, there are cases where you don't want this lower order
      bit added in.
      
      This has been traditionally distinguished in gas assembly source by using a
      different syntax for the label.
      
      lab1:      ; this will cause the lower order bit to be added
      lab2=.     ; this will not cause the lower order bit to be added
      
      In some cases, it does not matter because in dwarf and debug tables
      the difference of two labels is used and in that case the lower order
      bits subtract each other out.
      
      To fix this, I have added to mcstreamer the notion of a debuglabel.
      The default is for label and debug label to be the same. So calling
      EmitLabel and EmitDebugLabel produce the same result.
      
      For various reasons, there is only one set of labels that needs to be
      modified for the mips exceptions to work. These are the "$eh_func_beginXXX" 
      labels.
      
      Mips overrides the debug label suffix from ":" to "=." .
      
      This initial patch fixes exceptions. More changes most likely
      will be needed to DwarfCFException to make all of this work
      for actual debugging. These changes will be to emit debug labels in some
      places where a simple label is emitted now.
      
      Some historical discussion on this from gcc can be found at:
      http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00623.html
      http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01273.html 
      
      llvm-svn: 170279
      aee4d5d1
  15. Dec 13, 2012
    • Eric Christopher's avatar
      Revert "Add a funciton to get the segment name of a section." · c859c291
      Eric Christopher authored
      This reverts commit r170095 since it appears to be breaking the bots.
      
      llvm-svn: 170105
      c859c291
    • Rafael Espindola's avatar
      Add a funciton to get the segment name of a section. · bc8016d0
      Rafael Espindola authored
      On MachO, sections also have segment names. When a tool looking at a .o file
      prints a segment name, this is what they mean. In reality, a .o has only one,
      anonymous, segment.
      
      This patch adds a MachO only function to fetch that segment name. I named it
      getSectionFinalSegmentName since the main use for the name seems to be informing
      the linker with segment this section should go to.
      
      The patch also changes MachOObjectFile::getSectionName to return just the
      section name instead of computing SegmentName,SectionName.
      
      llvm-svn: 170095
      bc8016d0
  16. Dec 11, 2012
  17. Dec 10, 2012
  18. Dec 08, 2012
    • Bill Wendling's avatar
      Add the `lto_codegen_set_export_dynamic' function. · 65a6ee11
      Bill Wendling authored
      This function sets the `_exportDynamic' ivar. When that's set, we export all
      symbols (e.g. we don't run the internalize pass). This is equivalent to the
      `--export-dynamic' linker flag in GNU land:
      
      --export-dynamic
        When creating a dynamically linked executable, add all symbols to the dynamic
        symbol table. The dynamic symbol table is the set of symbols which are visible
        from dynamic objects at run time. If you do not use this option, the dynamic
        symbol table will normally contain only those symbols which are referenced by
        some dynamic object mentioned in the link. If you use dlopen to load a dynamic
        object which needs to refer back to the symbols defined by the program, rather
        than some other dynamic object, then you will probably need to use this option
        when linking the program itself.
      
      The Darwin linker will support this via the `-export_dynamic' flag. We should
      modify clang to support this via the `-rdynamic' flag.
      
      llvm-svn: 169656
      65a6ee11
    • Jim Grosbach's avatar
      Add C API for specifying CPU to the disassembler. · 0ca9d5b7
      Jim Grosbach authored
      It was a nasty oversight that we didn't include this when we added this
      API in the first place. Blech.
      
      rdar://12839439
      
      llvm-svn: 169653
      0ca9d5b7
  19. Dec 05, 2012
    • Michael J. Spencer's avatar
      Quick build fix for c++03 clang. This needs a proper solution. Note that these... · 6fa518c5
      Michael J. Spencer authored
      Quick build fix for c++03 clang. This needs a proper solution. Note that these offsets are guaranteed to be correct by Endian.h.
      
      llvm-svn: 169438
      6fa518c5
    • Michael J. Spencer's avatar
      Add dump of Win64 EH unwind data. · 0c6ec48d
      Michael J. Spencer authored
      The new command line option -unwind-info dumps the Win64 EH unwind
      data to the console. This is a nice feature if you need to debug
      generated EH data (e.g. from LLVM). Includes a test case.
      
      Initial patch by João Matos, extensions and rework by Kai Nacke.
      
      llvm-svn: 169415
      0c6ec48d
    • Kevin Enderby's avatar
      Added a option to the disassembler to print immediates as hex. · 168ffb36
      Kevin Enderby authored
      This is for the lldb team so most of but not all of the values are
      to be printed as hex with this option.  Some small values like the
      scale in an X86 address were requested to printed in decimal
      without the leading 0x.
      
      There may be some tweaks need to places that may still be in
      decimal that they want in hex.  Specially for arm.  I made my best
      guess.  Any tweaks from here should be simple.
      
      I also did the best I know now with help from the C++ gurus
      creating the cleanest formatImm() utility function and containing
      the changes.  But if someone has a better idea to make something
      cleaner I'm all ears and game for changing the implementation.
      
      rdar://8109283
      
      llvm-svn: 169393
      168ffb36
Loading