llvm / llvm/llvm-project

[flang][hlfir] Add an operation for the PACK intrinsic

Open
#209,363 0 comments 0 reactions 1 assignee Claimed by @sharangk12 View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.