[PATCH] D113763: [flang][CodeGen] Transform `fir.boxchar_len` to a sequence of LLVM MLIR
Valentin Clement via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 12 05:52:56 PST 2021
clementval added a comment.
In D113763#3127219 <https://reviews.llvm.org/D113763#3127219>, @awarzynski wrote:
> 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?
Did you try to add the cast on fir-dev to see the impact on the tests we have there?
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