Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang2] Generate loads of complex variables with correct alignment #1449

Merged

Conversation

bryanpkc
Copy link
Collaborator

flang2 calls the function make_load() to create various types of load instructions in the LLVM IR output. The function accepts a flags argument of type LL_InstrListFlags which should encode the alignment of the load, among other things. Apparently, for the IL_LDSCMPLX, IL_LDDCMPLX, and IL_LDQCMPLX opcodes, the flags had never been computed correctly. This patch makes such loads consistent with loads of other types, and also adds a test case.

flang2 calls the function make_load() to create various types of load
instructions in the LLVM IR output. The function accepts a "flags" argument
of type LL_InstrListFlags which should encode the alignment of the load,
among other things. Apparently, for the IL_LDSCMPLX, IL_LDDCMPLX, and
IL_LDQCMPLX opcodes, the flags had never been computed correctly. This
patch makes such loads consistent with loads of other types, and also adds
a test case.
Copy link
Collaborator

@pawosm-arm pawosm-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB, checking for TARGET_SUPPORTS_QUADFP doesn't seem to be needed in the new execution path, is it intentional?

@bryanpkc
Copy link
Collaborator Author

NB, checking for TARGET_SUPPORTS_QUADFP doesn't seem to be needed in the new execution path, is it intentional?

@pawosm-arm Yes, it is intentional. ldst_instr_flags_from_dtype_nme and ldst_instr_flags_from_dtype behave the same way regardless of the data type, and the underlying alignment function (in dtypeutl.cpp) handles TY_QCMPLX only when TARGET_SUPPORTS_QUADFP is defined.

@bryanpkc bryanpkc merged commit 8e65ce5 into flang-compiler:master Jul 24, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants