1. Aug 28, 2022
    • Nathan James's avatar
      2a0870c9
    • Nathan James's avatar
      [clang-tidy] Fix a false positive in bugprone-assignment-in-if-condition · 6bd98b4f
      Nathan James authored
      Fixed a false positive where a lambda expression in the condition which contained an assignement would trigger a warning.
      Fixes #56729
      
      Reviewed By: gribozavr2
      
      Differential Revision: https://reviews.llvm.org/D132786
      6bd98b4f
    • Arthur Eubanks's avatar
      [LazyCallGraph] Update libcall list when replacing a libcall node's function · 7a94d189
      Arthur Eubanks authored
      Otherwise when we visit all libcalls in
      updateCGAndAnalysisManagerForPass(), the old libcall is dead and doesn't
      have a node.
      
      We treat libcalls conservatively in LazyCallGraph because any function
      may introduce calls to them out of thin air.
      
      It is weird to change the signature of a libcall since introducing calls
      to the libcall with a different signature may break, but other passes
      like deadargelim already do it, so let's preserve this behavior for now.
      
      Fixes an issue found in D128830.
      
      Reviewed By: psamolysov
      
      Differential Revision: https://reviews.llvm.org/D132764
      7a94d189
    • Kazu Hirata's avatar
      [GlobalISel] Use std::lcm (NFC) · 9d6ab723
      Kazu Hirata authored
      This patch replaces getLCMSize with std::lcm, a C++17 feature.
      
      Note that all the arguments are of unsigned with no implicit type
      conversion as they are passed to getLCMSize.
      9d6ab723
    • Kazu Hirata's avatar
      [mlir] Use std::lcm (NFC) · 099775c2
      Kazu Hirata authored
      This patch replaces mlir::lcm with std::lcm, a C++17 feature.
      
      Note that all the arguments to mlir::lcm are of int64_t with no
      implicit type conversion as they are passed to mlir::lcm, which I've
      verified by modifying mlir::lcm as:
      
        template <typename TA, typename TB>
        inline int64_t lcm(TA a, TB b) {
          static_assert(std::is_same_v<TA, int64_t>);
          static_assert(std::is_same_v<TB, int64_t>);
          :
      099775c2
    • Kazu Hirata's avatar
      Use std::clamp (NFC) · 86bc4587
      Kazu Hirata authored
      This patch replaces clamp idioms with std::clamp where the range is
      obviously valid from the source code (that is, low <= high) to avoid
      introducing undefined behavior.
      86bc4587
    • Kazu Hirata's avatar
      Use llvm::is_contained (NFC) · 21de2888
      Kazu Hirata authored
      21de2888
    • Kazu Hirata's avatar
      Use llvm::all_equal (NFC) · a33ef8f2
      Kazu Hirata authored
      a33ef8f2
    • Emil Kieri's avatar
      [flang] Don't emit faulty warnings for illegal COMMON blocks · b2c96d78
      Emil Kieri authored
      SAVE statements referencing COMMON block names are not allowed in BLOCK
      constructs. If they occur, an error is correctly emitted, but then flang
      gets confused by the illegal SAVE and produces a faulty warning. This
      patch removes that warning.
      
      Consider this piece of Fortran (from the test blockconstruct02.f90):
      
      program  main
        real r, s, t
        common /argmnt2/ r, s, t
        block
          save /argmnt2/
        end block
      end program
      
      Here flang (in addition to the error about the illegal SAVE) emits a
      portability warning saying that the two definitions of argmnt2 have
      different size, which does not make much sense.
      
      This patch is a prerequisite for D125804, which in turn will make
      blockconstruct02.f90 test this patch.
      
      Reviewed By: jeanPerier
      
      Differential Revision: https://reviews.llvm.org/D132403
      b2c96d78
  2. Aug 27, 2022