[all-commits] [llvm/llvm-project] cd4196: [flang][hlfir] Only canonicalize forall_index if i...

jeanPerier via All-commits all-commits at lists.llvm.org
Thu May 25 23:23:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cd41967d9c705fe83a8396d72852e3f43642a67e
      https://github.com/llvm/llvm-project/commit/cd41967d9c705fe83a8396d72852e3f43642a67e
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2023-05-26 (Fri, 26 May 2023)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
    M flang/test/HLFIR/forall-index.fir
    M flang/test/Lower/HLFIR/forall.f90

  Log Message:
  -----------
  [flang][hlfir] Only canonicalize forall_index if it can be erased

It seems the canonicalization was not correct: it cannot return that
it failed if it did modify the IR.
This was exposed by a new MLIR sanity check added in
https://reviews.llvm.org/D144552.
I am not sure it is legit to return success if the operation being
canonicalized is not modified either. So only remove the loads if
they are the only uses of the forall_index.

Should fix (intermittent?) bot failures like
https://lab.llvm.org/buildbot/#/builders/179/builds/6251
since the new MLIR check was added.

Differential Revision: https://reviews.llvm.org/D151487




More information about the All-commits mailing list