clangir icon indicating copy to clipboard operation
clangir copied to clipboard

[CIR] Extend support for floating point attributes

Open orbiri opened this issue 10 months ago • 9 comments

This commit extends the support for floating point attributes parsing by using the new AsmParser::parseFloat(fltSemnatics, APFloat&) interface. As a drive-by, this commit also harmonizes the cir.fp print/parse namespace usage, and adds the constraint of supporting only "CIRFPType"s for cir.fp in tablegen instead of verifying it manually in the parsing logic.


This commit is based on top of a to-be-upstreamed commit which extends the upstream MLIR float type parsing. Upstream parsing of float type has full capability only through parsing the Builtin Dialect's FloatAttr. Thos commit exposes the same capabilities to downstream users.


This PR should resolve (at least) GCC-C-execute-ieee-fp-cmp-2 and GCC-C-execute-ieee-fp-cmp-4, paving the way to other GCC-C-execute-ieee-* tests passing from the SingleSource suite. It resolves #559 .

orbiri avatar Apr 28 '24 13:04 orbiri

@Lancern - may be related to work that you are working on 🙏 (e.g. #536 #571 ).

orbiri avatar Apr 28 '24 14:04 orbiri

Upstream patch: https://github.com/llvm/llvm-project/pull/90442

orbiri avatar Apr 29 '24 09:04 orbiri

Nathan just did a rebase, can you please update? Sorry for the churn

bcardosolopes avatar Apr 29 '24 21:04 bcardosolopes

Rebased 🙏 Update on upstream commit: PR was approved, tying to wait a bit more for the core developers who most recently touched that code (Jeff & River) to take a look. Will merge by Friday if no further comments arise.

orbiri avatar May 01 '24 06:05 orbiri

Thanks for going the extra length to make sure this works!

bcardosolopes avatar May 01 '24 17:05 bcardosolopes

Upstream patch: llvm/llvm-project#90442

Merged upstream 🎉 Waiting for the next CIR rebase and I'll update this one.

orbiri avatar May 05 '24 07:05 orbiri

@bcardosolopes - is there any planned rebase anytime soon? This PR is blocked by getting the upstream patch. Alternatively, I assume we can cherry-pick it here and there's a 95% chance that it will dissolve on the next rebase. Let me know what you prefer 🙏🏼

orbiri avatar May 17 '24 13:05 orbiri

@bcardosolopes - is there any planned rebase anytime soon? This PR is blocked by getting the upstream patch. Alternatively, I assume we can cherry-pick it here and there's a 95% chance that it will dissolve on the next rebase. Let me know what you prefer 🙏🏼

@lanza wdyt?

bcardosolopes avatar May 18 '24 03:05 bcardosolopes

I pushed a rebase just now. Should be good to go :p

lanza avatar Jun 21 '24 19:06 lanza