Skip to content
  1. Oct 23, 2018
    • Vedant Kumar's avatar
      [HotColdSplitting] Attach MinSize to outlined code · 50315461
      Vedant Kumar authored
      Outlined code is cold by assumption, so it makes sense to optimize it
      for minimal code size rather than performance.
      
      After r344869 moved the splitting pass to the end of the IR pipeline,
      this does not result in much of a code size reduction. This is probably
      because a comparatively small number backend transforms make use of the
      MinSize hint.
      
      Running LNT on x86_64, I see that 33/1020 binaries shrink for a total of
      919 bytes of TEXT reduction. I didn't measure a significant performance
      impact.
      
      Differential Revision: https://reviews.llvm.org/D53518
      
      llvm-svn: 345072
      50315461
    • Jordan Rupprecht's avatar
      [DebugInfo][GlobalOpt] Fix -debugify for globalopt shrinking globals to booleans. · 2fed6ac1
      Jordan Rupprecht authored
      Summary:
      TryToShrinkGlobalToBoolean, when possible, will split store <value> + load <value> into store <bool> + select <bool ? value : 0>. This preserves DebugLoc during that pass.
      
      Fixes PR37959. The test case here is the simplified .ll for:
      
      ```
      static int foo;
      int bar() {
        foo = 5;
        return foo;
      }
      ```
      
      Reviewers: dblaikie, gbedwell, aprantl
      
      Reviewed By: dblaikie
      
      Subscribers: mehdi_amini, JDevlieghere, dexonsmith, llvm-commits
      
      Tags: #debug-info
      
      Differential Revision: https://reviews.llvm.org/D53531
      
      llvm-svn: 345046
      2fed6ac1
  2. Oct 22, 2018
  3. Oct 21, 2018
  4. Oct 18, 2018
  5. Oct 17, 2018
  6. Oct 16, 2018
  7. Oct 15, 2018
    • Sebastian Pop's avatar
      [hot-cold-split] fix static analysis of cold regions · 542e522b
      Sebastian Pop authored
      Make the code of blockEndsInUnreachable to match the function
      blockEndsInUnreachable in CodeGen/BranchFolding.cpp. I also have
      added a note to make sure the code of this function will not be
      modified unless the back-end version is also modified.
      
      An early return before outlining has been added to avoid
      outlining the full function body when the first block in the
      function is marked cold.
      
      The static analysis of cold code has been amended to avoid
      marking the whole function as cold by back-propagation
      because the back-propagation would mark blocks with return
      statements as cold.
      
      The patch adds debug statements to help discover these problems.
      
      Differential Revision: https://reviews.llvm.org/D52904
      
      llvm-svn: 344558
      542e522b
    • Chandler Carruth's avatar
      [TI removal] Make variables declared as `TerminatorInst` and initialized · edb12a83
      Chandler Carruth authored
      by `getTerminator()` calls instead be declared as `Instruction`.
      
      This is the biggest remaining chunk of the usage of `getTerminator()`
      that insists on the narrow type and so is an easy batch of updates.
      Several files saw more extensive updates where this would cascade to
      requiring API updates within the file to use `Instruction` instead of
      `TerminatorInst`. All of these were trivial in nature (pervasively using
      `Instruction` instead just worked).
      
      llvm-svn: 344502
      edb12a83
  8. Oct 13, 2018
  9. Oct 12, 2018
  10. Oct 11, 2018
    • Richard Smith's avatar
      Add a flag to remap manglings when reading profile data information. · 6c676628
      Richard Smith authored
      This can be used to preserve profiling information across codebase
      changes that have widespread impact on mangled names, but across which
      most profiling data should still be usable. For example, when switching
      from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI,
      or even from a 32-bit to a 64-bit build.
      
      The user can provide a remapping file specifying parts of mangled names
      that should be treated as equivalent (eg, std::__1 should be treated as
      equivalent to std::__cxx11), and profile data will be treated as
      applying to a particular function if its name is equivalent to the name
      of a function in the profile data under the provided equivalences. See
      the documentation change for a description of how this is configured.
      
      Remapping is supported for both sample-based profiling and instruction
      profiling. We do not support remapping indirect branch target
      information, but all other profile data should be remapped
      appropriately.
      
      Support is only added for the new pass manager. If someone wants to also
      add support for this for the old pass manager, doing so should be
      straightforward.
      
      This is the LLVM side of Clang r344199.
      
      Reviewers: davidxl, tejohnson, dlj, erik.pilkington
      
      Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51249
      
      llvm-svn: 344200
      6c676628
  11. Oct 10, 2018
    • George Burgess IV's avatar
      Replace most users of UnknownSize with LocationSize::unknown(); NFC · 6ef8002c
      George Burgess IV authored
      Moving away from UnknownSize is part of the effort to migrate us to
      LocationSizes (e.g. the cleanup promised in D44748).
      
      This doesn't entirely remove all of the uses of UnknownSize; some uses
      require tweaks to assume that UnknownSize isn't just some kind of int.
      This patch is intended to just be a trivial replacement for all places
      where LocationSize::unknown() will Just Work.
      
      llvm-svn: 344186
      6ef8002c
  12. Oct 08, 2018
    • Xin Tong's avatar
      [ThinLTO] Keep non-prevailing (linkonce|weak)_odr symbols live · bfdad33b
      Xin Tong authored
      Summary:
      If we have a symbol with (linkonce|weak)_odr linkage, we do not want
      to dead strip it even it is not prevailing.
      
      IR level (linkonce|weak)_odr symbol can become non-prevailing when we mix
      ELF objects and IR objects where the (linkonce|weak)_odr symbol in the ELF
      object is prevailing and the ones in the IR objects are not. Stripping
      them will prevent us from doing optimizations with them.
      
      By not dead stripping them, We will convert these symbols to
      available_externally linkage as a result of non-prevailing and eventually
      dropping them after inlining.
      
      I modified cache-prevailing.ll to use linkonce linkage as it is
      testing whether cache prevailing bit is effective or not, not
      we should treat linkonce_odr alive or not
      
      Reviewers: tejohnson, pcc
      
      Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52893
      
      llvm-svn: 343970
      bfdad33b
  13. Oct 03, 2018
  14. Oct 01, 2018
  15. Sep 28, 2018
    • whitequark's avatar
      Revert "[LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints" · 29b29801
      whitequark authored
      This reverts commit c4baf7c2f06ff5459c4f5998ce980346e72bff97.
      
      Broke the bots, and should really be in Transforms/Coroutines
      instead.
      
      llvm-svn: 343337
      29b29801
    • whitequark's avatar
      [LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints · 937afbc3
      whitequark authored
      Summary: This patch adds bindings to C and Go for addCoroutinePassesToExtensionPoints, which is used to add coroutine passes to the correct locations in PassManagerBuilder.
      
      Reviewers: whitequark, deadalnix
      
      Reviewed By: whitequark
      
      Subscribers: mehdi_amini, modocache, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51642
      
      llvm-svn: 343336
      937afbc3
    • Florian Hahn's avatar
      Revert r343308: [LoopInterchange] Turn into a loop pass. · 8d72ecc3
      Florian Hahn authored
      llvm-svn: 343310
      8d72ecc3
    • Florian Hahn's avatar
      [LoopInterchange] Turn into a loop pass. · 0694c159
      Florian Hahn authored
      This patch turns LoopInterchange into a loop pass. It now only
      considers top-level loops and tries to move the innermost loop to the
      optimal position within the loop nest. By only looking at top-level
      loops, we might miss a few opportunities the function pass would get
      (e.g. if we have a loop nest of 3 loops, in the function pass
      we might process loops at level 1 and 2 and move the inner most loop to
      level 1, and then we process loops at levels 0, 1, 2 and interchange
      again, because we now have a different inner loop). But I think it would
      be better to handle such cases by picking the best inner loop from the
      start and avoid re-visiting the same loops again.
      
      The biggest advantage of it being a function pass is that it interacts
      nicely with the other loop passes. Without this patch, there are some
      performance regressions on AArch64 with loop interchanging enabled,
      where no loops were interchanged, but we missed out on some other loop
      optimizations.
      
      It also removes the SimplifyCFG run. We are just changing branches, so
      the CFG should not be more complicated, besides the additional 'unique'
      preheaders this pass might create.
      
      
      Reviewers: chandlerc, efriedma, mcrosier, javed.absar, xbolva00
      
      Reviewed By: xbolva00
      
      Differential Revision: https://reviews.llvm.org/D51702
      
      llvm-svn: 343308
      0694c159
  16. Sep 27, 2018
    • Teresa Johnson's avatar
      [WPD] Fix incorrect devirtualization after indirect call promotion · f24136f1
      Teresa Johnson authored
      Summary:
      Add a dominance check to ensure that the possible devirtualizable
      call is actually dominated by the type test/checked load intrinsic being
      analyzed. With PGO, after indirect call promotion is performed during
      the compile step, followed by inlining, we may have a type test in the
      promoted and inlined sequence that allows an indirect call in that
      sequence to be devirtualized. That indirect call (inserted by inlining
      after promotion) will share the same vtable pointer as the fallback
      indirect call that cannot be devirtualized.
      
      Before this patch the code was incorrectly devirtualizing the fallback
      indirect call.
      
      See the new test and the example described there for more details.
      
      Reviewers: pcc, vitalybuka
      
      Subscribers: mehdi_amini, Prazek, eraman, steven_wu, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52514
      
      llvm-svn: 343226
      f24136f1
    • Fangrui Song's avatar
      llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) · 0cac726a
      Fangrui Song authored
      Summary: The convenience wrapper in STLExtras is available since rL342102.
      
      Reviewers: dblaikie, javed.absar, JDevlieghere, andreadb
      
      Subscribers: MatzeB, sanjoy, arsenm, dschuff, mehdi_amini, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, javed.absar, gbedwell, jrtc27, mgrang, atanasyan, steven_wu, george.burgess.iv, dexonsmith, kristina, jsji, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52573
      
      llvm-svn: 343163
      0cac726a
  17. Sep 24, 2018
  18. Sep 23, 2018
  19. Sep 20, 2018
  20. Sep 18, 2018
  21. Sep 17, 2018
    • Xin Tong's avatar
      [CVP] Handle instructions with no user. No need to create CVPLattice state.... · 8a505c64
      Xin Tong authored
      [CVP] Handle instructions with no user. No need to create CVPLattice state. This handles terminator instructions and more.
      
      Summary:
      I tested this patch by compiling sqlite3.ll (clang -O3 -mllvm -disable-llvm-optzns sqlite3.c.)
      
       opt -called-value-propagation sqlite3.ll -time-passes -f -o out.ll
      
       I get 10+% speedup for the pass. I expect some of the gain come from skipping terminator instructions.
      
          === BEFORE THE PATCH ===
          ===-------------------------------------------------------------------------===
                                ... Pass execution timing report ...
          ===-------------------------------------------------------------------------===
            Total Execution Time: 0.5562 seconds (0.5582 wall clock)
      
             ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
             0.2485 ( 46.4%)   0.0120 ( 57.7%)   0.2605 ( 46.8%)   0.2615 ( 46.8%)  Bitcode Writer
             0.1607 ( 30.0%)   0.0079 ( 37.7%)   0.1685 ( 30.3%)   0.1693 ( 30.3%)  Called Value Propagation
             0.1262 ( 23.6%)   0.0009 (  4.5%)   0.1271 ( 22.9%)   0.1275 ( 22.8%)  Module Verifier
             0.5353 (100.0%)   0.0209 (100.0%)   0.5562 (100.0%)   0.5582 (100.0%)  Total
      
          === AFTER THE PATCH ===
          ===-------------------------------------------------------------------------===
                                ... Pass execution timing report ...
          ===-------------------------------------------------------------------------===
            Total Execution Time: 0.5338 seconds (0.5355 wall clock)
      
             ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
             0.2498 ( 48.6%)   0.0118 ( 59.3%)   0.2615 ( 49.0%)   0.2629 ( 49.1%)  Bitcode Writer
             0.1377 ( 26.8%)   0.0075 ( 37.8%)   0.1452 ( 27.2%)   0.1455 ( 27.2%)  Called Value Propagation
             0.1264 ( 24.6%)   0.0006 (  3.0%)   0.1270 ( 23.8%)   0.1271 ( 23.7%)  Module Verifier
             0.5139 (100.0%)   0.0199 (100.0%)   0.5338 (100.0%)   0.5355 (100.0%)  Total
      
      Reviewers: davide, mssimpso
      
      Reviewed By: davide
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49108
      
      llvm-svn: 342398
      8a505c64
    • Alexandros Lamprineas's avatar
      [GVNHoist] Re-enable GVNHoist by default · 8a1c374b
      Alexandros Lamprineas authored
      Rebase rL341954 since https://bugs.llvm.org/show_bug.cgi?id=38912
      has been fixed by rL342055.
      
      Precommit testing performed:
      * Overnight runs of csmith comparing the output between programs
        compiled with gvn-hoist enabled/disabled.
      * Bootstrap builds of clang with UbSan/ASan configurations.
      
      llvm-svn: 342387
      8a1c374b
  22. Sep 14, 2018
    • Wei Mi's avatar
      [SampleFDO] Add FunctionOffsetTable in compact binary format profile. · 6a14325d
      Wei Mi authored
      The patch saves a function offset table which maps function name index to the
      offset of its function profile to the start of the binary profile. By using
      the function offset table, for those function profiles which will not be used
      when compiling a module, the profile reader does't have to read them. For
      profile size around 10~20M, it saves ~10% compile time.
      
      Differential Revision: https://reviews.llvm.org/D51863
      
      llvm-svn: 342283
      6a14325d
    • Sebastian Pop's avatar
      HotColdSplit: fix invalid SSA due to outlining · 0f30f08b
      Sebastian Pop authored
      The test used to fail with an invalid phi node: the two predecessors were outlined
      and the SSA representation was left invalid. The patch adds the exit block to the
      cold region.
      
      llvm-svn: 342277
      0f30f08b
    • Sebastian Pop's avatar
      HotColdSplit: fix isSingleEntrySingleExit · 3abcf690
      Sebastian Pop authored
      remove duplicate entries from isSingleEntrySingleExit: the Entry block is
      already added by the loop over the dominance frontier.
      
      Remove the heuristic from isOutlineCandidate that a region is too small when it
      only contains a basic block. With this change we now grow regions starting from
      a block and we continue adding to the ValidColdRegion. Check the heuristic just
      before code generation.
      
      llvm-svn: 342276
      3abcf690
    • Sebastian Pop's avatar
      HotColdSplit: add back propagation to extend cold regions · 1217160b
      Sebastian Pop authored
      Also fix a problem in forward propagation:
        const TerminatorInst *TI = It->getTerminator();
      was set outside the while loop that iterates over It.
      
      llvm-svn: 342275
      1217160b
  23. Sep 12, 2018
    • Alexandros Lamprineas's avatar
      Revert "[GVNHoist] Re-enable GVNHoist by default" · fe0512d5
      Alexandros Lamprineas authored
      This reverts rL341954.
      
      The builder `sanitizer-x86_64-linux-bootstrap-ubsan` has been
      failing with timeouts at stage2 clang/ubsan:
      
      [3065/3073] Linking CXX executable bin/lld
      command timed out: 1200 seconds without output running python
      ../sanitizer_buildbot/sanitizers/buildbot_selector.py,
      attempting to kill
      
      llvm-svn: 342001
      fe0512d5
  24. Sep 11, 2018
  25. Sep 10, 2018
  26. Sep 07, 2018
    • Aditya Kumar's avatar
      Hot cold splitting pass · 801394a3
      Aditya Kumar authored
      Find cold blocks based on profile information (or optionally with static analysis).
      Forward propagate profile information to all cold-blocks.
      Outline a cold region.
      Set calling conv and prof hint for the callsite of the outlined function.
      
      Worked in collaboration with: Sebastian Pop <s.pop@samsung.com>
      Differential Revision: https://reviews.llvm.org/D50658
      
      llvm-svn: 341669
      801394a3
Loading