[PATCH] D113763: [flang][CodeGen] Transform `fir.boxchar_len` to a sequence of LLVM MLIR

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 12 05:37:55 PST 2021


awarzynski added a comment.

IIUC, both forms are correct (based on the operation definition <https://github.com/llvm/llvm-project/blob/9534e361ea12aaecde52b8ac4c947f9a301d0c9b/flang/include/flang/Optimizer/Dialect/FIROps.td#L1083-L1100>:

  %0 = fir.boxchar_len %arg0 : (!fir.boxchar<4>) -> i64
  %0 = fir.boxchar_len %arg0 : (!fir.boxchar<4>) -> i32

As the length inside `!fir.boxchar` will be either `i32` or `i64`  (this depends on the target), `!fir.boxchar` may require an integer cast on the result. Please see the tests for examples.

@schweitz , could you confirm whether this is correct? There was no integer cast on fir-dev, but I added it here. But perhaps I'm missing something here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113763/new/

https://reviews.llvm.org/D113763



More information about the llvm-commits mailing list