Skip to content
  1. Jan 19, 2019
    • Chandler Carruth's avatar
      Update the file headers across all of the LLVM projects in the monorepo · 2946cd70
      Chandler Carruth authored
      to reflect the new license.
      
      We understand that people may be surprised that we're moving the header
      entirely to discuss the new license. We checked this carefully with the
      Foundation's lawyer and we believe this is the correct approach.
      
      Essentially, all code in the project is now made available by the LLVM
      project under our new license, so you will see that the license headers
      include that license only. Some of our contributors have contributed
      code under our old license, and accordingly, we have retained a copy of
      our old license notice in the top-level files in each project and
      repository.
      
      llvm-svn: 351636
      2946cd70
  2. Dec 07, 2018
    • Vedant Kumar's avatar
      [CodeExtractor] Store outputs at the first valid insertion point · b2a6f8e5
      Vedant Kumar authored
      When CodeExtractor outlines values which are used by the original
      function, it must store those values in some in-out parameter. This
      store instruction must not be inserted in between a PHI and an EH pad
      instruction, as that results in invalid IR.
      
      This fixes the following verifier failure seen while outlining within
      ObjC methods with live exit values:
      
        The unwind destination does not have an exception handling instruction!
          %call35 = invoke i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %exn.adjusted, i8* %1)
                  to label %invoke.cont34 unwind label %lpad33, !dbg !4183
        The unwind destination does not have an exception handling instruction!
          invoke void @objc_exception_throw(i8* %call35) #12
                  to label %invoke.cont36 unwind label %lpad33, !dbg !4184
        LandingPadInst not the first non-PHI instruction in the block.
          %3 = landingpad { i8*, i32 }
                  catch i8* null, !dbg !1411
      
      rdar://46540815
      
      llvm-svn: 348562
      b2a6f8e5
  3. Dec 03, 2018
    • Vedant Kumar's avatar
      [CodeExtractor] Split PHI nodes with incoming values from outlined region (PR39433) · d129569e
      Vedant Kumar authored
      If a PHI node out of extracted region has multiple incoming values from it,
      split this PHI on two parts. First PHI has incomings only from region and
      extracts with it (they are placed to the separate basic block that added to the
      list of outlined), and incoming values in original PHI are replaced by first
      PHI. Similar solution is already used in CodeExtractor for PHIs in entry block
      (severSplitPHINodes method). It covers PR39433 bug.
      
      Patch by Sergei Kachkov!
      
      Differential Revision: https://reviews.llvm.org/D55018
      
      llvm-svn: 348205
      d129569e
  4. Nov 19, 2018
  5. Nov 14, 2018
    • Florian Hahn's avatar
      [VPlan, SLP] Add simple SLP analysis on top of VPlan. · 09e516c5
      Florian Hahn authored
      This patch adds an initial implementation of the look-ahead SLP tree
      construction described in 'Look-Ahead SLP: Auto-vectorization in the Presence
      of Commutative Operations, CGO 2018 by Vasileios Porpodas, Rodrigo C. O. Rocha,
      Luís F. W. Góes'.
      
      It returns an SLP tree represented as VPInstructions, with combined
      instructions represented as a single, wider VPInstruction.
      
      This initial version does not support instructions with multiple
      different users (either inside or outside the SLP tree) or
      non-instruction operands; it won't generate any shuffles or
      insertelement instructions.
      
      It also just adds the analysis that builds an SLP tree rooted in a set
      of stores. It does not include any cost modeling or memory legality
      checks. The plan is to integrate it with VPlan based cost modeling, once
      available and to only apply it to operations that can be widened.
      
      A follow-up patch will add a support for replacing instructions in a
      VPlan with their SLP counter parts.
      
      Reviewers: Ayal, mssimpso, rengolin, mkuper, hfinkel, hsaito, dcaballe, vporpo, RKSimon, ABataev
      
      Reviewed By: rengolin
      
      Differential Revision: https://reviews.llvm.org/D4949
      
      llvm-svn: 346857
      09e516c5
  6. Nov 13, 2018
    • Florian Hahn's avatar
      [CSP, Cloning] Update DuplicateInstructionsInSplitBetween to use DomTreeUpdater. · 107d0a87
      Florian Hahn authored
      This patch updates DuplicateInstructionsInSplitBetween to update a DTU
      instead of applying updates to the DT directly.
      
      Given that there only are 2 users, also updated them in this patch to
      avoid churn.
      
      I slightly moved the code in CallSiteSplitting around to reduce the
      places where we have to pass in DTU. If necessary, I could split those
      changes in a separate patch.
      
      This fixes missing DT updates when dealing with musttail calls in
      CallSiteSplitting, by using DTU->deleteBB.
      
      Reviewers: junbuml, kuhar, NutshellySima, indutny, brzycki
      
      Reviewed By: NutshellySima
      
      llvm-svn: 346769
      107d0a87
  7. Oct 25, 2018
    • Vedant Kumar's avatar
      [HotColdSplitting] Identify larger cold regions using domtree queries · c2990068
      Vedant Kumar authored
      The current splitting algorithm works in three stages:
      
        1) Identify cold blocks, then
        2) Use forward/backward propagation to mark hot blocks, then
        3) Grow a SESE region of blocks *outside* of the set of hot blocks and
        start outlining.
      
      While testing this pass on Apple internal frameworks I noticed that some
      kinds of control flow (e.g. loops) are never outlined, even though they
      unconditionally lead to / follow cold blocks. I noticed two other issues
      related to how cold regions are identified:
      
        - An inconsistency can arise in the internal state of the hotness
        propagation stage, as a block may end up in both the ColdBlocks set
        and the HotBlocks set. Further inconsistencies can arise as these sets
        do not match what's in ProfileSummaryInfo.
      
        - It isn't necessary to limit outlining to single-exit regions.
      
      This patch teaches the splitting algorithm to identify maximal cold
      regions and outline them. A maximal cold region is defined as the set of
      blocks post-dominated by a cold sink block, or dominated by that sink
      block. This approach can successfully outline loops in the cold path. As
      a side benefit, it maintains less internal state than the current
      approach.
      
      Due to a limitation in CodeExtractor, blocks within the maximal cold
      region which aren't dominated by a single entry point (a so-called "max
      ancestor") are filtered out.
      
      Results:
        - X86 (LNT + -Os + externals): 134KB of TEXT were outlined compared to
        47KB pre-patch, or a ~3x improvement. Did not see a performance impact
        across two runs.
        - AArch64 (LNT + -Os + externals + Apple-internal benchmarks): 149KB
        of TEXT were outlined. Ditto re: performance impact.
        - Outlining results improve marginally in the internal frameworks I
        tested.
      
      Follow-ups:
        - Outline more than once per function, outline large single basic
        blocks, & try to remove unconditional branches in outlined functions.
      
      Differential Revision: https://reviews.llvm.org/D53627
      
      llvm-svn: 345209
      c2990068
  8. Sep 25, 2018
  9. Sep 20, 2018
    • Fedor Sergeev's avatar
      [New PM] Introducing PassInstrumentation framework · ee8d31c4
      Fedor Sergeev authored
      Pass Execution Instrumentation interface enables customizable instrumentation
      of pass execution, as per "RFC: Pass Execution Instrumentation interface"
      posted 06/07/2018 on llvm-dev@
      
      The intent is to provide a common machinery to implement all
      the pass-execution-debugging features like print-before/after,
      opt-bisect, time-passes etc.
      
      Here we get a basic implementation consisting of:
      * PassInstrumentationCallbacks class that handles registration of callbacks
        and access to them.
      
      * PassInstrumentation class that handles instrumentation-point interfaces
        that call into PassInstrumentationCallbacks.
      
      * Callbacks accept StringRef which is just a name of the Pass right now.
        There were some ideas to pass an opaque wrapper for the pointer to pass instance,
        however it appears that pointer does not actually identify the instance
        (adaptors and managers might have the same address with the pass they govern).
        Hence it was decided to go simple for now and then later decide on what the proper
        mental model of identifying a "pass in a phase of pipeline" is.
      
      * Callbacks accept llvm::Any serving as a wrapper for const IRUnit*, to remove direct dependencies
        on different IRUnits (e.g. Analyses).
      
      * PassInstrumentationAnalysis analysis is explicitly requested from PassManager through
        usual AnalysisManager::getResult. All pass managers were updated to run that
        to get PassInstrumentation object for instrumentation calls.
      
      * Using tuples/index_sequence getAnalysisResult helper to extract generic AnalysisManager's extra
        args out of a generic PassManager's extra args. This is the only way I was able to explicitly
        run getResult for PassInstrumentationAnalysis out of a generic code like PassManager::run or
        RepeatedPass::run.
        TODO: Upon lengthy discussions we agreed to accept this as an initial implementation
        and then get rid of getAnalysisResult by improving RepeatedPass implementation.
      
      * PassBuilder takes PassInstrumentationCallbacks object to pass it further into
        PassInstrumentationAnalysis. Callbacks registration should be performed directly
        through PassInstrumentationCallbacks.
      
      * new-pm tests updated to account for PassInstrumentationAnalysis being run
      
      * Added PassInstrumentation tests to PassBuilderCallbacks unit tests.
        Other unit tests updated with registration of the now-required PassInstrumentationAnalysis.
      
        Made getName helper to return std::string (instead of StringRef initially) to fix
        asan builtbot failures on CGSCC tests.
      
      Reviewers: chandlerc, philip.pfaffe
      Differential Revision: https://reviews.llvm.org/D47858
      
      llvm-svn: 342664
      ee8d31c4
    • Eric Christopher's avatar
      Temporarily Revert "[New PM] Introducing PassInstrumentation framework" · 01988937
      Eric Christopher authored
      as it was causing failures in the asan buildbot.
      
      This reverts commit r342597.
      
      llvm-svn: 342616
      01988937
    • Fedor Sergeev's avatar
      [New PM] Introducing PassInstrumentation framework · a5f279ea
      Fedor Sergeev authored
      Pass Execution Instrumentation interface enables customizable instrumentation
      of pass execution, as per "RFC: Pass Execution Instrumentation interface"
      posted 06/07/2018 on llvm-dev@
      
      The intent is to provide a common machinery to implement all
      the pass-execution-debugging features like print-before/after,
      opt-bisect, time-passes etc.
      
      Here we get a basic implementation consisting of:
      * PassInstrumentationCallbacks class that handles registration of callbacks
        and access to them.
      
      * PassInstrumentation class that handles instrumentation-point interfaces
        that call into PassInstrumentationCallbacks.
      
      * Callbacks accept StringRef which is just a name of the Pass right now.
        There were some ideas to pass an opaque wrapper for the pointer to pass instance,
        however it appears that pointer does not actually identify the instance
        (adaptors and managers might have the same address with the pass they govern).
        Hence it was decided to go simple for now and then later decide on what the proper
        mental model of identifying a "pass in a phase of pipeline" is.
      
      * Callbacks accept llvm::Any serving as a wrapper for const IRUnit*, to remove direct dependencies
        on different IRUnits (e.g. Analyses).
      
      * PassInstrumentationAnalysis analysis is explicitly requested from PassManager through
        usual AnalysisManager::getResult. All pass managers were updated to run that
        to get PassInstrumentation object for instrumentation calls.
      
      * Using tuples/index_sequence getAnalysisResult helper to extract generic AnalysisManager's extra
        args out of a generic PassManager's extra args. This is the only way I was able to explicitly
        run getResult for PassInstrumentationAnalysis out of a generic code like PassManager::run or
        RepeatedPass::run.
        TODO: Upon lengthy discussions we agreed to accept this as an initial implementation
        and then get rid of getAnalysisResult by improving RepeatedPass implementation.
      
      * PassBuilder takes PassInstrumentationCallbacks object to pass it further into
        PassInstrumentationAnalysis. Callbacks registration should be performed directly
        through PassInstrumentationCallbacks.
      
      * new-pm tests updated to account for PassInstrumentationAnalysis being run
      
      * Added PassInstrumentation tests to PassBuilderCallbacks unit tests.
        Other unit tests updated with registration of the now-required PassInstrumentationAnalysis.
      
      Reviewers: chandlerc, philip.pfaffe
      Differential Revision: https://reviews.llvm.org/D47858
      
      llvm-svn: 342597
      a5f279ea
  10. Sep 19, 2018
    • Fedor Sergeev's avatar
      Revert rL342544: [New PM] Introducing PassInstrumentation framework · 25de3f83
      Fedor Sergeev authored
      A bunch of bots fail to compile unittests. Reverting.
      
      llvm-svn: 342552
      25de3f83
    • Fedor Sergeev's avatar
      [New PM] Introducing PassInstrumentation framework · 875c938f
      Fedor Sergeev authored
      Summary:
      Pass Execution Instrumentation interface enables customizable instrumentation
      of pass execution, as per "RFC: Pass Execution Instrumentation interface"
      posted 06/07/2018 on llvm-dev@
      
      The intent is to provide a common machinery to implement all
      the pass-execution-debugging features like print-before/after,
      opt-bisect, time-passes etc.
      
      Here we get a basic implementation consisting of:
      * PassInstrumentationCallbacks class that handles registration of callbacks
        and access to them.
      
      * PassInstrumentation class that handles instrumentation-point interfaces
        that call into PassInstrumentationCallbacks.
      
      * Callbacks accept StringRef which is just a name of the Pass right now.
        There were some ideas to pass an opaque wrapper for the pointer to pass instance,
        however it appears that pointer does not actually identify the instance
        (adaptors and managers might have the same address with the pass they govern).
        Hence it was decided to go simple for now and then later decide on what the proper
        mental model of identifying a "pass in a phase of pipeline" is.
      
      * Callbacks accept llvm::Any serving as a wrapper for const IRUnit*, to remove direct dependencies
        on different IRUnits (e.g. Analyses).
      
      * PassInstrumentationAnalysis analysis is explicitly requested from PassManager through
        usual AnalysisManager::getResult. All pass managers were updated to run that
        to get PassInstrumentation object for instrumentation calls.
      
      * Using tuples/index_sequence getAnalysisResult helper to extract generic AnalysisManager's extra
        args out of a generic PassManager's extra args. This is the only way I was able to explicitly
        run getResult for PassInstrumentationAnalysis out of a generic code like PassManager::run or
        RepeatedPass::run.
        TODO: Upon lengthy discussions we agreed to accept this as an initial implementation
        and then get rid of getAnalysisResult by improving RepeatedPass implementation.
      
      * PassBuilder takes PassInstrumentationCallbacks object to pass it further into
        PassInstrumentationAnalysis. Callbacks registration should be performed directly
        through PassInstrumentationCallbacks.
      
      * new-pm tests updated to account for PassInstrumentationAnalysis being run
      
      * Added PassInstrumentation tests to PassBuilderCallbacks unit tests.
        Other unit tests updated with registration of the now-required PassInstrumentationAnalysis.
      
      Reviewers: chandlerc, philip.pfaffe
      Differential Revision: https://reviews.llvm.org/D47858
      
      llvm-svn: 342544
      875c938f
  11. Sep 16, 2018
  12. Sep 03, 2018
  13. Aug 30, 2018
  14. Aug 26, 2018
    • Chandler Carruth's avatar
      [IR] Replace `isa<TerminatorInst>` with `isTerminator()`. · 9ae926b9
      Chandler Carruth authored
      This is a bit awkward in a handful of places where we didn't even have
      an instruction and now we have to see if we can build one. But on the
      whole, this seems like a win and at worst a reasonable cost for removing
      `TerminatorInst`.
      
      All of this is part of the removal of `TerminatorInst` from the
      `Instruction` type hierarchy.
      
      llvm-svn: 340701
      9ae926b9
  15. Aug 07, 2018
  16. Aug 06, 2018
    • Hsiangkai Wang's avatar
      [DebugInfo] Refactor DbgInfoIntrinsic class hierarchy. · ef72e481
      Hsiangkai Wang authored
      In the past, DbgInfoIntrinsic has a strong assumption that these
      intrinsics all have variables and expressions attached to them.
      However, it is too strong to derive the class for other debug entities.
      Now, it has problems for debug labels.
      
      In order to make DbgInfoIntrinsic as a base class for 'debug info', I
      create a class for 'variable debug info', DbgVariableIntrinsic.
      
      DbgDeclareInst, DbgAddrIntrinsic, and DbgValueInst will be derived from it.
      
      Differential Revision: https://reviews.llvm.org/D50220
      
      llvm-svn: 338984
      ef72e481
  17. Aug 03, 2018
    • Chijun Sima's avatar
      [Dominators] Make RemoveUnreachableBlocks return false if the BasicBlock is... · 53048437
      Chijun Sima authored
      [Dominators] Make RemoveUnreachableBlocks return false if the BasicBlock is already awaiting deletion
      
      Summary:
      Previously, `removeUnreachableBlocks` still returns true (which indicates the CFG is changed) even when all the unreachable blocks found is awaiting deletion in the DDT class.
      This makes code pattern like
      ```
      // Code modified from lib/Transforms/Scalar/SimplifyCFGPass.cpp 
      bool EverChanged = removeUnreachableBlocks(F, nullptr, DDT);
      ...
      do {
          EverChanged = someMightHappenModifications();
          EverChanged |= removeUnreachableBlocks(F, nullptr, DDT);
        } while (EverChanged);
      ```
      become a dead loop.
      Fix this by detecting whether a BasicBlock is already awaiting deletion.
      
      Reviewers: kuhar, brzycki, dmgreen, grosser, davide
      
      Reviewed By: kuhar, brzycki
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49738
      
      llvm-svn: 338882
      53048437
    • Chijun Sima's avatar
      [Dominators] Convert existing passes and utils to use the DomTreeUpdater class · 21a8b605
      Chijun Sima authored
      Summary:
      This patch is the second in a series of patches related to the [[ http://lists.llvm.org/pipermail/llvm-dev/2018-June/123883.html | RFC - A new dominator tree updater for LLVM ]].
      
      It converts passes (e.g. adce/jump-threading) and various functions which currently accept DDT in local.cpp and BasicBlockUtils.cpp to use the new DomTreeUpdater class.
      These converted functions in utils can accept DomTreeUpdater with either UpdateStrategy and can deal with both DT and PDT held by the DomTreeUpdater.
      
      Reviewers: brzycki, kuhar, dmgreen, grosser, davide
      
      Reviewed By: brzycki
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D48967
      
      llvm-svn: 338814
      21a8b605
  18. Jul 31, 2018
    • Diego Caballero's avatar
      [VPlan] Introduce VPLoopInfo analysis. · 3587150f
      Diego Caballero authored
      The patch introduces loop analysis (VPLoopInfo/VPLoop) for VPBlockBases.
      This analysis will be necessary to perform some H-CFG transformations and
      detect and introduce regions representing a loop in the H-CFG.
      
      Reviewers: fhahn, rengolin, mkuper, hfinkel, mssimpso
      
      Reviewed By: fhahn 
      
      Differential Revision: https://reviews.llvm.org/D48816
      
      llvm-svn: 338346
      3587150f
  19. Jul 30, 2018
    • Diego Caballero's avatar
      [VPlan] Introduce VPlan-based dominator analysis. · 2a34ac86
      Diego Caballero authored
      The patch introduces dominator analysis for VPBlockBases and extend
      VPlan's GraphTraits specialization with the required interfaces. Dominator
      analysis will be necessary to perform some H-CFG transformations and
      to introduce VPLoopInfo (LoopInfo analysis on top of the VPlan representation).
      
      Reviewers: fhahn, rengolin, mkuper, hfinkel, mssimpso
      
      Reviewed By: fhahn
      
      Differential Revision: https://reviews.llvm.org/D48815
      
      llvm-svn: 338310
      2a34ac86
  20. Jul 11, 2018
  21. Jul 10, 2018
    • Evgeniy Stepanov's avatar
      Revert r336653 "[VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests." · 3306a498
      Evgeniy Stepanov authored
      Memory leaks in tests.
      http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/6289/steps/check-llvm%20asan/logs/stdio
      
      Direct leak of 192 byte(s) in 1 object(s) allocated from:
          #0 0x554ea8 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:106
          #1 0x56cef1 in llvm::VPlanTestBase::doAnalysis(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h:53:14
          #2 0x56bec4 in llvm::VPlanTestBase::buildHCFG(llvm::BasicBlock*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h:57:3
          #3 0x571f1e in llvm::(anonymous namespace)::VPlanHCFGTest_testVPInstructionToVPRecipesInner_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp:119:15
          #4 0xed2291 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
          #5 0xed44c8 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
          #6 0xed5890 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
          #7 0xef3634 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
          #8 0xef27e0 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
          #9 0xebbc23 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
          #10 0xebbc23 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:51
          #11 0x7f65569592e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
      
      and more.
      
      llvm-svn: 336718
      3306a498
    • Florian Hahn's avatar
      [VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests. · 8263975c
      Florian Hahn authored
      Reviewers: dcaballe, hsaito, rengolin
      
      Reviewed By: dcaballe
      
      Differential Revision: https://reviews.llvm.org/D49032
      
      llvm-svn: 336653
      8263975c
  22. Jul 09, 2018
    • Diego Caballero's avatar
      [VPlan][LV] Introduce condition bit in VPBlockBase · d0953014
      Diego Caballero authored
      This patch introduces a VPValue in VPBlockBase to represent the condition
      bit that is used as successor selector when a block has multiple successors.
      This information wasn't necessary until now, when we are about to introduce
      outer loop vectorization support in VPlan code gen.
      
      Reviewers: fhahn, rengolin, mkuper, hfinkel, mssimpso
      
      Reviewed By: fhahn
      
      Differential Revision: https://reviews.llvm.org/D48814
      
      llvm-svn: 336554
      d0953014
  23. Jul 06, 2018
    • Vedant Kumar's avatar
      [Local] replaceAllDbgUsesWith: Update debug values before RAUW · 6379a622
      Vedant Kumar authored
      The replaceAllDbgUsesWith utility helps passes preserve debug info when
      replacing one value with another.
      
      This improves upon the existing insertReplacementDbgValues API by:
      
      - Updating debug intrinsics in-place, while preventing use-before-def of
        the replacement value.
      - Falling back to salvageDebugInfo when a replacement can't be made.
      - Moving the responsibiliy for rewriting llvm.dbg.* DIExpressions into
        common utility code.
      
      Along with the API change, this teaches replaceAllDbgUsesWith how to
      create DIExpressions for three basic integer and pointer conversions:
      
      - The no-op conversion. Applies when the values have the same width, or
        have bit-for-bit compatible pointer representations.
      - Truncation. Applies when the new value is wider than the old one.
      - Zero/sign extension. Applies when the new value is narrower than the
        old one.
      
      Testing:
      
      - check-llvm, check-clang, a stage2 `-g -O3` build of clang,
        regression/unit testing.
      - This resolves a number of mis-sized dbg.value diagnostics from
        Debugify.
      
      Differential Revision: https://reviews.llvm.org/D48676
      
      llvm-svn: 336451
      6379a622
  24. Jun 19, 2018
  25. Jun 18, 2018
  26. Jun 04, 2018
    • David Blaikie's avatar
      Move Analysis/Utils/Local.h back to Transforms · 31b98d2e
      David Blaikie authored
      Review feedback from r328165. Split out just the one function from the
      file that's used by Analysis. (As chandlerc pointed out, the original
      change only moved the header and not the implementation anyway - which
      was fine for the one function that was used (since it's a
      template/inlined in the header) but not in general)
      
      llvm-svn: 333954
      31b98d2e
  27. May 09, 2018
    • Shiva Chen's avatar
      [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. · 2c864551
      Shiva Chen authored
      In order to set breakpoints on labels and list source code around
      labels, we need collect debug information for labels, i.e., label
      name, the function label belong, line number in the file, and the
      address label located. In order to keep these information in LLVM
      IR and to allow backend to generate debug information correctly.
      We create a new kind of metadata for labels, DILabel. The format
      of DILabel is
      
      !DILabel(scope: !1, name: "foo", file: !2, line: 3)
      
      We hope to keep debug information as much as possible even the
      code is optimized. So, we create a new kind of intrinsic for label
      metadata to avoid the metadata is eliminated with basic block.
      The intrinsic will keep existing if we keep it from optimized out.
      The format of the intrinsic is
      
      llvm.dbg.label(metadata !1)
      
      It has only one argument, that is the DILabel metadata. The
      intrinsic will follow the label immediately. Backend could get the
      label metadata through the intrinsic's parameter.
      
      We also create DIBuilder API for labels to be used by Frontend.
      Frontend could use createLabel() to allocate DILabel objects, and use
      insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.
      
      Differential Revision: https://reviews.llvm.org/D45024
      
      Patch by Hsiangkai Wang.
      
      llvm-svn: 331841
      2c864551
  28. Apr 20, 2018
    • Michael Zolotukhin's avatar
      Revert "Revert r330403 and r330413." · a2c9af02
      Michael Zolotukhin authored
      Reapply the patches with a fix. Thanks Ilya and Hans for the reproducer!
      This reverts commit r330416.
      
      The issue was that removing predecessors invalidated uses that we stored
      for rewrite. The fix is to finish manipulating with CFG before we select
      uses for rewrite.
      
      llvm-svn: 330431
      a2c9af02
    • Ilya Biryukov's avatar
      Revert r330403 and r330413. · afe822bd
      Ilya Biryukov authored
      Revert r330413: "[SSAUpdaterBulk] Use SmallVector instead of DenseMap for storing rewrites."
      Revert r330403 "Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time."
      
      r330403 commit seems to crash clang during our integrate while doing PGO build with the following stacktrace:
            #2 llvm::SSAUpdaterBulk::RewriteAllUses(llvm::DominatorTree*, llvm::SmallVectorImpl<llvm::PHINode*>*)
            #3 llvm::JumpThreadingPass::ThreadEdge(llvm::BasicBlock*, llvm::SmallVectorImpl<llvm::BasicBlock*> const&, llvm::BasicBlock*)
            #4 llvm::JumpThreadingPass::ProcessThreadableEdges(llvm::Value*, llvm::BasicBlock*, llvm::jumpthreading::ConstantPreference, llvm::Instruction*)
            #5 llvm::JumpThreadingPass::ProcessBlock(llvm::BasicBlock*)
      The crash happens while compiling 'lib/Analysis/CallGraph.cpp'.
      
      r3340413 is reverted due to conflicting changes.
      
      llvm-svn: 330416
      afe822bd
    • Michael Zolotukhin's avatar
      9dea0793
  29. Apr 10, 2018
    • Michael Zolotukhin's avatar
      [PR16756] Add SSAUpdaterBulk. · 52b064f3
      Michael Zolotukhin authored
      Summary:
      SSAUpdater is a bottleneck in a number of passes, and one of the reasons
      is that it performs a lot of unnecessary computations (DT/IDF) over and
      over again. This patch adds a new SSAUpdaterBulk that uses existing DT
      and avoids recomputing IDF when possible.
      
      Reviewers: dberlin, davide, MatzeB
      
      Subscribers: llvm-commits, hiraditya
      
      Differential Revision: https://reviews.llvm.org/D44282
      
      llvm-svn: 329643
      52b064f3
Loading