[llvm] [AMDGPU][NFC] Explicitly narrow conversions in AMDGPUBaseInfo (PR #215192)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 01:43:54 PDT 2026


================

----------------
gretay-amd wrote:

> This looks fine but it does make code look a little bit ugly. Lol

@shiltian  Thanks for looking into this PR. I can try to refactor the code slightly to improve readability, for example introduce a local variable to hold the result of a static cast instead of wrapping an argument with a static cast directly at a call site. Would it help? 


```suggestion
  uint8_t NewChannels = static_cast<uint8_t>(NewChannels);
  const MIMGInfo *NewInfo = getMIMGOpcodeHelper(
      OrigInfo->BaseOpcode, OrigInfo->MIMGEncoding,
      NewChannels, OrigInfo->VAddrDwords);
```

https://github.com/llvm/llvm-project/pull/215192


More information about the llvm-commits mailing list