Bug 272400 - Enable polly support in devel/llvm (all applicable versions)
Summary: Enable polly support in devel/llvm (all applicable versions)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-06 23:36 UTC by Patrick McMunn
Modified: 2023-11-30 21:59 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick McMunn 2023-07-06 23:36:27 UTC
Polly is LLVM's polyhedral optimizer for loops and data locality similar to Graphite for GCC. Please enable this functionality or at least add it as an option for the port. It's been a part of the LLVM code base for several years, so I'm surprised it hasn't been added yet.
Comment 1 Brooks Davis freebsd_committer freebsd_triage 2023-07-06 23:58:00 UTC
I'll add it in the near future. I'll start with llvm-devel and aim to get llvm16 done before I make llvm17 from it at the end of the month.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-07-11 23:13:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2eae0958d55329a790b2f964e4d5d0bc619a8c7d

commit 2eae0958d55329a790b2f964e4d5d0bc619a8c7d
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-07-11 23:11:39 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-07-11 23:11:39 +0000

    devel/llvm-devel: enable polyhedral optimizations

    The POLLY option enables the Polly optimizer.  It is enabled by default.

    From the website (https://polly.llvm.org):

      Polly is a high-level loop and data-locality optimizer and
      optimization infrastructure for LLVM. It uses an abstract mathematical
      representation based on integer polyhedra to analyze and optimize the
      memory access pattern of a program. We currently perform classical
      loop transformations, especially tiling and loop fusion to improve
      data-locality. Polly can also exploit OpenMP level parallelism, expose
      SIMDization opportunities.

    PR:             272400

 devel/llvm-devel/Makefile          |  20 +++++--
 devel/llvm-devel/Makefile.MAN1SRCS |   3 +
 devel/llvm-devel/pkg-plist         | 118 +++++++++++++++++++++++++++++++++++++
 3 files changed, 135 insertions(+), 6 deletions(-)
Comment 3 Gleb Popov freebsd_committer freebsd_triage 2023-07-12 05:42:56 UTC
Am I understand it correctly that this only enables support for Polly inside LLVM, but it doesn't enable it in the default compiler pipeline?
Comment 4 Brooks Davis freebsd_committer freebsd_triage 2023-07-12 18:46:23 UTC
My understanding from polly.llvm.org is that it's now available to the compiler, but you need to add "-mllvm -polly" to enable it in a given compilation.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-07-14 19:07:57 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b4b2adbcf8f1c111e26b2670de59382f764b9abd

commit b4b2adbcf8f1c111e26b2670de59382f764b9abd
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-07-14 19:07:05 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-07-14 19:07:05 +0000

    devel/llvm16: support polyhedral optimizations

    The POLLY option enables the Polly optimizer.  It is currently disabled
    by default to allow a merge to quarterly without added risk.  I plan to
    enable it when I create devel/llvm17 in a couple weeks.

    From the website (https://polly.llvm.org):

      Polly is a high-level loop and data-locality optimizer and
      optimization infrastructure for LLVM. It uses an abstract mathematical
      representation based on integer polyhedra to analyze and optimize the
      memory access pattern of a program. We currently perform classical
      loop transformations, especially tiling and loop fusion to improve
      data-locality. Polly can also exploit OpenMP level parallelism, expose
      SIMDization opportunities.

    PR:             272400

 devel/llvm16/Makefile          |  16 ++++--
 devel/llvm16/Makefile.MAN1SRCS |   3 ++
 devel/llvm16/pkg-plist         | 120 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 136 insertions(+), 3 deletions(-)
Comment 6 Brooks Davis freebsd_committer freebsd_triage 2023-11-30 21:59:12 UTC
Done in llvm16 and llvm17 and in the latest quarterly. I don't see a lot of point in going further back, but could do so if it was useful.