1. Dec 09, 2022
    • Roman Lebedev's avatar
      [SROA] For non-speculatable `load`s of `select`s -- split block, insert... · 4f7e5d22
      Roman Lebedev authored
      [SROA] For non-speculatable `load`s of `select`s -- split block, insert then/else blocks, form two-entry PHI node, take 2
      
      Currently, SROA is CFG-preserving.
      Not doing so does not affect any pipeline test. (???)
      Internally, SROA requires Dominator Tree, and uses it solely for the final `-mem2reg` call.
      
      By design, we can't really SROA alloca if their address escapes somehow,
      but we have logic to deal with `load` of `select`/`PHI`,
      where at least one of the possible addresses prevents promotion,
      by speculating the `load`s and `select`ing between loaded values.
      
      As one would expect, that requires ensuring that the speculation is actually legal.
      Even ignoring complexity bailouts, that logic does not deal with everything,
      e.g. `isSafeToLoadUnconditionally()` does not recurse into hands of `select`.
      There can also be cases where the load is genuinely non-speculate.
      
      So if we can't prove that the load can be speculated,
      unfold the select, produce two-entry phi node, and perform predicated load.
      
      Now, that transformation must obviously update Dominator Tree,
      since we require it later on. Doing so is trivial.
      Additionally, we don't want to do this for the final SROA invocation (D136806).
      
      In the end, this ends up having negative (!) compile-time cost:
      https://llvm-compile-time-tracker.com/compare.php?from=c6d7e80ec4c17a415673b1cfd25924f98ac83608&to=ddf9600365093ea50d7e278696cbfa01641c959d&stat=instructions:u
      
      Though indeed, this only deals with `select`s, `PHI`s are still using speculation.
      
      Should we update some more analysis?
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D138238
      
      This reverts commit 73961187,
      and recommits 03e6d9d9
      with a fixed assertion - we should check that DTU is there,
      not just assert false...
      4f7e5d22
    • Michael Buch's avatar
      [lldb][Test] TestRerunAndExpr.py: explicitly delete a.out before rebuilding it · ad3870d6
      Michael Buch authored
      **Summary**
      
      Older versions of `make` would occasionally fail to realize
      that a pre-requisite for the `a.out` target has changed. This
      resulted in roughly 1 out of 10 test runs to fail. Instead of
      relying on `make` to resolve this dependency simply remove the
      file before rebuilding; this will give make no option but to
      remake `a.out`.
      
      **Testing**
      
      * Confirmed that the test passes on the host for 100 runs where
        without the patch it would fail after ~10
      
      **Details**
      
      Adding `-d` to lldbtest's `make` invocation and running the
      test without this patch sometimes yielded:
      ```
      Removing child 0x600000308ff0 PID 19915 from chain.
          Successfully remade target file `rebuild.o'.
         Finished prerequisites of target file `a.out'.
         Prerequisite `rebuild.o' is newer than target `a.out'.
        No need to remake target `a.out'.
      ```
      
      Differential Revision: https://reviews.llvm.org/D139643
      ad3870d6
    • Roman Lebedev's avatar
      Revert "[SROA] For non-speculatable `load`s of `select`s -- split block,... · 73961187
      Roman Lebedev authored
      Revert "[SROA] For non-speculatable `load`s of `select`s -- split block, insert then/else blocks, form two-entry PHI node"
      
      The assertion about not modifying the CFG seems to not hold,
      will recommit in a bit.
      
      https://lab.llvm.org/buildbot#builders/139/builds/32412
      
      This reverts commit 03e6d9d9.
      This reverts commit 4f90f4ad.
      73961187
    • bixia1's avatar
      [mlir][sparse] Fix checks in a test. · dfcb6719
      bixia1 authored
      Reviewed By: Peiming
      
      Differential Revision: https://reviews.llvm.org/D139636
      dfcb6719
    • Roman Lebedev's avatar
    • Peter Klausler's avatar
      [flang] Restore old unit locking behavior · 00a1c6d0
      Peter Klausler authored
      Rework  the recursive I/O error check on I/O units so that
      threads again hold a lock on a unit throughout an I/O statement.
      Add an API to the runtime's Lock class implementation for pthreads
      to allow detection of solf-deadlock without depending on EDEADLK
      or recursive mutexes.
      
      This should fix I/O from OpenMP threads.
      
      Differential Revision: https://reviews.llvm.org/D139477
      00a1c6d0
    • Jakub Kuderski's avatar
      690bed8c
    • Brett Wilson's avatar
      [clang-doc] Add template support. · 4a68babd
      Brett Wilson authored
      Reads template information from the AST and adds template parameters and
      specialization information to the corresponding clang-doc structures.
      
      Add a "QualName" to the Reference struct which includes the full
      qualified type name. The Reference object represents a link in the
      HTML/MD generators so is based on the unqualified name. But this does
      not encode C-V qualifiers or template information that decorate the
      name. The new QualName member encodes all of this information and also
      makes it easier for the generators or downsteam YAML consumers to
      generate the full name (before they had to process the "Path").
      
      In test code that was changed, remove made-up paths to built-in types
      like "int". In addition to slightnly cleaning up the code, these types
      do not have paths in real execution, and generating incorrect references
      to nonexistant data may complicate future changes in the generators.
      
      Convert llvm::Optional to std::optional (YAML library requires this for
      the new usage,...
      4a68babd
  2. Dec 08, 2022