[PATCH] D148096: [AMDGPU][GlobalISel] Widen the vector operand in G_BUILD/INSERT/EXTRACT_VECTOR
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 24 09:59:29 PDT 2023
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:141-143
+ // Find the nearest legal RegClass that is larger than the current type.
+ while (!SIRegisterInfo::getSGPRClassForBitWidth(NumElts * EltSize))
+ ++NumElts;
----------------
I think a for loop from current size to maximum size would be clearer
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:1476-1478
+ .moreElementsIf(
+ isNotAnExistingRegClassType(VecTypeIdx),
+ moreElementsToNextExistingRegClass(VecTypeIdx))
----------------
These should be moved to the bottom. Legalization rules should list the legal cases first (which we should be doing here, but aren't) and the less common cases should be at the bottom. These queries do execute a large number of times
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148096/new/
https://reviews.llvm.org/D148096
More information about the llvm-commits
mailing list