This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add LoongArch64 support to lib/Optimizer/CodeGen/Target.cpp
ClosedPublic

Authored by SixWeining on Feb 1 2023, 7:27 PM.

Details

Summary

Add LoongArch64 linux target specifics to Target.cpp which is similar to
RISCV-64 in D136547.

For LoongArch, a complex floating-point number, or a structure
containing just one complex floating-point number, is passed as though
it were a structure containing two floating-point reals.

Diff Detail

Event Timeline

SixWeining created this revision.Feb 1 2023, 7:27 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 1 2023, 7:27 PM
SixWeining requested review of this revision.Feb 1 2023, 7:27 PM
vzakhari requested changes to this revision.Feb 3 2023, 12:35 PM
vzakhari added inline comments.
flang/lib/Optimizer/CodeGen/Target.cpp
501

I believe the lifetime of the underlying array for {eleTy, eleTy} is not extended by range, so the use of range below is referencing a dangling reference. See TypeRange related changes in https://reviews.llvm.org/rGff794116f9815979f9a3a1195aff9be49334da7a#change-eNCIp5atpdz4 - they were done to avoid failures that were only reproducible in Windows ARM buildbot. If you do not want to deal with flaky memory issues, I would suggest using mlir::TypeRange{eleTy, eleTy} directly as the call argument.

This revision now requires changes to proceed.Feb 3 2023, 12:35 PM

Address @vzakhari's comments and add LoongArch to more target-rewrite tests.

SixWeining marked an inline comment as done.Feb 5 2023, 10:05 PM
SixWeining added inline comments.
flang/lib/Optimizer/CodeGen/Target.cpp
501

Thanks. I didn't see that change before.

vzakhari accepted this revision.Feb 6 2023, 8:35 AM
This revision is now accepted and ready to land.Feb 6 2023, 8:35 AM
This revision was automatically updated to reflect the committed changes.
SixWeining marked an inline comment as done.