[llvm-branch-commits] [llvm] [AMDGPU][Attributor] Rework update of `AAAMDWavesPerEU` (PR #123995)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Mar 21 12:00:27 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {undef deprecator}-->
:warning: undef deprecator found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git diff -U0 --pickaxe-regex -S '([^a-zA-Z0-9#_-]undef[^a-zA-Z0-9_-]|UndefValue::get)' 31185938e33e4033c0e78ebf898041dd2e1ec90a 64d1817a15664f8a7a35428267762d3bed64100a llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp llvm/test/CodeGen/AMDGPU/addrspacecast-constantexpr.ll llvm/test/CodeGen/AMDGPU/amdgpu-attributor-no-agpr.ll llvm/test/CodeGen/AMDGPU/annotate-existing-abi-attributes.ll llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll llvm/test/CodeGen/AMDGPU/annotate-kernel-features.ll llvm/test/CodeGen/AMDGPU/attr-amdgpu-max-num-workgroups-propagate.ll llvm/test/CodeGen/AMDGPU/attributor-flatscratchinit.ll llvm/test/CodeGen/AMDGPU/attributor-loop-issue-58639.ll llvm/test/CodeGen/AMDGPU/direct-indirect-call.ll llvm/test/CodeGen/AMDGPU/duplicate-attribute-indirect.ll llvm/test/CodeGen/AMDGPU/implicitarg-offset-attributes.ll llvm/test/CodeGen/AMDGPU/indirect-call-set-from-other-function.ll llvm/test/CodeGen/AMDGPU/inline-attr.ll llvm/test/CodeGen/AMDGPU/issue120256-annotate-constexpr-addrspacecast.ll llvm/test/CodeGen/AMDGPU/pal-simple-indirect-call.ll llvm/test/CodeGen/AMDGPU/propagate-flat-work-group-size.ll llvm/test/CodeGen/AMDGPU/propagate-waves-per-eu.ll llvm/test/CodeGen/AMDGPU/recursive_global_initializer.ll llvm/test/CodeGen/AMDGPU/remove-no-kernel-id-attribute.ll llvm/test/CodeGen/AMDGPU/simple-indirect-call-2.ll llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll llvm/test/CodeGen/AMDGPU/uniform-work-group-attribute-missing.ll llvm/test/CodeGen/AMDGPU/uniform-work-group-multistep.ll llvm/test/CodeGen/AMDGPU/uniform-work-group-nested-function-calls.ll llvm/test/CodeGen/AMDGPU/uniform-work-group-prevent-attribute-propagation.ll llvm/test/CodeGen/AMDGPU/uniform-work-group-propagate-attribute.ll llvm/test/CodeGen/AMDGPU/uniform-work-group-recursion-test.ll llvm/test/CodeGen/AMDGPU/uniform-work-group-test.ll
``````````
</details>
The following files introduce new uses of undef:
- llvm/test/CodeGen/AMDGPU/addrspacecast-constantexpr.ll
- llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll
- llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll
- llvm/test/CodeGen/AMDGPU/propagate-flat-work-group-size.ll
- llvm/test/CodeGen/AMDGPU/propagate-waves-per-eu.ll
[Undef](https://llvm.org/docs/LangRef.html#undefined-values) is now deprecated and should only be used in the rare cases where no replacement is possible. For example, a load of uninitialized memory yields `undef`. You should use `poison` values for placeholders instead.
In tests, avoid using `undef` and having tests that trigger undefined behavior. If you need an operand with some unimportant value, you can add a new argument to the function and use that instead.
For example, this is considered a bad practice:
```llvm
define void @fn() {
...
br i1 undef, ...
}
```
Please use the following instead:
```llvm
define void @fn(i1 %cond) {
...
br i1 %cond, ...
}
```
Please refer to the [Undefined Behavior Manual](https://llvm.org/docs/UndefinedBehavior.html) for more information.
https://github.com/llvm/llvm-project/pull/123995
More information about the llvm-branch-commits
mailing list