1. Aug 24, 2023
    • Slava Zakharin's avatar
      [flang][hlfir] Apply MemAlloc effect to hlfir.elemental explicitly. · ebfdbdb7
      Slava Zakharin authored
      Related to https://github.com/llvm/llvm-project/issues/64866.
      This patch effectively disables CSE for identical hlfir.elemental
      operations, because it causes hlfir.destroy to be applied twice
      to the same temporary. Moreover, I think MemAlloc is correct
      for hlfir.elemental, in general.
      
      Reviewed By: tblah
      
      Differential Revision: https://reviews.llvm.org/D158565
      ebfdbdb7
    • Slava Zakharin's avatar
      [flang][hlfir] Fixed associate-op codegen for optimized HLFIR. · b2a95010
      Slava Zakharin authored
      This effectively reverts D154715.
      
      The issue appears as the dialect conversion error because we try to
      erase an op that has already been erased. See the added LIT test case
      with HLFIR that may appear as a result of CSE.
      The `adaptor.getSource()` is an operation producing a tuple,
      which does not have users, so `allOtherUsesAreSafeForAssociate`
      just looks at the empty list of users. So we get completely wrong
      answers from it. This causes problems with the following
      `eraseAllUsesInDestroys` that tries to remove the `DestroyOp` twice
      during both `hflir.associate` processing.
      
      But we also cannot use `associate.getSource()` *efficiently*, because
      the original users may still hang around: one example is the original body
      of hlfir.elemental (see D154715), another example is other already converted
      AssociateOp's that are pending removal in the rewriter
      (that is why we have a temporary created for each hlfir.associate
      in the newly added LIT case).
      
      This patch just fixes the correctness issue. I think we have to separate
      the buffer reuse analysis from the conversion itself.
      
      I also tried to address the issues with the cloned bodies of `hlfir.elemental`,
      but this should not matter since D155778: if `hlfir.associate` is inside
      `hlfir.elemental`, it will end up inside a do-loop body region, so the early
      exit added in D155778 will prevent the buffer reuse.
      
      Reviewed By: tblah
      
      Differential Revision: https://reviews.llvm.org/D158471
      b2a95010
    • Luke Lau's avatar
      [RISCV] Fix wrong operand being used for VL in shift combine · 06d3ee96
      Luke Lau authored
      At some point a merge operand was added to the binary vl ops, so this combine
      was using the mask for the VL. This causes a crash when trying to
      select the vmv_v_x_vl, which showed up locally when messing about with
      selectVSplat, but thankfully in ToT the vmv_v_x_vl gets pattern matched
      away into the .vx and .vi operands every time, so there's no noticeable
      change.
      
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D158634
      06d3ee96
    • Hao Jin's avatar
      [flang][driver] Mark -fuse-ld as visible in Flang · dc8e46c7
      Hao Jin authored
      The option fuse-ld is not visible in Flang. Flang reports
      "Unknown argument: '-fuse-ld'" during link stage.
      
      Reviewed By: awarzynski, kiranchandramohan
      
      Differential Revision: https://reviews.llvm.org/D158430
      dc8e46c7
    • Valentin Clement's avatar
      [mlir][openacc] Add set operation · 4bac6ed4
      Valentin Clement authored
      Introduce the acc.set operation that models the
      acc set directive. Based on acc.init and acc.shutdown
      
      Reviewed By: razvanlupusoru
      
      Differential Revision: https://reviews.llvm.org/D158554
      4bac6ed4
    • Mark de Wever's avatar
      [clang][doc] Mentions -Wno-reserved-module-identifiers · c73de296
      Mark de Wever authored
      This is a nicer way to suppress the diagnostic instead of using the
      pre-processor work-around.
      
      Reviewed By: ChuanqiXu
      
      Differential Revision: https://reviews.llvm.org/D158523
      c73de296
    • Felipe de Azevedo Piovezan's avatar
      [AsmPrinter][DebugInfo] Create EntryValue mode for DbgVariable · af6d43ea
      Felipe de Azevedo Piovezan authored
      With D149881, we converted EntryValue MachineFunction table entries into
      `DbgVariables` initialized by a "DbgValue" intrinsic, which can only handle a
      single, non-fragment DIExpression. However, it is desirable to handle variables
      with multiple fragments and DIExpressions.
      
      To do this, we expand the `DbgVariable` class to handle the EntryValue case.
      This class can already operate under three different "modes" (stack slot,
      unchanging location described by a dbg value, changing location described by a
      loc list). A fourth case is added as a separate class entirely, but a subsequent
      patch should redesign `DbgVariable` with four subclasses in order to make the
      code more readable.
      
      This patch also exposed a bug in the `beginEntryValueExpression` function, which
      was not initializing the `LocationFlags` properly. Note how the
      `finalizeEntryValue` function resets that flag. We fix this bug here, as testing
      this changing in isolation would be tricky.
      
      Differential Revision: https://reviews.llvm.org/D158458
      af6d43ea
    • Felipe de Azevedo Piovezan's avatar
      [CodeGen][DebugInfo] Append OP_deref when converting an EntryValue dbg.declare · 88417098
      Felipe de Azevedo Piovezan authored
      When we convert an EntryValue dbg.declare into an entry of the MF side table, we
      currently copy its DIExpression as is, and rely on subsequent layers to "know"
      that this expression is implicitly indirect. This is bad because it adds an
      implicit assumption to the IR representation, and requires subsequent layers to
      know about this assumption. This also limits the reusability of this table:
      what if, in the future, we want to use this table for dbg.values?
      
      This patch changes existing behavior so that the entities converting
      dbg_declares explicitly add an OP_deref when converting EntryValue dbg.declares.
      
      Differential Revision: https://reviews.llvm.org/D158437
      88417098
    • Kazu Hirata's avatar
      [lld] Do not include StringSwitch.h (NFC) · 4efd1e0d
      Kazu Hirata authored
      4efd1e0d
    • Kazu Hirata's avatar
      [flang] Fix a warning · fae11ab2
      Kazu Hirata authored
      This patch fixes:
      
        flang/lib/Semantics/resolve-directives.cpp:899:29: error: moving a
        temporary object prevents copy elision [-Werror,-Wpessimizing-move]
      fae11ab2
  2. Aug 23, 2023