eZWALT wrote:

After conducting an examination of the directive handling logic, I can 
confidently state that the number of generated loops (`NumGeneratedLoops`) does 
not affect the semantic checks for the majority of transformations. This is 
because values are usually hardcoded in the `ActOnXXX` semantic handlers. For 
example:

- In the case of the `'reverse'` directive, the number of loops (`NumLoops`) is 
hardcoded to `1`, meaning it remains unaffected by any external loop count 
logic.
  
- For the `'interchange'` directive, the number of loops is also explicitly set 
using the following logic:

```
size_t NumLoops = PermutationClause ? PermutationClause->getNumLoops() : 2;
```

These values are passed into the `checkTransformableLoopNest` function and are 
not accessed elsewhere in the codebase, except:

- In `doForAllLoops`, where only the **presence** of loops is checked (i.e., 
`NumLoops == 0` or `> 0`), not the actual count, therefore this change won't 
break this conditional flow.
- In the newly introduced analysis functions (as part of the `'fuse'` 
transformation: #139293), specifically within `checkTransformableLoopSequence`, 
where both `NumGeneratedLoops` and `NumGeneratedLoopNests` are read and 
actively utilized.

https://github.com/llvm/llvm-project/pull/140532
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to