[llvm] [AMDGPU] siloadstoreopt generate REG_SEQUENCE with aligned operands (PR #162088)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 6 09:16:50 PDT 2025
================
@@ -1363,6 +1363,15 @@ SILoadStoreOptimizer::checkAndPrepareMerge(CombineInfo &CI,
return Where;
}
+static bool isCompatibleAlignSubReg(const TargetRegisterClass *RC, unsigned Idx,
+ const GCNSubtarget *STM,
+ const SIRegisterInfo *TRI) {
+ if (!STM->needsAlignedVGPRs() || !TRI->isVGPRClass(RC) ||
+ !TRI->isProperlyAlignedRC(*RC) || AMDGPU::getRegBitWidth(*RC) == 32)
+ return true;
+ return !(TRI->getChannelFromSubReg(Idx) & 0x1);
----------------
arsenm wrote:
You should use none of the functions here; not needsAlignedVGPRs, not isProperlyAlignedRC, and probably not getChannelFromSubReg or getRegBitWidth either.
You either want RC->hasSubClassEq() or TRI->getCommonSubClass depending on the context.
In this case it looks like getTargetRegisterClass isn't returning the correct class to use
https://github.com/llvm/llvm-project/pull/162088
More information about the llvm-commits
mailing list