[all-commits] [llvm/llvm-project] 7d52be: [flang] Relax fir.rebox verifier with characters

jeanPerier via All-commits all-commits at lists.llvm.org
Wed Mar 16 08:09:58 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d52beb27572b74213eb4470e3cdb0bacbdd306d
      https://github.com/llvm/llvm-project/commit/7d52beb27572b74213eb4470e3cdb0bacbdd306d
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2022-03-16 (Wed, 16 Mar 2022)

  Changed paths:
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/test/Fir/fir-ops.fir
    M flang/test/Fir/invalid.fir
    A flang/test/Fir/rebox-susbtring.fir
    A flang/test/Fir/rebox.fir

  Log Message:
  -----------
  [flang] Relax fir.rebox verifier with characters

Allow fir.rebox input and output element type to differ for characters
if:
- Any of the character type is dynamic. Fortran allows making pointer
assignments between deferred and constant lengths entities, making this
case useful (if the input length is dynamic and the output length constant,
it is a user requirement that the length matches at runtime. There is no
option to check this at runtime, but it could be added as an option to
fir.rebox codegen later if desired).

- Or, there is a slice in the fir.rebox (the fir.rebox can implement a
substring view, hence the constant output and input lengths).

This is only a verifier constraint change, the fir.rebox codegen is not
impacted and already support those cases.

Add related FIR parsing, error, and codegen tests.

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




More information about the All-commits mailing list