[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 06:45:56 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 shouldn't need to do any of this special case hardcoding. Just check if the register class of the virtual register or operand is compatible with the new class
https://github.com/llvm/llvm-project/pull/162088
More information about the llvm-commits
mailing list