1. Feb 25, 2022
  2. Feb 24, 2022
    • Joseph Huber's avatar
      [OpenMP] Make section variable external to prevent collisions · 7aef8b37
      Joseph Huber authored
      Summary:
      We use a section to embed offloading code into the host for later
      linking. This is normally unique to the translation unit as it is thrown
      away during linking. However, if the user performs a relocatable link
      the sections will be merged and we won't be able to access the files
      stored inside. This patch changes the section variables to have external
      linkage and a name defined by the section name, so if two sections are
      combined during linking we get an error.
      7aef8b37
    • Sanjay Patel's avatar
      [InstCombine] try harder to preserve 'nsz' in fneg-of-select transform · 5379f76e
      Sanjay Patel authored
      The corner case where 'nsz' needs to be removed is very narrow
      as discussed here:
      https://reviews.llvm.org/rG3cdd05e519dd
      
      If the select condition is not undef, there's no problem with
      propagating 'nsz':
      https://alive2.llvm.org/ce/z/4GWJdq
      5379f76e
    • Sanjay Patel's avatar
      788b08a5
    • Jay Foad's avatar
      [MIRParser] Diagnose too large align values in MachineMemOperands · 719bac55
      Jay Foad authored
      When parsing MachineMemOperands, MIRParser treated the "align" keyword
      the same as "basealign". Really "basealign" should specify the
      alignment of the MachinePointerInfo base value, and "align" should
      specify the alignment of that base value plus the offset.
      
      This worked OK when the specified alignment was no larger than the
      alignment of the offset, but in cases like this it just caused
      confusion:
      
          STW killed %18, 4, %stack.1.ap2.i.i :: (store (s32) into %stack.1.ap2.i.i + 4, align 8)
      
      MIRPrinter would never have printed this, with an offset of 4 but an
      align of 8, so it must have been written by hand. MIRParser would
      interpret "align 8" as "basealign 8", but I think it is better to give
      an error and force the user to write "basealign 8" if that is what they
      really meant.
      
      Differential Revision: https://reviews.llvm.org/D120400
      
      Change-Id: I7eeeefc55c2df3554ba8d89f8809a2f45ada32d8
      719bac55
    • Marius Brehler's avatar
      [mlir][emitc] Add a variable op · 1fa12511
      Marius Brehler authored
      This adds a variable op, emitted as C/C++ locale variable, which can be
      used if the `emitc.constant` op is not sufficient.
      
      As an example, the canonicalization pass would transform
      ```mlir
      %0 = "emitc.constant"() {value = 0 : i32} : () -> i32
      %1 = "emitc.constant"() {value = 0 : i32} : () -> i32
      %2 = emitc.apply "&"(%0) : (i32) -> !emitc.ptr<i32>
      %3 = emitc.apply "&"(%1) : (i32) -> !emitc.ptr<i32>
      emitc.call "write"(%2, %3) : (!emitc.ptr<i32>, !emitc.ptr<i32>) -> ()
      ```
      into
      ```mlir
      %0 = "emitc.constant"() {value = 0 : i32} : () -> i32
      %1 = emitc.apply "&"(%0) : (i32) -> !emitc.ptr<i32>
      %2 = emitc.apply "&"(%0) : (i32) -> !emitc.ptr<i32>
      emitc.call "write"(%1, %2) : (!emitc.ptr<i32>, !emitc.ptr<i32>) -> ()
      ```
      resulting in pointer aliasing, as %1 and %2 point to the same address.
      In such a case, the `emitc.variable` operation can be used instead.
      
      Reviewed By: jpienaar
      
      Differential Revision: https://reviews.llvm.org/D120098
      1fa12511
    • Corentin Jabot's avatar
      [clang] Warn on unqualified calls to std::move and std::forward · 70b1f6de
      Corentin Jabot authored
      This adds a diagnostic when an unqualified call is resolved
      to std::move or std::forward.
      
      This follows some C++ committee discussions where some
      people where concerns that this might be an usual anti pattern
      particularly britle worth warning about - both because move
      is a common name and because these functions accept any values.
      
      This warns inconditionnally of whether the current context is in
      std:: or not, as implementations probably want to always qualify
      these calls too, to avoid triggering adl accidentally.
      
      Differential Revision: https://reviews.llvm.org/D119670
      70b1f6de