[all-commits] [llvm/llvm-project] 069257: [clang][CodeGen] Fix metadata when vectorization i...
Ryotaro Kasuga via All-commits
all-commits at lists.llvm.org
Wed Jul 16 18:01:32 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0692572e040979b2de0dceb8f0537aa16caf351f
https://github.com/llvm/llvm-project/commit/0692572e040979b2de0dceb8f0537aa16caf351f
Author: Ryotaro Kasuga <kasuga.ryotaro at fujitsu.com>
Date: 2025-07-17 (Thu, 17 Jul 2025)
Changed paths:
M clang/lib/CodeGen/CGLoopInfo.cpp
M clang/test/CodeGenCXX/pragma-loop.cpp
Log Message:
-----------
[clang][CodeGen] Fix metadata when vectorization is disabled by pragma (#135163)
Currently, when specifying `vectorize(disable) unroll_count(8)`, the
generated metadata appears as follows:
```
!loop0 = !{!"loop0", !vectorize_width, !followup}
!vectorize_width = !{!"llvm.loop.vectorize.width", i32 1}
!followup = !{!"llvm.loop.vectorize.followup_all", !unroll}
!unroll = !{!"llvm.loop.unroll_count", i32 8}
```
Since the metadata `!vectorize_width` implies that the vectorization is
disabled, the vectorization process is skipped, and the `!followup`
metadata is not processed correctly.
This patch addresses the issue by directly appending properties to the
metadata node when vectorization is disabled, instead of creating a new
follow-up MDNode. In the above case, the generated metadata will now
look like this:
```
!loop0 = !{!"loop0", !vectorize_width, !vectorize_width, !unroll}
!vectorize_width = !{!"llvm.loop.vectorize.width", i32 1}
!unroll = !{!"llvm.loop.unroll_count", i32 8}
```
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