Skip to content
  1. Apr 25, 2014
  2. Apr 24, 2014
    • Adrian Prantl's avatar
      Debug info: Let dbg.values inserted by LowerDbgDeclare inherit the location · f4a70109
      Adrian Prantl authored
      of the dbg.value. This gets rid of tons of redundant variable DIEs in
      subscopes.
      
      rdar://problem/14874886, rdar://problem/16679936
      
      llvm-svn: 207135
      f4a70109
    • Adrian Prantl's avatar
      Debug info for optimized code: Support variables that are on the stack and · f4223918
      Adrian Prantl authored
      described by DBG_VALUEs during their lifetime.
      
      Previously, when a variable was at a FrameIndex for any part of its
      lifetime, this would shadow all other DBG_VALUEs and only a single
      fbreg location would be emitted, which in fact is only valid for a small
      range and not the entire lexical scope of the variable. The included
      dbg-value-const-byref testcase demonstrates this.
      
      This patch fixes this by
      Local
      - emitting dbg.value intrinsics for allocas that are passed by reference
      - dropping all dbg.declares (they are now fully lowered to dbg.values)
      SelectionDAG
      - renamed constructors for SDDbgValue for better readability.
      - fix UserValue::match() to handle indirect values correctly
      - not inserting an MMI table entries for dbg.values that describe allocas.
      - lowering dbg.values that describe allocas into *indirect* DBG_VALUEs.
      CodeGenPrepare
      - leaving dbg.values for an alloca were they are (see comment)
      Other
      - regenerated/updated instcombine-intrinsics testcase and included source
      
      
      rdar://problem/16679879
      http://reviews.llvm.org/D3374
      
      llvm-svn: 207130
      f4223918
  3. Apr 23, 2014
  4. Apr 22, 2014
    • Chandler Carruth's avatar
      [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE · 964daaaf
      Chandler Carruth authored
      definition below all of the header #include lines, lib/Transforms/...
      edition.
      
      This one is tricky for two reasons. We again have a couple of passes
      that define something else before the includes as well. I've sunk their
      name macros with the DEBUG_TYPE.
      
      Also, InstCombine contains headers that need DEBUG_TYPE, so now those
      headers #define and #undef DEBUG_TYPE around their code, leaving them
      well formed modular headers. Fixing these headers was a large motivation
      for all of these changes, as "leaky" macros of this form are hard on the
      modules implementation.
      
      llvm-svn: 206844
      964daaaf
    • Chandler Carruth's avatar
      [Modules] Make Support/Debug.h modular. This requires it to not change · e96dd897
      Chandler Carruth authored
      behavior based on other files defining DEBUG_TYPE, which means it cannot
      define DEBUG_TYPE at all. This is actually better IMO as it forces folks
      to define relevant DEBUG_TYPEs for their files. However, it requires all
      files that currently use DEBUG(...) to define a DEBUG_TYPE if they don't
      already. I've updated all such files in LLVM and will do the same for
      other upstream projects.
      
      This still leaves one important change in how LLVM uses the DEBUG_TYPE
      macro going forward: we need to only define the macro *after* header
      files have been #include-ed. Previously, this wasn't possible because
      Debug.h required the macro to be pre-defined. This commit removes that.
      By defining DEBUG_TYPE after the includes two things are fixed:
      
      - Header files that need to provide a DEBUG_TYPE for some inline code
        can do so by defining the macro before their inline code and undef-ing
        it afterward so the macro does not escape.
      
      - We no longer have rampant ODR violations due to including headers with
        different DEBUG_TYPE definitions. This may be mostly an academic
        violation today, but with modules these types of violations are easy
        to check for and potentially very relevant.
      
      Where necessary to suppor headers with DEBUG_TYPE, I have moved the
      definitions below the includes in this commit. I plan to move the rest
      of the DEBUG_TYPE macros in LLVM in subsequent commits; this one is big
      enough.
      
      The comments in Debug.h, which were hilariously out of date already,
      have been updated to reflect the recommended practice going forward.
      
      llvm-svn: 206822
      e96dd897
  5. Apr 21, 2014
    • Reid Kleckner's avatar
      Fix PR7272 in -tailcallelim instead of the inliner · 9b2cc647
      Reid Kleckner authored
      The -tailcallelim pass should be checking if byval or inalloca args can
      be captured before marking calls as tail calls.  This was the real root
      cause of PR7272.
      
      With a better fix in place, revert the inliner change from r105255.  The
      test case it introduced still passes and has been moved to
      test/Transforms/Inline/byval-tail-call.ll.
      
      Reviewers: chandlerc
      
      Differential Revision: http://reviews.llvm.org/D3403
      
      llvm-svn: 206789
      9b2cc647
  6. Apr 18, 2014
    • Diego Novillo's avatar
      Fix bug 19437 - Only add discriminators for DWARF 4 and above. · 0915c047
      Diego Novillo authored
      Summary:
      This prevents the discriminator generation pass from triggering if
      the DWARF version being used in the module is prior to 4.
      
      Reviewers: echristo, dblaikie
      
      CC: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D3413
      
      llvm-svn: 206507
      0915c047
    • Nuno Lopes's avatar
      remove some dead code · 9ced19ab
      Nuno Lopes authored
       lib/Analysis/IPA/InlineCost.cpp         |   18 ------------------
       lib/Analysis/RegionPass.cpp             |    1 -
       lib/Analysis/TypeBasedAliasAnalysis.cpp |    1 -
       lib/Transforms/Scalar/LoopUnswitch.cpp  |   21 ---------------------
       lib/Transforms/Utils/LCSSA.cpp          |    2 --
       lib/Transforms/Utils/LoopSimplify.cpp   |    6 ------
       utils/TableGen/AsmWriterEmitter.cpp     |   13 -------------
       utils/TableGen/DFAPacketizerEmitter.cpp |    7 -------
       utils/TableGen/IntrinsicEmitter.cpp     |    2 --
       9 files changed, 71 deletions(-)
      
      llvm-svn: 206506
      9ced19ab
  7. Apr 15, 2014
  8. Apr 11, 2014
    • David Blaikie's avatar
      Implement depth_first and inverse_depth_first range factory functions. · ceec2bda
      David Blaikie authored
      Also updated as many loops as I could find using df_begin/idf_begin -
      strangely I found no uses of idf_begin. Is that just used out of tree?
      
      Also a few places couldn't use df_begin because either they used the
      member functions of the depth first iterators or had specific ordering
      constraints (I added a comment in the latter case).
      
      Based on a patch by Jim Grosbach. (Jim - you just had iterator_range<T>
      where you needed iterator_range<idf_iterator<T>>)
      
      llvm-svn: 206016
      ceec2bda
  9. Mar 28, 2014
  10. Mar 26, 2014
  11. Mar 20, 2014
  12. Mar 19, 2014
  13. Mar 18, 2014
  14. Mar 12, 2014
  15. Mar 11, 2014
  16. Mar 10, 2014
    • Evan Cheng's avatar
      For functions with ARM target specific calling convention, when simplify-libcall · 0e8f4612
      Evan Cheng authored
      optimize a call to a llvm intrinsic to something that invovles a call to a C
      library call, make sure it sets the right calling convention on the call.
      
      e.g.
      extern double pow(double, double);
      double t(double x) {
        return pow(10, x);
      }
      
      Compiles to something like this for AAPCS-VFP:
      define arm_aapcs_vfpcc double @t(double %x) #0 {
      entry:
        %0 = call double @llvm.pow.f64(double 1.000000e+01, double %x)
        ret double %0
      }
      
      declare double @llvm.pow.f64(double, double) #1
      
      Simplify libcall (part of instcombine) will turn the above into:
      define arm_aapcs_vfpcc double @t(double %x) #0 {
      entry:
        %__exp10 = call double @__exp10(double %x) #1
        ret double %__exp10
      }
      
      declare double @__exp10(double)
      
      The pre-instcombine code works because calls to LLVM builtins are special.
      Instruction selection will chose the right calling convention for the call.
      However, the code after instcombine is wrong. The call to __exp10 will use
      the C calling convention.
      
      I can think of 3 options to fix this.
      
      1. Make "C" calling convention just work since the target should know what CC
         is being used.
      
         This doesn't work because each function can use different CC with the "pcs"
         attribute.
      
      2. Have Clang add the right CC keyword on the calls to LLVM builtin.
      
         This will work but it doesn't match the LLVM IR specification which states
         these are "Standard C Library Intrinsics".
      
      3. Fix simplify libcall so the resulting calls to the C routines will have the
         proper CC keyword. e.g.
         %__exp10 = call arm_aapcs_vfpcc double @__exp10(double %x) #1
      
         This works and is the solution I implemented here.
      
      Both solutions #2 and #3 would work. After carefully considering the pros and
      cons, I decided to implement #3 for the following reasons.
      
      1. It doesn't change the "spec" of the intrinsics.
      2. It's a self-contained fix.
      
      There are a couple of potential downsides.
      1. There could be other places in the optimizer that is broken in the same way
         that's not addressed by this.
      2. There could be other calling conventions that need to be propagated by
         simplify-libcall that's not handled.
      
      But for now, this is the fix that I'm most comfortable with.
      
      llvm-svn: 203488
      0e8f4612
  17. Mar 09, 2014
    • Benjamin Kramer's avatar
      SimplifyCFG: Simplify the weight scaling algorithm. · 79da941f
      Benjamin Kramer authored
      No change in functionality.
      
      llvm-svn: 203413
      79da941f
    • Chandler Carruth's avatar
      [C++11] Add range based accessors for the Use-Def chain of a Value. · cdf47884
      Chandler Carruth authored
      This requires a number of steps.
      1) Move value_use_iterator into the Value class as an implementation
         detail
      2) Change it to actually be a *Use* iterator rather than a *User*
         iterator.
      3) Add an adaptor which is a User iterator that always looks through the
         Use to the User.
      4) Wrap these in Value::use_iterator and Value::user_iterator typedefs.
      5) Add the range adaptors as Value::uses() and Value::users().
      6) Update *all* of the callers to correctly distinguish between whether
         they wanted a use_iterator (and to explicitly dig out the User when
         needed), or a user_iterator which makes the Use itself totally
         opaque.
      
      Because #6 requires churning essentially everything that walked the
      Use-Def chains, I went ahead and added all of the range adaptors and
      switched them to range-based loops where appropriate. Also because the
      renaming requires at least churning every line of code, it didn't make
      any sense to split these up into multiple commits -- all of which would
      touch all of the same lies of code.
      
      The result is still not quite optimal. The Value::use_iterator is a nice
      regular iterator, but Value::user_iterator is an iterator over User*s
      rather than over the User objects themselves. As a consequence, it fits
      a bit awkwardly into the range-based world and it has the weird
      extra-dereferencing 'operator->' that so many of our iterators have.
      I think this could be fixed by providing something which transforms
      a range of T&s into a range of T*s, but that *can* be separated into
      another patch, and it isn't yet 100% clear whether this is the right
      move.
      
      However, this change gets us most of the benefit and cleans up
      a substantial amount of code around Use and User. =]
      
      llvm-svn: 203364
      cdf47884
  18. Mar 06, 2014
  19. Mar 05, 2014
  20. Mar 04, 2014
Loading