Skip to content

Commit 1e353fa

Browse files
authored
AMDGPU: Fix -Wextra (#138539)
Another stupid gcc warning. Ideally we would directly use the enum type, but subregister indexes are emitted as an anonymous enum. Fixes #125548
1 parent 9d90f8b commit 1e353fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2521,8 +2521,9 @@ bool AMDGPUInstructionSelector::selectG_TRUNC(MachineInstr &I) const {
25212521
return false;
25222522

25232523
if (SrcSize > 32) {
2524-
unsigned SubRegIdx =
2525-
DstSize < 32 ? AMDGPU::sub0 : TRI.getSubRegFromChannel(0, DstSize / 32);
2524+
unsigned SubRegIdx = DstSize < 32
2525+
? static_cast<unsigned>(AMDGPU::sub0)
2526+
: TRI.getSubRegFromChannel(0, DstSize / 32);
25262527
if (SubRegIdx == AMDGPU::NoSubRegister)
25272528
return false;
25282529

0 commit comments

Comments
 (0)