1. Apr 16, 2022
    • Johannes Doerfert's avatar
      [AMDGPU][FIX] Proper load-store-vectorizer result with opaque pointers · 1fb415fe
      Johannes Doerfert authored
      The original code relied on the fact that we needed a bitcast
      instruction (for non constant base objects). With opaque pointers there
      might not be a bitcast. Always check if reordering is required instead.
      
      Fixes: https://github.com/llvm/llvm-project/issues/54896
      
      Differential Revision: https://reviews.llvm.org/D123694
      1fb415fe
    • William S. Moses's avatar
      [NFC] Update comments · 9a8bb4bc
      William S. Moses authored
      9a8bb4bc
    • Aaron Ballman's avatar
      Fix an edge case in determining is a function has a prototype · 8fd3b5de
      Aaron Ballman authored
      Given the declaration:
      
        typedef void func_t(unsigned);
        __attribute__((noreturn)) func_t func;
      
      we would incorrectly determine that `func` had no prototype because the
      `noreturn` attribute would convert the underlying type directly into a
      FunctionProtoType, but the declarator for `func` itself was not one for
      a function with a prototype. This adds an additional check for when the
      declarator is a type representation for a function with a prototype.
      8fd3b5de
    • Zequan Wu's avatar
      2f78f945
    • Mogball's avatar
      [mlir] Update LICM to support Graph Regions · 3430ae1e
      Mogball authored
      Changes the algorithm of LICM to support graph regions (no guarantee of topologically sorted order). Also fixes an issue where ops with recursive side effects and regions would not be hoisted if any nested ops used operands that were defined within the nested region.
      
      Reviewed By: rriddle
      
      Differential Revision: https://reviews.llvm.org/D122465
      3430ae1e
    • Fangrui Song's avatar
      [PGO] Remove legacy PM passes · 04e094a3
      Fangrui Song authored
      Legacy PM for optimization pipeline was deprecated in 13.0.0 and Clang dropped
      legacy PM support in D123609. This change removes legacy PM passes for PGO so
      that downstream projects won't be able to use it. It seems appropriate to start
      removing such "add-on" features like instrumentations, before we remove more
      stuff after 15.x is branched.
      
      I have checked many LLVM users and only ldc[1] uses the legacy PGO pass.
      
      [1]: https://github.com/ldc-developers/ldc/issues/3961
      
      Reviewed By: davidxl
      
      Differential Revision: https://reviews.llvm.org/D123834
      04e094a3
    • William S. Moses's avatar
      [MLIR] Fix operation clone · ed499ddc
      William S. Moses authored
      Operation clone is currently faulty.
      
      Suppose you have a block like as follows:
      
      ```
      (%x0 : i32) {
         %x1 = f(%x0)
         return %x1
      }
      ```
      
      The test case we have is that we want to "unroll" this, in which we want to change this to compute `f(f(x0))` instead of just `f(x0)`. We do so by making a copy of the body at the end of the block and set the uses of the argument in the copy operations with the value returned from the original block.
      This is implemented as follows:
      1) map to the block arguments to the returned value (`map[x0] = x1`).
      2) clone the body
      
      Now for this small example, this works as intended and we get the following.
      
      ```
      (%x0 : i32) {
         %x1 = f(%x0)
         %x2 = f(%x1)
         return %x2
      }
      ```
      
      This is because the current logic to clone `x1 = f(x0)` first looks up the arguments in the map (which finds `x0` maps to `x1` from the initialization), and then sets the map of the result to the cloned result (`map[x1] = x2`).
      
      However, this fails if `x0` is not an argument to the op, but instead used inside the region, like below.
      
      ```
      (%x0 : i32) {
         %x1 = f() {
            yield %x0
         }
         return %x1
      }
      ```
      
      This is because cloning an op currently first looks up the args (none), sets the map of the result (`map[%x1] = %x2`), and then clones the regions. This results in the following, which is clearly illegal:
      
      ```
      (%x0 : i32) {
         %x1 = f() {
            yield %x0
         }
         %x2 = f() {
            yield %x2
         }
         return %x2
      }
      ```
      
      Diving deeper, this is partially due to the ordering (how this PR fixes it), as well as how region cloning works. Namely it will first clone with the mapping, and then it will remap all operands. Since the ordering above now has a map of `x0 -> x1` and `x1 -> x2`, we end up with the incorrect behavior here.
      
      Reviewed By: ftynse
      
      Differential Revision: https://reviews.llvm.org/D122531
      ed499ddc
    • Peter Klausler's avatar
      [flang] Fix Symbol::Rank for ProcEntityDetails · ca2be81e
      Peter Klausler authored
      When a procedure pointer or procedure dummy argument has a
      defined interface, the rank of the pointer (or dummy) is the
      rank of the interface.
      
      Also tweak code discovered in shape analysis when investigating
      this problam so that it returns a vector of emptied extents rather
      than std::nullopt when the extents are not scope-invariant, so that
      the rank can at least be known.
      
      Differential Revision: https://reviews.llvm.org/D123727
      ca2be81e
    • jfurtek's avatar
      [mlir][ods][NFC] Move enum attribute definitions from OpBase.td to EnumAttr.td · bed82121
      jfurtek authored
      This diff moves `EnumAttr` tablegen definitions (specifically, `IntEnumAttr` and
      `BitEnumAttr`-related classes) from `OpBase.td` to `EnumAttr.td`. No
      functionality is changed.
      
      Reviewed By: rriddle
      
      Differential Revision: https://reviews.llvm.org/D123551
      bed82121
  2. Apr 15, 2022