[CIR] Consider lowering to first-class constrained operations in LLVM dialect
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
In https://github.com/llvm/llvm-project/pull/213105 I introduced code to lower CIR operations with rounding mode or exception behavior constraints to calls to the corresponding constrained intrinsic in the LLVM dialect. This requires creating metadata string values to pass to the calls. During review the question was raised as to whether we should instead have attributes in the LLVM dialect to represent these settings and lower to operations that accept those attributes.
The LLVM dialect already has such attributes, and it has first-class constrained operations for some, but not all, of the operations that would need to be lowered to constrained intrinsics in LLVM IR. I have a patch in my local sandbox to add the remaining operations. The question is whether we want to continue with this direction in the LLVM dialect or keep the representation closer to LLVM IR by using the general intrinsic call operation and perhaps removing the existing constrained operations.
Contributor guide
Assessment
This issue has not been assessed yet.