Skip to content
  1. 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
  2. Mar 05, 2014
  3. Mar 04, 2014
  4. Feb 25, 2014
  5. Feb 21, 2014
    • Rafael Espindola's avatar
      Rename many DataLayout variables from TD to DL. · 37dc9e19
      Rafael Espindola authored
      I am really sorry for the noise, but the current state where some parts of the
      code use TD (from the old name: TargetData) and other parts use DL makes it
      hard to write a patch that changes where those variables come from and how
      they are passed along.
      
      llvm-svn: 201827
      37dc9e19
  6. Feb 06, 2014
  7. Feb 04, 2014
  8. Jan 22, 2014
  9. 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
  10. Sep 17, 2013
  11. Jul 03, 2013
  12. Jun 08, 2013
    • Shuxin Yang's avatar
      Fix a potential bug in r183584. · 140d592d
      Shuxin Yang authored
        r183584 tries to derive some info from the code *AFTER* a call and apply
      these derived info to the code *BEFORE* the call, which is not always safe
      as the call in question may never return, and in this case, the derived
      info is invalid.
        
        Thank Duncan for pointing out this potential bug.
      
      rdar://14073661 
      
      llvm-svn: 183606
      140d592d
    • Shuxin Yang's avatar
      Fix an assertion in MemCpyOpt pass. · bd254f26
      Shuxin Yang authored
        The MemCpyOpt pass is capable of optimizing:
            callee(&S); copy N bytes from S to D.
          into:
            callee(&D);
      subject to some legality constraints. 
      
        Assertion is triggered when the compiler tries to evalute "sizeof(typeof(D))",
      while D is an opaque-typed, 'sret' formal argument of function being compiled.
      i.e. the signature of the func being compiled is something like this:
        T caller(...,%opaque* noalias nocapture sret %D, ...)
      
        The fix is that when come across such situation, instead of calling some
      utility functions to get the size of D's type (which will crash), we simply
      assume D has at least N bytes as implified by the copy-instruction.
      
      rdar://14073661 
      
      llvm-svn: 183584
      bd254f26
  13. Jan 02, 2013
    • Chandler Carruth's avatar
      Move all of the header files which are involved in modelling the LLVM IR · 9fb823bb
      Chandler Carruth authored
      into their new header subdirectory: include/llvm/IR. This matches the
      directory structure of lib, and begins to correct a long standing point
      of file layout clutter in LLVM.
      
      There are still more header files to move here, but I wanted to handle
      them in separate commits to make tracking what files make sense at each
      layer easier.
      
      The only really questionable files here are the target intrinsic
      tablegen files. But that's a battle I'd rather not fight today.
      
      I've updated both CMake and Makefile build systems (I think, and my
      tests think, but I may have missed something).
      
      I've also re-sorted the includes throughout the project. I'll be
      committing updates to Clang, DragonEgg, and Polly momentarily.
      
      llvm-svn: 171366
      9fb823bb
  14. Dec 03, 2012
    • Chandler Carruth's avatar
      Use the new script to sort the includes of every file under lib. · ed0881b2
      Chandler Carruth authored
      Sooooo many of these had incorrect or strange main module includes.
      I have manually inspected all of these, and fixed the main module
      include to be the nearest plausible thing I could find. If you own or
      care about any of these source files, I encourage you to take some time
      and check that these edits were sensible. I can't have broken anything
      (I strictly added headers, and reordered them, never removed), but they
      may not be the headers you'd really like to identify as containing the
      API being implemented.
      
      Many forward declarations and missing includes were added to a header
      files to allow them to parse cleanly when included first. The main
      module rule does in fact have its merits. =]
      
      llvm-svn: 169131
      ed0881b2
  15. Nov 01, 2012
    • Chandler Carruth's avatar
      Revert the majority of the next patch in the address space series: · 5da3f051
      Chandler Carruth authored
      r165941: Resubmit the changes to llvm core to update the functions to
               support different pointer sizes on a per address space basis.
      
      Despite this commit log, this change primarily changed stuff outside of
      VMCore, and those changes do not carry any tests for correctness (or
      even plausibility), and we have consistently found questionable or flat
      out incorrect cases in these changes. Most of them are probably correct,
      but we need to devise a system that makes it more clear when we have
      handled the address space concerns correctly, and ideally each pass that
      gets updated would receive an accompanying test case that exercises that
      pass specificaly w.r.t. alternate address spaces.
      
      However, from this commit, I have retained the new C API entry points.
      Those were an orthogonal change that probably should have been split
      apart, but they seem entirely good.
      
      In several places the changes were very obvious cleanups with no actual
      multiple address space code added; these I have not reverted when
      I spotted them.
      
      In a few other places there were merge conflicts due to a cleaner
      solution being implemented later, often not using address spaces at all.
      In those cases, I've preserved the new code which isn't address space
      dependent.
      
      This is part of my ongoing effort to clean out the partial address space
      code which carries high risk and low test coverage, and not likely to be
      finished before the 3.2 release looms closer. Duncan and I would both
      like to see the above issues addressed before we return to these
      changes.
      
      llvm-svn: 167222
      5da3f051
  16. Oct 15, 2012
  17. Oct 11, 2012
  18. Oct 08, 2012
  19. Oct 05, 2012
  20. Oct 04, 2012
  21. Sep 13, 2012
  22. Jul 24, 2012
  23. Jun 29, 2012
    • Chandler Carruth's avatar
      Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.h · aafe0918
      Chandler Carruth authored
      This was always part of the VMCore library out of necessity -- it deals
      entirely in the IR. The .cpp file in fact was already part of the VMCore
      library. This is just a mechanical move.
      
      I've tried to go through and re-apply the coding standard's preferred
      header sort, but at 40-ish files, I may have gotten some wrong. Please
      let me know if so.
      
      I'll be committing the corresponding updates to Clang and Polly, and
      Duncan has DragonEgg.
      
      Thanks to Bill and Eric for giving the green light for this bit of cleanup.
      
      llvm-svn: 159421
      aafe0918
  24. May 14, 2012
  25. Feb 13, 2012
    • Ahmed Charles's avatar
      Fix various issues (or do cleanups) found by enabling certain MSVC warnings. · 32e983e4
      Ahmed Charles authored
      - Use unsigned literals when the desired result is unsigned. This mostly allows unsigned/signed mismatch warnings to be less noisy even if they aren't on by default.
      - Remove misplaced llvm_unreachable.
      - Add static to a declaration of a function on MSVC x86 only.
      - Change some instances of calling a static function through a variable to simply calling that function while removing the unused variable.
      
      llvm-svn: 150364
      32e983e4
  26. Dec 05, 2011
  27. Nov 20, 2011
  28. Oct 16, 2011
  29. Oct 12, 2011
  30. Aug 18, 2011
  31. Jul 18, 2011
  32. Jul 14, 2011
  33. Jul 12, 2011
    • Jay Foad's avatar
      Second attempt at de-constifying LLVM Types in FunctionType::get(), · b804a2b7
      Jay Foad authored
      StructType::get() and TargetData::getIntPtrType().
      
      llvm-svn: 134982
      b804a2b7
    • Bill Wendling's avatar
      Revert r134893 and r134888 (and related patches in other trees). It was causing · a78cd228
      Bill Wendling authored
      an assert on Darwin llvm-gcc builds.
      
      Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\
      ne 2067.
      etc.
      
      http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354
      
      --- Reverse-merging r134893 into '.':
      U    include/llvm/Target/TargetData.h
      U    include/llvm/DerivedTypes.h
      U    tools/bugpoint/ExtractFunction.cpp
      U    unittests/Support/TypeBuilderTest.cpp
      U    lib/Target/ARM/ARMGlobalMerge.cpp
      U    lib/Target/TargetData.cpp
      U    lib/VMCore/Constants.cpp
      U    lib/VMCore/Type.cpp
      U    lib/VMCore/Core.cpp
      U    lib/Transforms/Utils/CodeExtractor.cpp
      U    lib/Transforms/Instrumentation/ProfilingUtils.cpp
      U    lib/Transforms/IPO/DeadArgumentElimination.cpp
      U    lib/CodeGen/SjLjEHPrepare.cpp
      --- Reverse-merging r134888 into '.':
      G    include/llvm/DerivedTypes.h
      U    include/llvm/Support/TypeBuilder.h
      U    include/llvm/Intrinsics.h
      U    unittests/Analysis/ScalarEvolutionTest.cpp
      U    unittests/ExecutionEngine/JIT/JITTest.cpp
      U    unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
      U    unittests/VMCore/PassManagerTest.cpp
      G    unittests/Support/TypeBuilderTest.cpp
      U    lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
      U    lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
      U    lib/VMCore/IRBuilder.cpp
      G    lib/VMCore/Type.cpp
      U    lib/VMCore/Function.cpp
      G    lib/VMCore/Core.cpp
      U    lib/VMCore/Module.cpp
      U    lib/AsmParser/LLParser.cpp
      U    lib/Transforms/Utils/CloneFunction.cpp
      G    lib/Transforms/Utils/CodeExtractor.cpp
      U    lib/Transforms/Utils/InlineFunction.cpp
      U    lib/Transforms/Instrumentation/GCOVProfiling.cpp
      U    lib/Transforms/Scalar/ObjCARC.cpp
      U    lib/Transforms/Scalar/SimplifyLibCalls.cpp
      U    lib/Transforms/Scalar/MemCpyOptimizer.cpp
      G    lib/Transforms/IPO/DeadArgumentElimination.cpp
      U    lib/Transforms/IPO/ArgumentPromotion.cpp
      U    lib/Transforms/InstCombine/InstCombineCompares.cpp
      U    lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
      U    lib/Transforms/InstCombine/InstCombineCalls.cpp
      U    lib/CodeGen/DwarfEHPrepare.cpp
      U    lib/CodeGen/IntrinsicLowering.cpp
      U    lib/Bitcode/Reader/BitcodeReader.cpp
      
      llvm-svn: 134949
      a78cd228
Loading