This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix complex libm use logic problems
ClosedPublic

Authored by razvanlupusoru on Jul 19 2023, 11:31 AM.

Details

Summary

Fix the various complex libm selection logic issues from D155310:

  • disableMlirComplex is set to false. This means that using mlir complex

is enabled. Yet, the current code still selects libm.

  • If we enable mlir complex, we should not check if use approx is

enabled. Namely, we should use mlir complex either if we enable mlir
complex OR use approx is enabled.

To fix the issues, we flip the logic of disableMlirComplex to enable
instead. We set it to false by default since the intention from D155310
is to use libm by default. Then we use a logical && with use approx
so that we select libm when BOTH mlir complex and use approx are
disabled.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 19 2023, 11:31 AM
razvanlupusoru requested review of this revision.Jul 19 2023, 11:31 AM
flang/lib/Optimizer/Builder/IntrinsicCall.cpp
577

Extra word "lower". Will remove.

Removed extra word in command line option description.

I am uploading the flang lit tests changes in a bit so we pass check-flang.

vzakhari accepted this revision.Jul 19 2023, 12:12 PM

Thank you, Razvan! Looks good to me.

This revision is now accepted and ready to land.Jul 19 2023, 12:12 PM
This revision was landed with ongoing or failed builds.Jul 19 2023, 1:31 PM
This revision was automatically updated to reflect the committed changes.