1. Mar 15, 2024
  2. Mar 14, 2024
    • Jason Molenda's avatar
      [lldb] [Mach-O] ProcessMachCore needs to strip TBI data from addrs (#84998) · 52557bce
      Jason Molenda authored
      Darwin AArch64 application processors are run with Top Byte Ignore mode
      enabled so metadata may be stored in the top byte, it needs to be
      ignored when reading/writing memory. David Spickett handled this already
      in the base class Process::ReadMemory but ProcessMachCore overrides that
      method (to avoid the memory cache) and did not pick up the same change.
      I add a test case that creates a pointer with metadata in the top byte
      and dereferences it with a live process and with a corefile.
      
      rdar://123784501
      52557bce
    • Timm Bäder's avatar
      [clang][Interp] Strip _Atomic from _Complex types · 797994da
      Timm Bäder authored
      ... when doing binary operations on them.
      797994da
    • Timm Bäder's avatar
    • Jonas Paulsson's avatar
      [MachineCombiner] Don't ignore PHI depths (#82025) · 6588ac30
      Jonas Paulsson authored
      The depths of the Root and the NewRoot are to be compared in
      MachineCombiner::improvesCriticalPathLen(), and while the call to
      BlockTrace.getInstrCycles(*Root) includes the Depth of a PHI, for some
      reason PHI nodes have been ignored in getOperandDef(). 
      
      This patch removes the special handling of PHIs in getOperandDef() so that
      Root and NewRoot get a fair comparison. This does not affect loop headers
      as MachineTraceMetrics handles that case by ignoring incoming PHI edges.
      6588ac30
    • Sam McCall's avatar
      [clang][nullability] allow _Nonnull etc on nullable class types (#82705) · 92a09c01
      Sam McCall authored
      This enables clang and external nullability checkers to make use of
      these annotations on nullable C++ class types like unique_ptr.
      
      These types are recognized by the presence of the _Nullable attribute.
      Nullable standard library types implicitly receive this attribute.
      
      Existing static warnings for raw pointers are extended to smart
      pointers:
      
      - nullptr used as return value or argument for non-null functions
        (`-Wnonnull`)
      - assigning or initializing nonnull variables with nullable values
        (`-Wnullable-to-nonnull-conversion`)
      
      It doesn't implicitly add these attributes based on the assume_nonnull
      pragma, nor warn on missing attributes where the pragma would apply
      them.
      I'm not confident that the pragma's current behavior will work well for
      C++ (where type-based metaprogramming is much more common than C/ObjC).
      We'd like to revisit this once we have more implementation experience.
      
      Support can be detected as `__has_feature(nullability_on_classes)`.
      This is needed for back-compatibility, as previously clang would issue a
      hard error when _Nullable appears on a smart pointer.
      
      UBSan's `-fsanitize=nullability` will not check smart-pointer types.
      It can be made to do so by synthesizing calls to `operator bool`, but
      that's left for future work.
      
      Discussion:
      https://discourse.llvm.org/t/rfc-allowing-nonnull-etc-on-smart-pointers/77201/26
      92a09c01
    • Zahi Moudallal's avatar
      [MLIR][ROCDL] Fix BallotOp LLVM translation and add doc (#85116) · 8481fb16
      Zahi Moudallal authored
      This modifies the return type of the intrinsic call to handle 32 and 64
      bits
      properly and document the MLIR operation.
      8481fb16
    • Craig Topper's avatar
      [TargetLowering][RISCV] Propagate fastmath flags for the vector operations... · 23323e28
      Craig Topper authored
      [TargetLowering][RISCV] Propagate fastmath flags for the vector operations emitted in expandVecReduce. (#85164)
      
      We used the fastmath flags for any scalar ops created, but not vector.
      23323e28
    • Timm Bäder's avatar
      [clang][Interp] Fix rotate builtins with differently-typed arguments · 65c01432
      Timm Bäder authored
      We were assuming (and asserting) that both arguments have the same
      type, but at least for the ms versions, that's not always the case.
      65c01432
    • Krzysztof Parzyszek's avatar
      [flang][OpenMP] Implement flexible OpenMP clause representation (#81621) · ea2cfcc1
      Krzysztof Parzyszek authored
      The new set of classes representing OpenMP classes mimics the contents
      of parser::OmpClause, but differs in a few aspects:
      - it can be easily created, copied, etc.
      - is based on semantics::SomeExpr instead of parser objects.
      
      This set of classes is geared towards a language-agnostic representation
      of OpenMP clauses. While the class members are still based on flang's
      `parser::OmpClause`, the classes themselves are actually C++ templates
      parameterized with types essential to represent necessary information.
      The two parameters are
      - `IdType`: the type that can represent object's identity (for flang it
      will be `semantics::Symbol *`),
      - `ExprType`: the type that can represent expressions, arithmetic and
      object references (`semantics::MaybeExpr` in flang).
      
      The templates are defined in a namespace `tomp` (to distinguish it from
      `omp`).
      
      This patch introduces file "Clauses.cpp", which contains instantiations
      of all of the templates for flang. The instantiations are members of
      namespace `omp`, and include an all-encompassing variant class
      `omp::Clause`, which is the analog of `parser::OmpClause`.
      The class `OmpObject` is represented by `omp::Object`, which contains
      the symbol associated with the object, and `semantics::MaybeExpr`
      representing the designator for the symbol reference. For each specific
      clause in the variant `parser::OmpClause`, there exists a `make`
      function that will generate the corresponding `omp::Clause` from it. The
      intent was to use the make functions as variant visitors. The creation
      of a clause instance would then follow the pattern:
      ```
      omp::Clause clause = std::visit([](auto &&s) { return make(s, semaCtx); }, parserClause.u);
      ```
      
      If a new clause `foo` is added in the future, then:
      - a new template `tomp::FooT` representing the clause needs to be added
      to ClauseT.h,
      - a new instance needs to be created in flang, this can be as simple as
      `using Foo = tomp::FooT<...>`,
      - a new make function needs to be implemented to create object of class
      Foo from `parser::OmpClause::Foo`.
      
      This patch only introduces the new classes, they are not yet used
      anywhere.
      
      [Clause representation 1/6]
      ea2cfcc1
    • Timm Bäder's avatar
      [clang][Interp] Don't abort on float div-by-zero · 68360dc8
      Timm Bäder authored
      The result in that case can still be computed, and it's inf.
      68360dc8
    • Andrew Brown's avatar
      [openmp][wasm] Fix microtask type mismatch (#84355) · d8366082
      Andrew Brown authored
      When OpenMP is compiled for WebAssembly (see #71297), it invokes a
      microtask via a `switch` statement that dispatches to the `void *`
      microtask pointer with spelled-out arguments (not varargs). As #83329
      points out, however, this can result in a type mismatch when the
      indirect call is executed by WebAssembly; WebAssembly expects the called
      pointer to have the precise type of the call site. This change fixes the
      issue by bringing back the approach in [D142593] of type-casting all the
      `switch` arms to the precise type. This fixes #83329.
      
      [D142593]: https://reviews.llvm.org/D142593
      d8366082
    • Alastair Houghton's avatar
    • Antonio Frighetto's avatar
      [SCCP] Extend `visitBinaryOperator` to overflowing binary ops · 6ae4fcfd
      Antonio Frighetto authored
      Leverage more refined ranges results when handling overflowing
      binary operators.
      6ae4fcfd
    • Kirill Stoimenov's avatar
      589c7abb
    • Timm Bäder's avatar
      [clang][Interp] Allow visiting extern variables · 2cd19df7
      Timm Bäder authored
      If the variable is additionally const(expr), visit them like normal
      but omit the initializer.
      2cd19df7
    • LLVM GN Syncbot's avatar
      [gn build] Port f7bebc19 · 486332af
      LLVM GN Syncbot authored
      486332af
    • Janek van Oirschot's avatar
      Reland [AMDGPU] Add AMDGPU specific variadic operation MCExprs (#84562) · f7bebc19
      Janek van Oirschot authored
      Adds AMDGPU specific variadic MCExpr operations 'max' and 'or'. 
      
      Relands #82022 with fixes
      f7bebc19