[flang][hlfir] Add an operation for the PACK intrinsic
Open
flang
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
PACK is listed in flang/docs/HighLevelFIR.md as a planned transformational intrinsic, but is not implemented currently. Lowering always falls through to IntrinsicCall.cpp::genPack() and emits _FortranAPack.
Current behaviour:
```
subroutine pack_true_contig(a, r)
real :: a(10)
real :: r(10)
r = pack(a, .true.)
end subroutine
```
There is no check for compile-time .TRUE. mask. The existing lowering test explicitly expects the runtime call:
`fir.call @_FortranAPack`
Contributor guide
Assessment
This issue has not been assessed yet.