[llvm] [NFC][AMDGPU] Add debug print to `AMDGPULowerVGPREncoding.cpp` (PR #185331)
Tim Renouf via llvm-commits
llvm-commits at lists.llvm.org
Thu May 21 08:55:22 PDT 2026
================
@@ -98,6 +99,21 @@ class AMDGPULowerVGPREncoding {
return V;
}
+ void print(raw_ostream &OS) const {
+ static const char *FieldNames[] = {"src0", "src1", "src2", "dst"};
----------------
trenouf wrote:
`OpNum` is 7, so this array needs 7 entries. Or change the loop to enumerate no more than the number of entries in this array. I get this warning:
```
llvm-project/llvm/lib/Target/AMDGPU/AMDGPULowerVGPREncoding.cpp:171: warning: iteration 4 invokes undefined behavior [-Waggressive-loop-optimizations]
```
https://github.com/llvm/llvm-project/pull/185331
More information about the llvm-commits
mailing list