Skip to content
  1. May 26, 2009
  2. May 24, 2009
  3. May 23, 2009
    • Torok Edwin's avatar
      Fix PR4254. · be6a9a15
      Torok Edwin authored
      The DAGCombiner created a negative shiftamount, stored in an
      unsigned variable. Later the optimizer eliminated the shift entirely as being
      undefined.
      Example: (srl (shl X, 56) 48). ShiftAmt is 4294967288.
      Fix it by checking that the shiftamount is positive, and storing in a signed
      variable.
      
      llvm-svn: 72331
      be6a9a15
    • Eli Friedman's avatar
      Add a new step to legalization to legalize vector math operations. This · da90dd6d
      Eli Friedman authored
      will allow simplifying LegalizeDAG to eliminate type legalization.  (I 
      have a patch to do that, but it's not quite finished; I'll commit it 
      once it's finished and I've fixed any review comments for this patch.)  
      See the comment at the beginning of 
      lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp for more details on the
      motivation for this patch.
      
      llvm-svn: 72325
      da90dd6d
  4. 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
  5. May 21, 2009
  6. May 20, 2009
    • Eli Friedman's avatar
      Fix for PR4235: to build a floating-point value from integer parts, · 9030c35e
      Eli Friedman authored
      build an integer and cast that to a float.  This fixes a crash 
      caused by trying to split an f32 into two f16's.
      
      This changes the behavior in test/CodeGen/XCore/fneg.ll because that 
      testcase now triggers a DAGCombine which converts the fneg into an integer
      operation.  If someone is interested, it's probably possible to tweak 
      the test to generate an actual fneg.
      
      llvm-svn: 72162
      9030c35e
  7. May 19, 2009
  8. May 18, 2009
  9. May 17, 2009
Loading