1. Jul 15, 2022
  2. Jul 14, 2022
    • Philip Reames's avatar
      [SCEVExpander] Allow udiv with isKnownNonZero(RHS) + add vscale case · 3bc09c7d
      Philip Reames authored
      Motivation here is to unblock LSRs ability to use ICmpZero uses - the major effect of which is to enable count down IVs. The test changes reflect this goal, but the potential impact is much broader since this isn't a change in LSR at all.
      
      SCEVExpander needs(*) to prove that expanding the expression is safe anywhere the SCEV expression is valid. In general, we can't expand any node which might fault (or exhibit UB) unless we can either a) prove it won't fault, or b) guard the faulting case. We'd been allowing non-zero constants here; this change extends it to non-zero values.
      
      vscale is never zero. This is already implemented in ValueTracking, and this change just adds the same logic in SCEV's range computation (which in turn drives isKnownNonZero). We should common up some logic here, but let's do that in separate changes.
      
      (*) As an aside, "needs" is such an interesting word here. First, we don't actually need to guard this at all; we could choose to emit a select for the RHS of ever udiv and remove this code entirely. Secondly, the property being checked here is way too strong. What the client actually needs is to expand the SCEV at some particular point in some particular loop. In the examples, the original urem dominates that loop and yet we completely ignore that information when analyzing legality. I don't plan to actively pursue either direction, just noting it for future reference.
      
      Differential Revision: https://reviews.llvm.org/D129710
      3bc09c7d
    • Dmitry Vyukov's avatar
      tsan: fix a bug in trace part switching · ab02680b
      Dmitry Vyukov authored
      Callers of TraceSwitchPart expect that TraceAcquire will always succeed
      after the call. It's possible that TryTraceFunc/TraceMutexLock in TraceSwitchPart
      that restore the current stack/mutexset filled the trace part exactly up
      to the TracePart::kAlignment gap and the next TraceAcquire won't succeed.
      Skip the alignment gap after writing initial stack/mutexset to avoid that.
      
      Reviewed By: melver
      
      Differential Revision: https://reviews.llvm.org/D129777
      ab02680b
    • Brendon Cahoon's avatar
      Revert "[UnifyLoopExits] Reduce number of guard blocks" · 58fec782
      Brendon Cahoon authored
      This reverts commit e13248ab.
      
      Need to revert because the transformation cannot occur for basic
      blocks that contain convergent instructions.
      58fec782
    • Dawid Jurczak's avatar
      d71128d9
    • Warren Ristow's avatar
      [Reassociate] Cleanup minor missed optimizations · 230c8c56
      Warren Ristow authored
      In analyzing issue #56483, it was noticed that running `opt` with
      `-reassociate` was missing some minor optimizations. For example,
      there were cases where the running `opt` on IR with floating-point
      instructions that have the `fast` flags applied, sometimes resulted in
      less efficient code than the input IR (things like dead instructions
      left behind, and missed reassociations). These were sometimes noted
      in the test-files with TODOs, to investigate further. This commit
      fixes some of these problems, removing some TODOs in the process.
      
      FTR, I refer to these as "minor" missed optimizations, because when
      running a full clang/llvm compilation, these inefficiencies are not
      happening, as other passes clean that residue up. Regardless, having
      cleaner IR produced by `opt`, makes assessing the quality of fixes done
      in `opt` easier.
      230c8c56
    • Andy Yankovsky's avatar
      [lldb] Add support for using integral const static data members in the expression evaluator · 48678721
      Andy Yankovsky authored
      This adds support for using const static integral data members as described by C++11 [class.static.data]p3
      to LLDB's expression evaluator.
      
      So far LLDB treated these data members are normal static variables. They already work as intended when they are declared in the class definition and then defined in a namespace scope. However, if they are declared and initialised in the class definition but never defined in a namespace scope, all LLDB expressions that use them will fail to link when LLDB can't find the respective symbol for the variable.
      
      The reason for this is that the data members which are only declared in the class are not emitted into any object file so LLDB can never resolve them. Expressions that use these variables are expected to directly use their constant value if possible. Clang can do this for us during codegen, but it requires that we add the constant value to the VarDecl we generate for these dat...
      48678721
    • Nikolas Klauser's avatar
      [libc++] Test the size of basic_string · 2619ce8b
      Nikolas Klauser authored
      Reviewed By: ldionne, #libc
      
      Spies: hubert.reinterpretcast, arichardson, mstorsjo, libcxx-commits
      
      Differential Revision: https://reviews.llvm.org/D127672
      2619ce8b
    • Nikita Popov's avatar
      159feac1
    • Brendon Cahoon's avatar
      Revert "[StructurizeCFG] Improve basic block ordering" · c945d88d
      Brendon Cahoon authored
      This reverts commit f1b05a0a.
      
      Need to revert to due to issues identified with testing. The
      transformation is incorrect for blocks that contain convergent
      instructions.
      c945d88d
    • Thomas Raoux's avatar
      [mlir][vector] Support distribution of vector.reduce with accumulator · ffa7384f
      Thomas Raoux authored
      Right now the pattern was ignoring the optional accumulator.
      
      Differential Revision: https://reviews.llvm.org/D129719
      ffa7384f