Skip to content
  1. May 13, 2020
    • Pierre-vh's avatar
      [LSR][ARM] Add new TTI hook to mark some LSR chains as profitable · 2668775f
      Pierre-vh authored
      This patch adds a new TTI hook to allow targets to tell LSR that
      a chain including some instruction is already profitable and
      should not be optimized. This patch also adds an implementation
      of this TTI hook for ARM so LSR doesn't optimize chains that include
      the VCTP intrinsic.
      
      Differential Revision: https://reviews.llvm.org/D79418
      2668775f
    • Sjoerd Meijer's avatar
      Recommit #2: "[LV] Induction Variable does not remain scalar under tail-folding." · 9529597c
      Sjoerd Meijer authored
      This was reverted because of a miscompilation. At closer inspection, the
      problem was actually visible in a changed llvm regression test too. This
      one-line follow up fix/recommit will splat the IV, which is what we are trying
      to avoid if unnecessary in general, if tail-folding is requested even if all
      users are scalar instructions after vectorisation. Because with tail-folding,
      the splat IV will be used by the predicate of the masked loads/stores
      instructions. The previous version omitted this, which caused the
      miscompilation. The original commit message was:
      
      If tail-folding of the scalar remainder loop is applied, the primary induction
      variable is splat to a vector and used by the masked load/store vector
      instructions, thus the IV does not remain scalar. Because we now mark
      that the IV does not remain scalar for these cases, we don't emit the vector IV
      if it is not used. Thus, the vectoriser produces less dead code.
      
      Thanks to Ayal Zaks for the direction how to fix this.
      9529597c
    • Ehud Katz's avatar
      [StructurizeCFG] Fix region nodes ordering · 897d8ee5
      Ehud Katz authored
      This is a reimplementation of the `orderNodes` function, as the old
      implementation didn't take into account all cases.
      
      Fix PR41509
      
      Differential Revision: https://reviews.llvm.org/D79037
      897d8ee5
    • Yevgeny Rouban's avatar
      [BrachProbablityInfo] Set edge probabilities at once. NFC. · eef95f27
      Yevgeny Rouban authored
      Hide the method that allows setting probability for particular
      edge and introduce a public method that sets probabilities for
      all outgoing edges at once.
      Setting individual edge probability is error prone. More over
      it is difficult to check that the total probability is 1.0
      because there is no easy way to know when the user finished
      setting all the probabilities.
      
      Reviewers: yamauchi, ebrevnov
      Tags: #llvm
      Differential Revision: https://reviews.llvm.org/D79396
      eef95f27
    • KAWASHIMA Takahiro's avatar
      [LoopReroll] Fix rerolling loop with use outside the loop · 272bc25b
      KAWASHIMA Takahiro authored
      Fixes PR41696
      
      The loop-reroll pass generates an invalid IR (or its assertion
      fails in debug build) if values of the base instruction and
      other root instructions (terms used in the loop-reroll pass)
      are used outside the loop block. See IRs written in PR41696
      as examples.
      
      The current implementation of the loop-reroll pass can reroll
      only loops that don't have values that are used outside the
      loop, except reduced values (the last values of reduction chains).
      This is described in the comment of the `LoopReroll::reroll`
      function.
      https://github.com/llvm/llvm-project/blob/llvmorg-10.0.0/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp#L1600
      
      This is checked in the `LoopReroll::DAGRootTracker::validate`
      function.
      https://github.com/llvm/llvm-project/blob/llvmorg-10.0.0/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp#L1393
      
      However, the base instruction and other root instructions skip
      this check in the validation loop.
      https://github.com/llvm/llvm-project/blob/llvmorg-10.0.0/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp#L1229
      
      Moving the check in front of the skip is the logically simplest
      fix. However, inserting the check in an earlier stage is better
      in terms of compilation time of unrerollable loops. This fix
      inserts the check for the base instruction into the function
      to validate possible base/root instructions. Check for other
      root instructions is unnecessary because they don't match any
      base instructions if they have uses outside the loop.
      
      Differential Revision: https://reviews.llvm.org/D79549
      272bc25b
    • Johannes Doerfert's avatar
      [Attributor][FIX] Stabilize the state of AAReturnedValues each update · af48351c
      Johannes Doerfert authored
      For AAReturnedValues we treated new and existing information differently
      in the updateImpl. Only the latter was properly analyzed and
      categorized. The former was thought to be analyzed in the subsequent
      update. Since the Attributor does not support "self-updates" we need to
      make sure the state is "stable" after each updateImpl invocation. That
      is, if the surrounding information does not change, the state is valid.
      Now we make sure all return values have been handled and properly
      categorized each iteration. We might not update again if we have not
      requested a non-fix attribute so we cannot "wait" for the next update to
      analyze a new return value.
      
      Bug reported by @sdmitriev.
      af48351c
    • Zequan Wu's avatar
      Add nomerge function attribute to supress tail merge optimization in simplifyCFG · cb22ab74
      Zequan Wu authored
      We want to add a way to avoid merging identical calls so as to keep the
      separate debug-information for those calls. There is also an asan
      usecase where having this attribute would be beneficial to avoid
      alternative work-arounds.
      
      Here is the link to the feature request:
      https://bugs.llvm.org/show_bug.cgi?id=42783.
      
      `nomerge` is different from `noline`. `noinline` prevents function from
      inlining at callsites, but `nomerge` prevents multiple identical calls
      from being merged into one.
      
      This patch adds `nomerge` to disable the optimization in IR level. A
      followup patch will be needed to let backend understands `nomerge` and
      avoid tail merge at backend.
      
      Reviewed By: asbirlea, rnk
      
      Differential Revision: https://reviews.llvm.org/D78659
      cb22ab74
  2. May 12, 2020
  3. May 11, 2020
    • Johannes Doerfert's avatar
      [Attributor][FIX] Disallow function signature rewrite for casted calls · 8d94d3c3
      Johannes Doerfert authored
      We will now ensure ensure the return type of called function is the type
      of all call sites we are going to rewrite. This avoids a problem
      partially fixed by D79680. The part that was not covered is a use of
      this "weird" casted call site (see `@func3` in `misc_crash.ll`).
      
      misc_crash.ll checks are auto-generated now.
      8d94d3c3
    • Johannes Doerfert's avatar
      [Attributor] Make AAIsDead dependences optional to prevent top state · c115a78f
      Johannes Doerfert authored
      We should never give up on AAIsDead as it guards other AAs from
      unreachable code (in which SSA properties are meaningless). We did
      however use required dependences on some queries in AAIsDead which
      caused us to invalidate AAIsDead if the queried AA got invalidated.
      We now use optional dependences instead. The bug that exposed this is
      added to the liveness.ll test and other test changes show the impact.
      
      Bug report by @sdmitriev.
      c115a78f
    • Johannes Doerfert's avatar
      [Attributor] Force update of "newly live" abstract attributes · c86fd333
      Johannes Doerfert authored
      During an update of AAIsDead, new instructions become live. If we query
      information from them, the result is often just the initial state, e.g.,
      for call site `noreturn` and `nounwind`. We will now trigger an update
      for cached attributes during the AAIsDead update, though other AAs might
      later use the same API.
      c86fd333
    • Sanjay Patel's avatar
      [VectorCombine] account for extra uses in scalarization cost · 5f730b64
      Sanjay Patel authored
      Follow-up to D79452.
      Mimics the extra use cost formula for the inverse transform with extracts.
      5f730b64
    • Mircea Trofin's avatar
      [llvm][NFC] Move inlining decision-related APIs in InliningAdvisor. · 48fa355e
      Mircea Trofin authored
      Summary: Factoring out in preparation to https://reviews.llvm.org/D79042
      
      Reviewers: dblaikie, davidxl
      
      Subscribers: mgorny, eraman, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79613
      48fa355e
    • Sergey Dmitriev's avatar
      [Attributor] Fix for a crash on RAUW when rewriting function signature · 3df40007
      Sergey Dmitriev authored
      Reviewers: jdoerfert, sstefan1, uenoku
      
      Reviewed By: uenoku
      
      Subscribers: hiraditya, uenoku, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79680
      3df40007
    • Tyker's avatar
      [AssumeBundles] fix crashes · 78d85c20
      Tyker authored
      Summary:
      this patch fixe crash/asserts found in the test-suite.
      the AssumeptionCache cannot be assumed to have all assumes contrary to what i tought.
      prevent generation of information for terminators, because this can create broken IR in transfromation where we insert the new terminator before removing the old one.
      
      Reviewers: jdoerfert
      
      Reviewed By: jdoerfert
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79458
      78d85c20
    • OCHyams's avatar
      [NFC][DwarfDebug] Add test for variables with a single location which · da100de0
      OCHyams authored
      don't span their entire scope.
      
      The previous commit (6d1c40c1) is an older version of the test.
      
      Reviewed By: aprantl, vsk
      
      Differential Revision: https://reviews.llvm.org/D79573
      da100de0
    • Xun Li's avatar
      Remove an unused Module param · 44e5aaf9
      Xun Li authored
      Summary:
      In D65848 the function getFuncNameInModule was refactored to no longer use module.
      This diff removes the parameter and rename the function name to avoid confusion.
      
      Reviewers: wenlei, wmi, davidxl
      
      Reviewed By: wenlei
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79310
      44e5aaf9
    • Johannes Doerfert's avatar
      [Attributor] Merge the query set into AbstractAttribute · 3a8740bd
      Johannes Doerfert authored
      The old QuerriedAAs contained two vectors, one for required one for
      optional dependences (=queries). We now use a single vector and encode
      the kind directly in the pointer.
      
      This reduces memory consumption and makes the connection between
      abstract attributes and their dependences clearer.
      
      No functional change is intended, changes in the test are due to
      different order in the query map. Neither the order before nor now is in
      any way special.
      
      ---
      
      Single run of the Attributor module and then CGSCC pass (oldPM)
      for SPASS/clause.c (~10k LLVM-IR loc):
      
      Before:
      ```
      calls to allocation functions: 543734 (329735/s)
      temporary memory allocations: 105895 (64217/s)
      peak heap memory consumption: 19.19MB
      peak RSS (including heaptrack overhead): 102.26MB
      total memory leaked: 269.10KB
      ```
      
      After:
      ```
      calls to allocation functions: 513292 (341511/s)
      temporary memory allocations: 106028 (70544/s)
      peak heap memory consumption: 13.35MB
      peak RSS (including heaptrack overhead): 95.64MB
      total memory leaked: 269.10KB
      ```
      
      Difference:
      ```
      calls to allocation functions: -30442 (208506/s)
      temporary memory allocations: 133 (-910/s)
      peak heap memory consumption: -5.84MB
      peak RSS (including heaptrack overhead): 0B
      total memory leaked: 0B
      ```
      
      ---
      
      Reviewed By: uenoku
      
      Differential Revision: https://reviews.llvm.org/D78729
      3a8740bd
    • Johannes Doerfert's avatar
      [Attributor][FIX] Carefully handle/ignore/forget `argmemonly` · 5e06b251
      Johannes Doerfert authored
      When we have an existing `argmemonly` or `inaccessiblememorargmemonly`
      we used to "know" that information. However, interprocedural constant
      propagation can invalidate these attributes. We now ignore and remove
      these attributes for internal functions (which may be affected by IP
      constant propagation), if we are deriving new attributes for the
      function.
      5e06b251
    • Johannes Doerfert's avatar
      [Attributor] Use "simplify to constant" in genericValueTraversal · 713ee3aa
      Johannes Doerfert authored
      As we replace values with constants interprocedurally, we also need to
      do this "look-through" step during the generic value traversal or we
      would derive properties from replaced values. While this is often not
      problematic, it is when we use the "kind" of a value for reasoning,
      e.g., accesses to arguments allow `argmemonly`.
      713ee3aa
    • Johannes Doerfert's avatar
      [Attributor] Ignore illegal accesses to `null` · 513ac6e9
      Johannes Doerfert authored
      When we categorize a pointer value we bailed at `null` before. If we
      know `null` is not a valid memory location we can ignore it as there
      won't be an access at all.
      513ac6e9
    • Johannes Doerfert's avatar
      [Attributor] Use existing helpers to determine IR facts · 31c03b92
      Johannes Doerfert authored
      We now use getPointerDereferenceableBytes to determine `nonnull` and
      `dereferenceable` facts from the IR. We also use getPointerAlignment in
      AAAlign for the same reason. The latter can interfere with callbacks so
      we do restrict it to non-function-pointers for now.
      31c03b92
    • Johannes Doerfert's avatar
      a9ee8b49
    • Fangrui Song's avatar
      [gcov] Default coverage version to '407*' and delete CC1 option -coverage-cfg-checksum · 25544ce2
      Fangrui Song authored
      Defaulting to -Xclang -coverage-version='407*' makes .gcno/.gcda
      compatible with gcov [4.7,8)
      
      In addition, delete clang::CodeGenOptionsBase::CoverageExtraChecksum and GCOVOptions::UseCfgChecksum.
      We can infer the information from the version.
      
      With this change, .gcda files produced by `clang --coverage a.o` linked executable can be read by gcov 4.7~7.
      We don't need other -Xclang -coverage* options.
      There may be a mismatching version warning, though.
      
      (Note, GCC r173147 "split checksum into cfg checksum and line checksum"
       made gcov 4.7 incompatible with previous versions.)
      25544ce2
  4. May 10, 2020
  5. May 09, 2020
Loading