This is an archive of the discontinued LLVM Phabricator instance.

[fir] Add !fir.logical type conversion
ClosedPublic

Authored by clementval on Nov 8 2021, 8:03 AM.

Details

Summary

Add conversion from !fir.logical types to LLVM IR Dialect types.

This patch is part of the upstreaming effort from fir-dev branch.

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>

Diff Detail

Event Timeline

clementval created this revision.Nov 8 2021, 8:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2021, 8:03 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Nov 8 2021, 8:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2021, 8:03 AM
clementval retitled this revision from [fir] Add !fir.logical tyep conversion to [fir] Add !fir.logical type conversion.Nov 8 2021, 8:10 AM
kiranchandramohan accepted this revision.Nov 8 2021, 8:25 AM

LGTM.

Nit: In the Summary please convert LLVM IR to LLVM IR Dialect/LLVM Dialect.

flang/test/Fir/types-to-llvm.fir
70

Assuming we do not support fir.logical<16>

This revision is now accepted and ready to land.Nov 8 2021, 8:25 AM
clementval edited the summary of this revision. (Show Details)Nov 8 2021, 8:35 AM
clementval added inline comments.
flang/test/Fir/types-to-llvm.fir
70

It's actually supported. Will add a test before landing this.

func private @foo4(%arg0: !fir.logical<16>)
// CHECK-LABEL: foo4
// CHECK-SAME: i128
This revision was automatically updated to reflect the committed changes.
clementval marked an inline comment as done.Nov 8 2021, 8:55 AM
schweitz added inline comments.Nov 9 2021, 7:16 AM
flang/test/Fir/types-to-llvm.fir
70

The front end only supports LOGICALs with KIND values of 1, 2, 4, and 8. (See, for example, flang/Evaluate/type.h.

FIR has no such restrictions.