Skip to content
  1. Jan 30, 2010
  2. Jan 27, 2010
    • Jeffrey Yasskin's avatar
      Kill ModuleProvider and ghost linkage by inverting the relationship between · 091217be
      Jeffrey Yasskin authored
      Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
      GlobalValues now, and doesn't provide modules, it's renamed to
      "GVMaterializer". Code that used to need a ModuleProvider to materialize
      Functions can now materialize the Functions directly. Functions no longer use a
      magic linkage to record that they're materializable; they simply ask the
      GVMaterializer.
      
      Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
      the functions that refer to it. Instead, because Module now exposes the same
      functionality ModuleProvider used to, we store a Module* in any
      LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
      other languages still use the ModuleProvider concept.  It would probably be
      worth some time to update them to follow the C++ more closely, but I don't
      intend to do it.
      
      Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.
      
      llvm-svn: 94686
      091217be
  3. Jan 24, 2010
  4. Jan 23, 2010
  5. Jan 22, 2010
  6. Jan 20, 2010
  7. Jan 07, 2010
  8. Jan 06, 2010
    • Duncan Sands's avatar
      Fix a README item: have functionattrs look through selects and · c8493da5
      Duncan Sands authored
      phi nodes when deciding which pointers point to local memory.
      I actually checked long ago how useful this is, and it isn't
      very: it hardly ever fires in the testsuite, but since Chris
      wants it here it is!
      
      llvm-svn: 92836
      c8493da5
    • Duncan Sands's avatar
      Partially address a README by having functionattrs consider calls to · 78376ad7
      Duncan Sands authored
      memcpy, memset and other intrinsics that only access their arguments
      to be readnone if the intrinsic's arguments all point to local memory.
      This improves the testcase in the README to readonly, but it could in
      theory be made readnone, however this would involve more sophisticated
      analysis that looks through the memcpy.
      
      llvm-svn: 92829
      78376ad7
  9. Jan 05, 2010
  10. Dec 29, 2009
    • Chris Lattner's avatar
      Final step in the metadata API restructuring: move the · a0566979
      Chris Lattner authored
      getMDKindID/getMDKindNames methods to LLVMContext (and add
      convenience methods to Module), eliminating MetadataContext.
      Move the state that it maintains out to LLVMContext.
      
      llvm-svn: 92259
      a0566979
    • Chris Lattner's avatar
      This is a major cleanup of the instruction metadata interfaces that · 2f2aa2b0
      Chris Lattner authored
      I asked Devang to do back on Sep 27.  Instead of going through the
      MetadataContext class with methods like getMD() and getMDs(), just
      ask the instruction directly for its metadata with getMetadata()
      and getAllMetadata().
      
      This includes a variety of other fixes and improvements: previously
      all Value*'s were bloated because the HasMetadata bit was thrown into
      value, adding a 9th bit to a byte.  Now this is properly sunk down to
      the Instruction class (the only place where it makes sense) and it
      will be folded away somewhere soon.
      
      This also fixes some confusion in getMDs and its clients about 
      whether the returned list is indexed by the MDID or densely packed.
      This is now returned sorted and densely packed and the comments make
      this clear.
      
      This introduces a number of fixme's which I'll follow up on.
      
      llvm-svn: 92235
      2f2aa2b0
  11. Dec 28, 2009
  12. Dec 08, 2009
  13. Nov 23, 2009
  14. Nov 19, 2009
  15. Nov 17, 2009
  16. Nov 12, 2009
    • Chris Lattner's avatar
      use isInstructionTriviallyDead, as pointed out by Duncan · 5c89f4b4
      Chris Lattner authored
      llvm-svn: 87035
      5c89f4b4
    • Chris Lattner's avatar
      implement a nice little efficiency hack in the inliner. Since we're now · eb9acbfb
      Chris Lattner authored
      running IPSCCP early, and we run functionattrs interlaced with the inliner,
      we often (particularly for small or noop functions) completely propagate
      all of the information about a call to its call site in IPSSCP (making a call
      dead) and functionattrs is smart enough to realize that the function is
      readonly (because it is interlaced with inliner).
      
      To improve compile time and make the inliner threshold more accurate, realize
      that we don't have to inline dead readonly function calls.  Instead, just 
      delete the call.  This happens all the time for C++ codes, here are some
      counters from opt/llvm-ld counting the number of times calls were deleted vs
      inlined on various apps:
      
      Tramp3d opt:
        5033 inline                - Number of call sites deleted, not inlined
       24596 inline                - Number of functions inlined
      llvm-ld:
        667 inline           - Number of functions deleted because all callers found
        699 inline           - Number of functions inlined
      
      483.xalancbmk opt:
        8096 inline                - Number of call sites deleted, not inlined
       62528 inline                - Number of functions inlined
      llvm-ld:
         217 inline           - Number of allocas merged together
        2158 inline           - Number of functions inlined
      
      471.omnetpp:
        331 inline                - Number of call sites deleted, not inlined
       8981 inline                - Number of functions inlined
      llvm-ld:
        171 inline           - Number of functions deleted because all callers found
        629 inline           - Number of functions inlined
      
      
      Deleting a call is much faster than inlining it, and is insensitive to the
      size of the callee. :)
      
      llvm-svn: 86975
      eb9acbfb
  17. Nov 10, 2009
    • Victor Hernandez's avatar
      Update computeArraySize() to use ComputeMultiple() to determine the array size... · fcc77b1c
      Victor Hernandez authored
      Update computeArraySize() to use ComputeMultiple() to determine the array size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size
      
      llvm-svn: 86676
      fcc77b1c
  18. Nov 07, 2009
    • Victor Hernandez's avatar
      - new SROA mallocs should have the mallocs running-or'ed, not the malloc's bitcast · bde558c5
      Victor Hernandez authored
      - fix ProcessInternalGlobal() debug output
      
      llvm-svn: 86317
      bde558c5
    • Victor Hernandez's avatar
      Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions. · f3db9152
      Victor Hernandez authored
      Here is the original commit message:
      
      This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments.
      
      Update CreateMalloc so that its callers specify the size to allocate:
      MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
      Optimization uses use TargetData to compute the allocation size.
      
      Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
      Extend getMallocType() to support malloc calls that have non-bitcast uses.
      
      Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses.  The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.
      
      Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses.  The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.
      
      Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.
      
      Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.
      
      llvm-svn: 86311
      f3db9152
  19. Nov 06, 2009
  20. Nov 05, 2009
    • Dan Gohman's avatar
      Update various Loop optimization passes to cope with the possibility that · a83ac2d9
      Dan Gohman authored
      LoopSimplify form may not be available.
      
      llvm-svn: 86175
      a83ac2d9
    • Victor Hernandez's avatar
      Update CreateMalloc so that its callers specify the size to allocate: · 492ed30a
      Victor Hernandez authored
      MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
      Optimization uses use TargetData to compute the allocation size.
      
      Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
      Extend getMallocType() to support malloc calls that have non-bitcast uses.
      
      Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses.  The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.
      
      Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses.  The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.
      
      Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.
      
      Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.
      
      llvm-svn: 86077
      492ed30a
Loading