[llvm] [AggressiveCombine] Refactor `foldLoadsRecursive` to use `m_ShlOrSelf` (PR #155176)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 24 10:15:11 PDT 2025
================
@@ -646,11 +644,10 @@ static bool foldLoadsRecursive(Value *V, LoadOps &LOps, const DataLayout &DL,
// Check if the pattern has loads
LoadInst *LI1 = LOps.Root;
- const APInt *ShAmt1 = LOps.Shift;
+ uint64_t ShAmt1 = LOps.Shift;
if (LOps.FoundRoot == false &&
- (match(X, m_OneUse(m_ZExt(m_Instruction(L1)))) ||
- match(X, m_OneUse(m_Shl(m_OneUse(m_ZExt(m_OneUse(m_Instruction(L1)))),
- m_APInt(ShAmt1)))))) {
+ match(X, m_OneUse(
+ m_ShlOrSelf(m_OneUse(m_ZExt(m_Instruction(L1))), ShAmt1)))) {
----------------
nikic wrote:
As a followup, could check whether we can relax more of these one-use checks.
https://github.com/llvm/llvm-project/pull/155176
More information about the llvm-commits
mailing list