Skip to content
  1. Aug 13, 2013
  2. Aug 12, 2013
  3. Aug 11, 2013
    • Chandler Carruth's avatar
      Re-instate r187323 which fast-tracks promotable allocas as soon as the · d7cd7e36
      Chandler Carruth authored
      SROA-based analysis has enough information. This should work now that
      both mem2reg *and* the SSAUpdater-based AllocaPromoter have been updated
      to be able to promote the types of allocas that the SROA analysis
      detects.
      
      I've included tests for the AllocaPromoter that were only possible to
      write once we fast-tracked promotable allocas without rewriting them.
      This includes a test both for r187347 and r188145.
      
      Original commit log for r187323:
      """
      Now that mem2reg understands how to cope with a slightly wider set of uses of
      an alloca, we can pre-compute promotability while analyzing an alloca for
      splitting in SROA. That lets us short-circuit the common case of a bunch of
      trivially promotable allocas. This cuts 20% to 30% off the run time of SROA for
      typical frontend-generated IR sequneces I'm seeing. It gets the new SROA to
      within 20% of ScalarRepl for such code. My current benchmark for these numbers
      is PR15412, but it fits the general pattern of IR emitted by Clang so it should
      be widely applicable.
      """
      
      llvm-svn: 188146
      d7cd7e36
    • Chandler Carruth's avatar
      Finish fixing the SSAUpdater-based AllocaPromoter strategy in SROA to cope with · c17283b4
      Chandler Carruth authored
      the more general set of patterns that are now handled by mem2reg and that we
      can detect quickly while doing SROA's initial analysis. Notably, this allows it
      to promote through no-op bitcast and GEP sequences. A core part of the
      SSAUpdater approach is the ability to test whether a particular instruction is
      part of the set being promoted. Testing this becomes significantly more complex
      in the world where the operand to every load and store isn't the alloca itself.
      I ended up using the approach of walking up the def-chain until we find the
      alloca. I benchmarked this against keeping a set of pointer operands and
      keeping a set of the loads and stores we care about, and this one seemed faster
      although the difference was very small.
      
      No test case yet because currently the rewriting always "fixes" the inputs to
      not require this. The next patch which re-enables early promotion of easy cases
      in SROA will include a test case that specifically exercises this aspect of the
      alloca promoter.
      
      llvm-svn: 188145
      c17283b4
    • Chandler Carruth's avatar
      Reformat some bits of AllocaPromoter and simplify the name and type of · 45b136f4
      Chandler Carruth authored
      our visiting datastructures in the AllocaPromoter/SSAUpdater path of
      SROA. Also shift the order if clears around to be more consistent.
      
      No functionality changed here, this is just a cleanup.
      
      llvm-svn: 188144
      45b136f4
  4. Aug 10, 2013
  5. Aug 09, 2013
  6. Aug 08, 2013
  7. Aug 07, 2013
    • Benjamin Kramer's avatar
      JumpThreading: Turn a select instruction into branching if it allows to thread... · 6a4976d3
      Benjamin Kramer authored
      JumpThreading: Turn a select instruction into branching if it allows to thread one half of the select.
      
      This is a common pattern coming out of simplifycfg generating gross code.
      
      a:                                       ; preds = %entry
        %sel = select i1 %cmp1, double %add, double 0.000000e+00
        br label %b
      
      b:
        %cond5 = phi double [ %sel, %a ], [ %sub, %entry ]
        %cmp6 = fcmp oeq double %cond5, 0.000000e+00
        br i1 %cmp6, label %if.then, label %if.end
      
      becomes
      
      a:
        br i1 %cmp1, label %b, label %if.then
      
      b:
        %cond5 = phi double [ %sub, %entry ], [ %add, %a ]
        %cmp6 = fcmp oeq double %cond5, 0.000000e+00
        br i1 %cmp6, label %if.then, label %if.end
      
      Skipping block b completely if possible.
      
      llvm-svn: 187880
      6a4976d3
    • Bill Wendling's avatar
      Change the linkage of these global values to 'internal'. · 58f8cef8
      Bill Wendling authored
      The globals being generated here were given the 'private' linkage type. However,
      this caused them to end up in different sections with the wrong prefix. E.g.,
      they would be in the __TEXT,__const section with an 'L' prefix instead of an 'l'
      (lowercase ell) prefix.
      
      The problem is that the linker will eat a literal label with 'L'. If a weak
      symbol is then placed into the __TEXT,__const section near that literal, then it
      cannot distinguish between the literal and the weak symbol.
      
      Part of the problems here was introduced because the address sanitizer converted
      some C strings into constant initializers with trailing nuls. (Thus putting them
      in the __const section with the wrong prefix.) The others were variables that
      the address sanitizer created but simply had the wrong linkage type.
      
      llvm-svn: 187827
      58f8cef8
    • Arnold Schwaighofer's avatar
      LoopVectorize: Allow vectorization of loops with lifetime markers · a7cd6bf3
      Arnold Schwaighofer authored
      Patch by Marc Jessome!
      
      llvm-svn: 187825
      a7cd6bf3
  8. Aug 06, 2013
  9. Aug 05, 2013
    • Peter Collingbourne's avatar
      Introduce an optimisation for special case lists with large numbers of literal entries. · bace6066
      Peter Collingbourne authored
      Our internal regex implementation does not cope with large numbers
      of anchors very efficiently.  Given a ~3600-entry special case list,
      regex compilation can take on the order of seconds.  This patch solves
      the problem for the special case of patterns matching literal global
      names (i.e. patterns with no regex metacharacters).  Rather than
      forming regexes from literal global name patterns, add them to
      a StringSet which is checked before matching against the regex.
      This reduces regex compilation time by an order of roughly thousands
      when reading the aforementioned special case list, according to a
      completely unscientific study.
      
      No test cases.  I figure that any new tests for this code should
      check that regex metacharacters are properly recognised.  However,
      I could not find any documentation which documents the fact that the
      syntax of global names in special case lists is based on regexes.
      The extent to which regex syntax is supported in special case lists
      should probably be decided on/documented before writing tests.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1150
      
      llvm-svn: 187732
      bace6066
    • Alexey Samsonov's avatar
      80-cols · f52b717d
      Alexey Samsonov authored
      llvm-svn: 187725
      f52b717d
  10. Aug 02, 2013
  11. Aug 01, 2013
  12. Jul 31, 2013
Loading