1. May 28, 2024
  2. May 27, 2024
    • cor3ntin's avatar
      [Clang] Only non-overloaded dereference expressions are lvalues (#93457) · 48c988cf
      cor3ntin authored
      Fix a regression introduced by #88740
      
      Fixes #92275
      48c988cf
    • Michael Kruse's avatar
      [clang-tools-extra] Remove redundant FOLDER property. NFC. · 5fb38307
      Michael Kruse authored
      This should have been removed from #89744 to address a review comment.
      5fb38307
    • Louis Dionne's avatar
      [libc++] Remove libcxx/include/libcxx.imp · 3d1145a5
      Louis Dionne authored
      This was committed by mistake. We don't store that file in the source
      tree anymore, we only generate it upon installation.
      3d1145a5
    • Jakub Kuderski's avatar
      [mlir][vector] Add result type to `interleave` assembly format (#93392) · 714aee31
      Jakub Kuderski authored
      This is to make it more obvious for what the result type is, especially
      with some less trivial cases like 0-d inputs resulting in 1-d inputs or
      interaction with scalable vector types. Note that `vector.deinterleave`
      uses the same format with explicit result type.
      
      Also improve examples and clean up surrounding code.
      714aee31
    • Nikita Popov's avatar
      [IR] Add getelementptr nusw and nuw flags (#90824) · 8cdecd4d
      Nikita Popov authored
      This implements the `nusw` and `nuw` flags for `getelementptr` as
      proposed at
      https://discourse.llvm.org/t/rfc-add-nusw-and-nuw-flags-for-getelementptr/78672.
      
      The three possible flags are encapsulated in the new `GEPNoWrapFlags`
      class. Currently this class has a ctor from bool, interpreted as the
      InBounds flag. This ctor should be removed in the future, as code gets
      migrated to handle all flags.
      
      There are a few places annotated with `TODO(gep_nowrap)`, where I've had
      to touch code but opted to not infer or precisely preserve the new
      flags, so as to keep this as NFC as possible and make sure any changes
      of that kind get test coverage when they are made.
      8cdecd4d
    • Timm Bäder's avatar
      49b760ff
    • Sirraide's avatar
      [Clang] [NFC] Clarify assume diagnostic (#93077) · 5e140c8a
      Sirraide authored
      Currently, if the argument to `__builtin_assume` and friends contains
      side-effects, we issue the following diagnostic:
      ```
      <source>:1:34: warning: the argument to '__builtin_assume' has side 
      effects that will be discarded [-Wassume]
          1 | void f(int x) { __builtin_assume(x++); }
            |                                  
      ```
      The issue here is that this diagnostic misrepresents what is actually
      happening: not only do we discard the side-effects of the expression,
      but we also don’t even emit any assumption information at all because
      the backend is not equipped to deal with eliminating side-effects in
      cases such as this.
      
      This has caused some confusion (see #91612) beacuse the current wording
      of the warning suggests that, sensibly, only the side-effects of the
      expression, and not the assumption itself, will be discarded.
      
      This pr updates the diagnostic to state what is actually happening: that
      the assumption has no effect at all because its argument contains
      side-effects:
      ```
      <source>:1:34: warning: assumption is ignored because it contains 
      (potential) side-effects [-Wassume]
          1 | void f(int x) { __builtin_assume(x++); }
            |                                  
      ```
      
      I’ve deliberately included ‘(potential)’ here because even expressions
      that only contain potential side-effects (e.g. `true ? x : x++` or a
      call to a function that is pure, but we don’t know that it is) cause the
      assumption to be discarded. This, too, has caused some confusion because
      it was erroneously assumed that Clang would e.g. infer that a function
      call is pure and not discard the assumption as a result when that isn’t
      the case.
      
      This is intended to be temporary; we should revert back to the original
      diagnostic once we have proper support for assumptions with side-effects
      in the backend (in which case the side-effects will still be discarded,
      but the assumption won’t)
      
      This fixes #91612.
      5e140c8a
    • Rouzbeh's avatar
      [LoopCacheAnalysis] Fix loop cache cost to always round the cost up to the... · 67025946
      Rouzbeh authored
      [LoopCacheAnalysis] Fix loop cache cost to always round the cost up to the nearest integer number (#88915)
      
      Currently loop cache analysis uses following formula to evaluate cost of
      an RefGroup for a consecutive memory access:
      
      `RefCost=(TripCount*Stride)/CLS`
      
      This cost evaluates to zero when `TripCount*Stride` is smaller than
      cache-line-size. This results in wrong cost value for a loop and
      misleads loopInterchange decisions as shown in [this
      case](https://llvm.godbolt.org/z/jTz1vn4hn).
      
      This patch fixes the problem by rounding the cost to 1 once this problem
      happens.
      67025946
    • Hendrik Hübner's avatar
      [Clang] Issue an error when an atomic builtin is called with a pointer to a... · 21ee2787
      Hendrik Hübner authored
      [Clang] Issue an error when an atomic builtin is called with a pointer to a zero-size object (#91057)
      
      When an atomic builtin is called with a pointer to an object of size
      zero, an arithmetic exception gets thrown because there is a modulo
      operation with the objects size in codegen.
      
      Diagnose this in sema instead.
      
      Fixes #90330.
      21ee2787
    • Timm Bäder's avatar
      [clang][Interp] Fix returning references to functions · 6a197b35
      Timm Bäder authored
      Previously, we pushed a pointer to the stack and later tried to use
      it as if it was a function pointer, which doesn't work.
      6a197b35
    • Timm Bäder's avatar
      [clang][Interp][NFC] Explicitly define PrimType values · b1e329a3
      Timm Bäder authored
      So I don't have to count them down all the time.
      b1e329a3
    • Shan Huang's avatar
      a487616c