public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "matz at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52934] New: enhancement: cshift0 should be inlined Date: Wed, 11 Apr 2012 12:45:00 -0000 [thread overview] Message-ID: <bug-52934-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52934 Bug #: 52934 Summary: enhancement: cshift0 should be inlined Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: matz@gcc.gnu.org polyhedrons protein would improve quite a bit when the cshift0 intrinsic would be inlined. With the patch below on my machine the runtime for protein drops from 0m21.367s to 0m19.227s (i.e. by 10%). Inlining a generic cshift probably wouldn't bring the same improvement, but still. (a bit related is my patch to improve cshift0 at http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00533.html ) --- protein.f90.mm 2011-12-02 16:22:47.000000000 +0100 +++ protein.f90 2011-12-02 16:16:38.000000000 +0100 @@ -250,7 +250,20 @@ out3: do n1 = 1, polypeptide_len ! total_surface_energy = 0 true_total_surface_energy = 0.0_LONGreal - shifted_surface_sequence = cshift(surface_sequence(:,l),m-1) + if (m == 1) then + shifted_surface_sequence = surface_sequence(:,l) + else if (m == 2) then + shifted_surface_sequence(1:3) = surface_sequence(2:4,l) + shifted_surface_sequence(4) = surface_sequence(1,l) + else if (m == 3) then + shifted_surface_sequence(1:2) = surface_sequence(3:4,l) + shifted_surface_sequence(3:4) = surface_sequence(1:2,l) + else if (m == 4) then + shifted_surface_sequence(1) = surface_sequence(4,l) + shifted_surface_sequence(2:4) = surface_sequence(1:3,l) + else + shifted_surface_sequence = cshift(surface_sequence(:,l),m-1) + end if do k = 1, number_of_polypeptides surface_energy = 0 true_surface_energy = 0.0_LONGreal
next reply other threads:[~2012-04-11 12:45 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-04-11 12:45 matz at gcc dot gnu.org [this message] 2012-04-11 12:51 ` [Bug fortran/52934] " burnus at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-52934-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).