1. Aug 24, 2015
    • Mehdi Amini's avatar
      Require Dominator Tree For SROA, improve compile-time · d134a67c
      Mehdi Amini authored
      TL-DR: SROA is followed by EarlyCSE which requires the DominatorTree.
      There is no reason not to require it up-front for SROA.
      
      Some history is necessary to understand why we ended-up here.
      
      r123437 switched the second (Legacy)SROA in the optimizer pipeline to
      use SSAUpdater in order to avoid recomputing the costly
      DominanceFrontier. The purpose was to speed-up the compile-time.
      
      Later r123609 removed the need for the DominanceFrontier in
      (Legacy)SROA.
      
      Right after, some cleanup was made in r123724 to remove any reference
      to the DominanceFrontier. SROA existed in two flavors: SROA_SSAUp and
      SROA_DT (the latter replacing SROA_DF).
      The second argument of `createScalarReplAggregatesPass` was renamed
      from `UseDomFrontier` to `UseDomTree`.
      I believe this is were a mistake was made. The pipeline was not
      updated and the call site was still:
          PM->add(createScalarReplAggregatesPass(-1, false));
      
      At that time, SROA was immediately followed in the pipeline by
      EarlyCSE which required alread the DominatorTree. Not requiring
      the DominatorTree in SROA didn't save anything, but unfortunately
      it was lost at this point.
      
      When the new SROA Pass was introduced in r163965, I believe the goal
      was to have an exact replacement of the existing SROA, this bug
      slipped through.
      
      You can see currently:
      
      $ echo "" | clang -x c++  -O3 -c - -mllvm -debug-pass=Structure
      ...
      ...
            FunctionPass Manager
              SROA
              Dominator Tree Construction
              Early CSE
      
      After this patch:
      
      $ echo "" | clang -x c++  -O3 -c - -mllvm -debug-pass=Structure
      ...
      ...
            FunctionPass Manager
              Dominator Tree Construction
              SROA
              Early CSE
      
      This improves the compile time from 88s to 23s for PR17855.
      https://llvm.org/bugs/show_bug.cgi?id=17855
      
      And from 113s to 12s for PR16756
      https://llvm.org/bugs/show_bug.cgi?id=16756
      
      Reviewers: chandlerc
      
      Differential Revision: http://reviews.llvm.org/D12267
      
      From: Mehdi Amini <mehdi.amini@apple.com>
      llvm-svn: 245820
      d134a67c
    • Sanjay Patel's avatar
      remove FIXME; fixed by r245733 · 453b4df9
      Sanjay Patel authored
      llvm-svn: 245819
      453b4df9
    • David Majnemer's avatar
      [IR] Cleanup EH instructions a little bit · b01aa9f7
      David Majnemer authored
      Just a cosmetic change, no functionality change is intended.
      
      llvm-svn: 245818
      b01aa9f7
    • Vedant Kumar's avatar
      [test] Fix typos in a few tests (NFC) · f8e09c3b
      Vedant Kumar authored
      Patch by Kai Zhao!
      
      llvm-svn: 245817
      f8e09c3b
    • Simon Pilgrim's avatar
      Added missing tests for SSE41 pmovsx/pmovzx extension intrinsics · 503976ad
      Simon Pilgrim authored
      llvm-svn: 245815
      503976ad
  2. Aug 23, 2015
  3. Aug 22, 2015
    • Jingyue Wu's avatar
      [CUDA] Change initializer for CUDA device code based on CUDA documentation. · 284ebe23
      Jingyue Wu authored
      Summary:
      According to CUDA documentation, global variables declared with __device__,
      __constant__ can be initialized from host code, so mark them as
      externally initialized. Because __shared__ variables cannot have an
      initialization as part of their declaration and since the value maybe kept
      across different kernel invocation, the value of __shared__ is effectively
      undefined instead of zero initialized.
      
      Wrongly using zero initializer may cause illegitimate optimization, e.g.
      removing unused __constant__ variable because it's not updated in the device
      code and the value is initialized with zero.
      
      Test Plan: test/CodeGenCUDA/address-spaces.cu
      
      Patch by Xuetian Weng
      
      Reviewers: jholewinski, eliben, tra, jingyue
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D12241
      
      llvm-svn: 245786
      284ebe23
    • Jingyue Wu's avatar
      [NVPTX] Allow undef value as global initializer · fcec0986
      Jingyue Wu authored
      Summary:
      __shared__ variable may now emit undef value as initializer, do not
      throw error on that.
      
      Test Plan: test/CodeGen/NVPTX/global-addrspace.ll
      
      Patch by Xuetian Weng
      
      Reviewers: jholewinski, tra, jingyue
      
      Subscribers: llvm-commits, jholewinski
      
      Differential Revision: http://reviews.llvm.org/D12242
      
      llvm-svn: 245785
      fcec0986
    • Alexey Samsonov's avatar
      Revert r245770 and r245777. · 4369a3f4
      Alexey Samsonov authored
      These changes break both autoconf Mac OS X buildbot (linker errors
      due to wrong Makefiles) and CMake buildbot (safestack test failures).
      
      llvm-svn: 245784
      4369a3f4
    • NAKAMURA Takumi's avatar
      [CMake] add_llvm_external_project: Just warn about nonexistent directories. · 6fa85320
      NAKAMURA Takumi authored
      These entries were generated accidentally.
      
      llvm-svn: 245783
      6fa85320
    • NAKAMURA Takumi's avatar
      [CMake] Make LLVM_EXTERNAL_*_SOURCE_DIR consistent against older buildsites. · 04e2da52
      NAKAMURA Takumi authored
      If corresponding in-tree subdirectory exists, just ignore LLVM_EXTERNAL* stuff.
      Otherwise, set LLVM_TOOL_*_BUILD ON/OFF properly according to LLVM_EXTERNAL_*.
      
      This makes easier to walk among old revisions *without* deleteing CMakeCache.txt.
      
      Before r242059, LLVM_EXTERNAL_* was working like;
      
        if(EXISTS ${*_SOURCE_DIR}/CMakeLists.txt)
          set(*_BUILD ON CACHE)
          if(*_BUILD is ON)
            add_subdirectory(*_SOURCE_DIR)
          endif()
        endif()
      
      llvm-svn: 245782
      04e2da52
    • Peter Collingbourne's avatar
      LTO: Maintain target triple, FeatureStr and CGOptLevel in the module or LTOCodeGenerator. · c7b675f4
      Peter Collingbourne authored
      This makes it easier to create new TargetMachines on demand.
      
      llvm-svn: 245781
      c7b675f4
    • Richard Smith's avatar
      [modules] Remove some dead code after r245779. · 0144f515
      Richard Smith authored
      llvm-svn: 245780
      0144f515
    • Richard Smith's avatar
      [modules] Rearrange how redeclaration chains are loaded, to remove a walk over · d8a83718
      Richard Smith authored
      all modules and reduce the number of declarations we load when loading a
      redeclaration chain.
      
      The new approach is:
       * when loading the first declaration of an entity within a module file, we
         first load all declarations of the entity that were imported into that
         module file, and then load all the other declarations of that entity from
         that module file and build a suitable decl chain from them
       * when loading any other declaration of an entity, we first load the first
         declaration from the same module file
      
      As before, we complete redecl chains through name lookup where necessary.
      
      To make this work, I also had to change the way that template specializations
      are stored -- it no longer suffices to track only canonical specializations; we
      now emit all "first local" declarations when emitting a list of specializations
      for a template.
      
      On one testcase with several thousand imported module files, this reduces the
      total runtime by 72%.
      
      llvm-svn: 245779
      d8a83718