Skip to content
  1. May 22, 2009
    • Duncan Sands's avatar
      Add a new codegen pass that normalizes dwarf exception handling · d6fb6501
      Duncan Sands authored
      code in preparation for code generation.  The main thing it does
      is handle the case when eh.exception calls (and, in a future
      patch, eh.selector calls) are far away from landing pads.  Right
      now in practice you only find eh.exception calls close to landing
      pads: either in a landing pad (the common case) or in a landing
      pad successor, due to loop passes shifting them about.  However
      future exception handling improvements will result in calls far
      from landing pads:
      (1) Inlining of rewinds.  Consider the following case:
      In function @f:
      ...
        invoke @g to label %normal unwind label %unwinds
      ...
      unwinds:
        %ex = call i8* @llvm.eh.exception()
      ...
      
      In function @g:
      ...
        invoke @something to label %continue unwind label %handler
      ...
      handler:
        %ex = call i8* @llvm.eh.exception()
      ... perform cleanups ...
        "rethrow exception"
      
      Now inline @g into @f.  Currently this is turned into:
      In function @f:
      ...
        invoke @something to label %continue unwind label %handler
      ...
      handler:
        %ex = call i8* @llvm.eh.exception()
      ... perform cleanups ...
        invoke "rethrow exception" to label %normal unwind label %unwinds
      unwinds:
        %ex = call i8* @llvm.eh.exception()
      ...
      
      However we would like to simplify invoke of "rethrow exception" into
      a branch to the %unwinds label.  Then %unwinds is no longer a landing
      pad, and the eh.exception call there is then far away from any landing
      pads.
      
      (2) Using the unwind instruction for cleanups.
      It would be nice to have codegen handle the following case:
        invoke @something to label %continue unwind label %run_cleanups
      ...
      handler:
      ... perform cleanups ...
        unwind
      
      This requires turning "unwind" into a library call, which
      necessarily takes a pointer to the exception as an argument
      (this patch also does this unwind lowering).  But that means
      you are using eh.exception again far from a landing pad.
      
      (3) Bugpoint simplifications.  When bugpoint is simplifying
      exception handling code it often generates eh.exception calls
      far from a landing pad, which then causes codegen to assert.
      Bugpoint then latches on to this assertion and loses sight
      of the original problem.
      
      Note that it is currently rare for this pass to actually do
      anything.  And in fact it normally shouldn't do anything at
      all given the code coming out of llvm-gcc!  But it does fire
      a few times in the testsuite.  As far as I can see this is
      almost always due to the LoopStrengthReduce codegen pass
      introducing pointless loop preheader blocks which are landing
      pads and only contain a branch to another block.  This other
      block contains an eh.exception call.  So probably by tweaking
      LoopStrengthReduce a bit this can be avoided.
      
      llvm-svn: 72276
      d6fb6501
  2. May 16, 2009
    • Jakob Stoklund Olesen's avatar
      Pass to verify generated machine code. · 36c027ab
      Jakob Stoklund Olesen authored
      The following is checked:
      
      * Operand counts: All explicit operands must be present.
      
      * Register classes: All physical and virtual register operands must be
        compatible with the register class required by the instruction descriptor.
      
      * Register live intervals: Registers must be defined only once, and must be
        defined before use.
      
      The machine code verifier is enabled with the command-line option
      '-verify-machineinstrs', or by defining the environment variable
      LLVM_VERIFY_MACHINEINSTRS to the name of a file that will receive all the
      verifier errors.
      
      llvm-svn: 71918
      36c027ab
  3. May 12, 2009
  4. May 07, 2009
  5. May 05, 2009
  6. Apr 30, 2009
  7. Apr 29, 2009
    • Bill Wendling's avatar
      Second attempt: · 084669a1
      Bill Wendling authored
      Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
      use the old behavior, the flag is -O0. This change allows for finer-grained
      control over which optimizations are run at different -O levels.
      
      Most of this work was pretty mechanical. The majority of the fixes came from
      verifying that a "fast" variable wasn't used anymore. The JIT still uses a
      "Fast" flag. I'll change the JIT with a follow-up patch.
      
      llvm-svn: 70343
      084669a1
  8. Apr 28, 2009
  9. Mar 25, 2009
  10. Feb 09, 2009
  11. Feb 08, 2009
  12. Feb 07, 2009
  13. Feb 05, 2009
  14. Dec 18, 2008
  15. Nov 24, 2008
  16. Nov 20, 2008
  17. Nov 13, 2008
  18. Nov 04, 2008
    • Bill Wendling's avatar
      Update in response to feedback from Chris: · 64adc71e
      Bill Wendling authored
      - Use enums instead of magic numbers.
      
      - Rework algorithm to use the bytes size from the target to determine when to
        emit stack protectors.
      
      - Get rid of "propolice" in any comments.
      
      - Renamed an option to its expanded form.
      
      - Other miscellanenous changes.
      
      More changes will come after this.
      
      llvm-svn: 58723
      64adc71e
    • Bill Wendling's avatar
      Initial checkin for stack protectors. Here's what it does: · 05d8417f
      Bill Wendling authored
      * The prologue is modified to read the __stack_chk_guard global and insert it
        onto the stack.
      
      * The epilogue is modified to read the stored guard from the stack and compare
        it to the original __stack_chk_guard value. If they differ, then the
        __stack_chk_fail() function is called.
      
      * The stack protector needs to be first on the stack (after the parameters) to
        catch any stack-smashing activities.
      
      Front-end support will follow after a round of beta testing.
      
      llvm-svn: 58673
      05d8417f
  19. Oct 25, 2008
    • Dan Gohman's avatar
      Move the code that adds the DeadMachineInstructionElimPass from · 19145317
      Dan Gohman authored
      target-independent code to target-specific code. This prevents it
      from running on targets that aren't using fast-isel.
      
      In addition to saving compile time, this addresses the problem
      that not all targets are prepared for it. In order to use this
      pass, all instructions must declare all their fixed uses and
      defs of physical registers.
      
      llvm-svn: 58144
      19145317
  20. Oct 22, 2008
  21. Oct 08, 2008
  22. Oct 02, 2008
  23. Oct 01, 2008
  24. Sep 25, 2008
  25. Aug 21, 2008
  26. Aug 17, 2008
    • Gordon Henriksen's avatar
      Rename some GC classes so that their roll will hopefully be clearer. · d930f913
      Gordon Henriksen authored
      In particular, Collector was confusing to implementors. Several
      thought that this compile-time class was the place to implement
      their runtime GC heap. Of course, it doesn't even exist at runtime.
      Specifically, the renames are:
      
        Collector               -> GCStrategy
        CollectorMetadata       -> GCFunctionInfo
        CollectorModuleMetadata -> GCModuleInfo
        CollectorRegistry       -> GCRegistry
        Function::getCollector  -> getGC (setGC, hasGC, clearGC)
      
      Several accessors and nested types have also been renamed to be
      consistent. These changes should be obvious.
      
      llvm-svn: 54899
      d930f913
    • Gordon Henriksen's avatar
      Factor GC metadata table assembly generation out of Collector in preparation... · bcef14d2
      Gordon Henriksen authored
      Factor GC metadata table assembly generation out of Collector in preparation for splitting AsmPrinter into its own library.
      
      llvm-svn: 54881
      bcef14d2
  27. Jul 01, 2008
  28. Jun 06, 2008
  29. Jun 04, 2008
  30. Jun 03, 2008
  31. May 31, 2008
  32. Apr 23, 2008
Loading