[all-commits] [llvm/llvm-project] 688a14: [Clang][OpenMP] Optimize `collapse` IV bit-width p...

Amit Tiwari via All-commits all-commits at lists.llvm.org
Sat Sep 26 07:22:47 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 688a1498b3ce9011ee58c214086e3cd408e86f5e
      https://github.com/llvm/llvm-project/commit/688a1498b3ce9011ee58c214086e3cd408e86f5e
  Author: Amit Tiwari <Amit.Tiwari at amd.com>
  Date:   2026-09-26 (Sat, 26 Sep 2026)

  Changed paths:
    M clang/lib/Sema/SemaOpenMP.cpp
    A clang/test/OpenMP/collapse_iv_width_codegen.cpp

  Log Message:
  -----------
  [Clang][OpenMP] Optimize `collapse` IV bit-width precision expression (#225612)

`collapse` used to build both a 32-bit and a 64-bit trip-count, then
keep one.

This patch does the same in `checkOpenMPLoop`:

If we know 32-bit is enough, build only 32-bit.
Else build 64-bit first.
Build 32-bit only when the product is a compile-time constant and fits.

Origin: `flatten` already builds only the width it keeps.



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