[all-commits] [llvm/llvm-project] 6b52fb: [flang] Correctly handle `!dir$ unroll` with unrol...

Asher Mancinelli via All-commits all-commits at lists.llvm.org
Mon Feb 10 08:21:45 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b52fb25b90e575b507343bde0162d3d652ff666
      https://github.com/llvm/llvm-project/commit/6b52fb25b90e575b507343bde0162d3d652ff666
  Author: Asher Mancinelli <ashermancinelli at gmail.com>
  Date:   2025-02-10 (Mon, 10 Feb 2025)

  Changed paths:
    M flang/docs/Directives.md
    M flang/lib/Lower/Bridge.cpp
    M flang/test/Integration/unroll.f90

  Log Message:
  -----------
  [flang] Correctly handle `!dir$ unroll` with unrolling factors of 0 and 1 (#126170)

https://github.com/llvm/llvm-project/pull/123331 added support for the
unrolling directive. In the presence of an explicit unrolling factor,
that unrolling factor would be unconditionally passed into the metadata
even when it was 1 or 0. These special cases should instead disable
unrolling. Adding an explicit unrolling factor of 0 triggered this
assertion which is fixed by this patch:

```
unsigned int unrollCountPragmaValue(const llvm::Loop*):
Assertion `Count >= 1 && "Unroll count must be positive."' failed.
```

Updated tests and documentation.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list