Page MenuHomePhabricator

Add -f[no-]loop-versioning option
AcceptedPublic

Authored by Leporacanthicus on Jan 9 2023, 10:27 AM.

Details

Summary

Add flags for loop-versioning pass enable/disable

Diff Detail

Unit TestsFailed

TimeTest
130 msx64 debian > Flang.Driver::code-gen-rv64.f90
Script: -- : 'RUN: at line 5'; rm -f /var/lib/buildkite-agent/builds/llvm-project/build/tools/flang/test/Driver/Output/code-gen-rv64.f90.tmp.o
50 msx64 debian > Flang.Examples::feature-list-class.f90
Script: -- : 'RUN: at line 4'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/flang-new -fc1 -load /var/lib/buildkite-agent/builds/llvm-project/build/lib/flangFeatureList.so -plugin feature-list /var/lib/buildkite-agent/builds/llvm-project/flang/test/Examples/feature-list-class.f90 2>&1 | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/flang/test/Examples/feature-list-class.f90
60 msx64 debian > Flang.Examples::feature-list-functions.f90
Script: -- : 'RUN: at line 4'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/flang-new -fc1 -load /var/lib/buildkite-agent/builds/llvm-project/build/lib/flangFeatureList.so -plugin feature-list /var/lib/buildkite-agent/builds/llvm-project/flang/test/Examples/feature-list-functions.f90 2>&1 | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/flang/test/Examples/feature-list-functions.f90

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Leporacanthicus requested review of this revision.Jan 9 2023, 10:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2023, 10:27 AM

Rebased and updated help-message

Also using different type of template for the option

Update for rebase.

Leporacanthicus retitled this revision from [WIP] Add -f[no-]loop-versioning option to Add -f[no-]loop-versioning option.Fri, Mar 3, 2:39 AM
Leporacanthicus edited the summary of this revision. (Show Details)
tblah added a subscriber: tblah.Mon, Mar 6, 10:06 AM

Please could you add tests for the flag forwarding logic in flang/tests/Driver/frontend-forwarding.f90. For example see https://reviews.llvm.org/rGd0d4b635786d510cd919cadbeb7e5e19983242cf

clang/lib/Driver/ToolChains/Flang.cpp
95

Does GFortran only enable this with -Ofast? I would have thought this would be an -On thing because it doesn't impact precision.

flang/include/flang/Frontend/CodeGenOptions.def
27

nit: comment

Updates based on review comments:

  • Add tests.
  • Enable on -O3

Also changed the name to match gfortran.

Leporacanthicus marked an inline comment as done.Wed, Mar 8, 7:41 AM
Leporacanthicus added inline comments.
clang/lib/Driver/ToolChains/Flang.cpp
95

No, good point.

flang/include/flang/Frontend/CodeGenOptions.def
27

Darn, missed fixing this.

Leporacanthicus marked an inline comment as done.

Fix copied comment to reflect the new content.

tblah accepted this revision.Thu, Mar 9, 3:28 AM

Looks good to me

This revision is now accepted and ready to land.Thu, Mar 9, 3:28 AM

Rebase and fix conflicts