This is an archive of the discontinued LLVM Phabricator instance.

[Flang][HLFIR] Intrinsics: Propagate fast math flags
ClosedPublic

Authored by kiranchandramohan on Jul 17 2023, 4:04 AM.

Details

Summary

Add a new FirOpBuilder constructor to propagate the fast math flag
from an operation. Use this constructor in the LowerHLFIRIntrinsics
pass.

This fixes the performance issue with the hlfir intrinsics flow
for polyhedron/test_fpu2.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 17 2023, 4:04 AM
kiranchandramohan requested review of this revision.Jul 17 2023, 4:04 AM
flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIRIntrinsics.cpp
73

I have opted to create a new constructor for FirOpbuilder inheriting fast attributes from op. Alternative could have been a getBuilder function in this pass that constructs and then sets the fast math flag.

tblah accepted this revision.Jul 17 2023, 5:36 AM

Thanks for this!

This revision is now accepted and ready to land.Jul 17 2023, 5:36 AM
vzakhari accepted this revision.Jul 17 2023, 8:22 AM

Looks great! Thank you!

This revision was landed with ongoing or failed builds.Jul 18 2023, 2:27 AM
This revision was automatically updated to reflect the committed changes.