Skip to content
  1. May 14, 2014
  2. May 13, 2014
    • Rafael Espindola's avatar
      Split GlobalValue into GlobalValue and GlobalObject. · 99e05cf1
      Rafael Espindola authored
      This allows code to statically accept a Function or a GlobalVariable, but
      not an alias. This is already a cleanup by itself IMHO, but the main
      reason for it is that it gives a lot more confidence that the refactoring to fix
      the design of GlobalAlias is correct. That will be a followup patch.
      
      llvm-svn: 208716
      99e05cf1
  3. May 09, 2014
  4. Apr 26, 2014
  5. Apr 25, 2014
    • Adrian Prantl's avatar
      This reapplies r207235 with an additional bugfixes caught by the msan · 32da8892
      Adrian Prantl authored
      buildbot - do not insert debug intrinsics before phi nodes.
      
      Debug info for optimized code: Support variables that are on the stack and
      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.ll testcase and included source
      
      rdar://problem/16679879
      http://reviews.llvm.org/D3374
      
      llvm-svn: 207269
      32da8892
    • Adrian Prantl's avatar
      Revert "This reapplies r207130 with an additional testcase+and a missing check for" · d2d9b76e
      Adrian Prantl authored
      This reverts commit 207235 to investigate msan buildbot breakage.
      
      llvm-svn: 207250
      d2d9b76e
    • Adrian Prantl's avatar
      Reapply r207135 without modifications. · 0840a224
      Adrian Prantl authored
      Debug info: Let dbg.values inserted by LowerDbgDeclare inherit the location
      of the dbg.value. This gets rid of tons of redundant variable DIEs in
      subscopes.
      
      rdar://problem/14874886, rdar://problem/16679936
      
      llvm-svn: 207236
      0840a224
    • Adrian Prantl's avatar
      This reapplies r207130 with an additional testcase+and a missing check for · f5834a4b
      Adrian Prantl authored
      AllocaInst that was missing in one location.
      Debug info for optimized code: Support variables that are on the stack and
      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.ll testcase and included source
      
      rdar://problem/16679879
      http://reviews.llvm.org/D3374
      
      llvm-svn: 207235
      f5834a4b
    • Craig Topper's avatar
      [C++] Use 'nullptr'. Transforms edition. · f40110f4
      Craig Topper authored
      llvm-svn: 207196
      f40110f4
    • Adrian Prantl's avatar
      Revert "This reapplies r207130 with an additional testcase+and a missing check for" · 6e5de2ea
      Adrian Prantl authored
      Typo in testcase.
      
      llvm-svn: 207166
      6e5de2ea
    • Adrian Prantl's avatar
      This reapplies r207130 with an additional testcase+and a missing check for · 3512190a
      Adrian Prantl authored
      AllocaInst that was missing in one location.
      Debug info for optimized code: Support variables that are on the stack and
      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.ll testcase and included source
      
      rdar://problem/16679879
      http://reviews.llvm.org/D3374
      
      llvm-svn: 207165
      3512190a
    • Adrian Prantl's avatar
      Revert "Debug info for optimized code: Support variables that are on the stack and" · ff4282a2
      Adrian Prantl authored
      This reverts commit 207130 for buildbot breakage.
      
      llvm-svn: 207162
      ff4282a2
    • Adrian Prantl's avatar
      Revert "Debug info: Let dbg.values inserted by LowerDbgDeclare inherit the location" · 5ad11841
      Adrian Prantl authored
      This reverts commit 207130 for buildbot breakage.
      
      llvm-svn: 207159
      5ad11841
  6. 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
  7. Apr 22, 2014
    • 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
  8. Mar 28, 2014
  9. Mar 09, 2014
    • 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
  10. Mar 06, 2014
  11. Mar 04, 2014
  12. Jan 13, 2014
    • Chandler Carruth's avatar
      [PM] Split DominatorTree into a concrete analysis result object which · 73523021
      Chandler Carruth authored
      can be used by both the new pass manager and the old.
      
      This removes it from any of the virtual mess of the pass interfaces and
      lets it derive cleanly from the DominatorTreeBase<> template. In turn,
      tons of boilerplate interface can be nuked and it turns into a very
      straightforward extension of the base DominatorTree interface.
      
      The old analysis pass is now a simple wrapper. The names and style of
      this split should match the split between CallGraph and
      CallGraphWrapperPass. All of the users of DominatorTree have been
      updated to match using many of the same tricks as with CallGraph. The
      goal is that the common type remains the resulting DominatorTree rather
      than the pass. This will make subsequent work toward the new pass
      manager significantly easier.
      
      Also in numerous places things became cleaner because I switched from
      re-running the pass (!!! mid way through some other passes run!!!) to
      directly recomputing the domtree.
      
      llvm-svn: 199104
      73523021
    • Chandler Carruth's avatar
      [cleanup] Move the Dominators.h and Verifier.h headers into the IR · 5ad5f15c
      Chandler Carruth authored
      directory. These passes are already defined in the IR library, and it
      doesn't make any sense to have the headers in Analysis.
      
      Long term, I think there is going to be a much better way to divide
      these matters. The dominators code should be fully separated into the
      abstract graph algorithm and have that put in Support where it becomes
      obvious that evn Clang's CFGBlock's can use it. Then the verifier can
      manually construct dominance information from the Support-driven
      interface while the Analysis library can provide a pass which both
      caches, reconstructs, and supports a nice update API.
      
      But those are very long term, and so I don't want to leave the really
      confusing structure until that day arrives.
      
      llvm-svn: 199082
      5ad5f15c
  13. Dec 10, 2013
  14. Nov 19, 2013
  15. Oct 21, 2013
    • Bill Wendling's avatar
      Don't eliminate a partially redundant load if it's in a landing pad. · 90dd90af
      Bill Wendling authored
      A landing pad can be jumped to only by the unwind edge of an invoke
      instruction. If we eliminate a partially redundant load in a landing pad, it
      will create a basic block that violates this constraint. It then leads to other
      problems down the line if it tries to merge that basic block with the landing
      pad. Avoid this by not eliminating the load in a landing pad.
      
      PR17621
      
      llvm-svn: 193064
      90dd90af
  16. Oct 19, 2013
  17. Oct 02, 2013
    • Chandler Carruth's avatar
      Remove the very substantial, largely unmaintained legacy PGO · ea564946
      Chandler Carruth authored
      infrastructure.
      
      This was essentially work toward PGO based on a design that had several
      flaws, partially dating from a time when LLVM had a different
      architecture, and with an effort to modernize it abandoned without being
      completed. Since then, it has bitrotted for several years further. The
      result is nearly unusable, and isn't helping any of the modern PGO
      efforts. Instead, it is getting in the way, adding confusion about PGO
      in LLVM and distracting everyone with maintenance on essentially dead
      code. Removing it paves the way for modern efforts around PGO.
      
      Among other effects, this removes the last of the runtime libraries from
      LLVM. Those are being developed in the separate 'compiler-rt' project
      now, with somewhat different licensing specifically more approriate for
      runtimes.
      
      llvm-svn: 191835
      ea564946
  18. Sep 24, 2013
  19. Sep 09, 2013
    • Bob Wilson's avatar
      Revert patches to add case-range support for PR1255. · e407736a
      Bob Wilson authored
      The work on this project was left in an unfinished and inconsistent state.
      Hopefully someone will eventually get a chance to implement this feature, but
      in the meantime, it is better to put things back the way the were.  I have
      left support in the bitcode reader to handle the case-range bitcode format,
      so that we do not lose bitcode compatibility with the llvm 3.3 release.
      
      This reverts the following commits: 155464, 156374, 156377, 156613, 156704,
      156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575,
      157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884,
      157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100,
      159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659,
      159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736
      
      llvm-svn: 190328
      e407736a
  20. Aug 15, 2013
  21. Aug 13, 2013
  22. Aug 10, 2013
  23. Aug 02, 2013
  24. Jul 24, 2013
  25. Jul 23, 2013
  26. Jul 11, 2013
    • Duncan Sands's avatar
      TryToSimplifyUncondBranchFromEmptyBlock was checking that any common · e773c080
      Duncan Sands authored
      predecessors of the two blocks it is attempting to merge supply the
      same incoming values to any phi in the successor block.  This change
      allows merging in the case where there is one or more incoming values
      that are undef.  The undef values are rewritten to match the non-undef
      value that flows from the other edge.  Patch by Mark Lacey.
      
      llvm-svn: 186069
      e773c080
Loading