@@ -83,8 +83,8 @@ static bool foldGuardedFunnelShift(Instruction &I, const DominatorTree &DT) {
8383 // == (ShVal0 << ShAmt) | (ShVal1 >> (Width -ShAmt))
8484 if (match (V, m_OneUse (m_c_Or (
8585 m_Shl (m_Value (ShVal0), m_Value (ShAmt)),
86- m_LShr (m_Value (ShVal1),
87- m_Sub ( m_SpecificInt (Width), m_Deferred (ShAmt))))))) {
86+ m_LShr (m_Value (ShVal1), m_Sub ( m_SpecificInt (Width),
87+ m_Deferred (ShAmt))))))) {
8888 return Intrinsic::fshl;
8989 }
9090
@@ -646,8 +646,9 @@ static bool foldLoadsRecursive(Value *V, LoadOps &LOps, const DataLayout &DL,
646646 LoadInst *LI1 = LOps.Root ;
647647 uint64_t ShAmt1 = LOps.Shift ;
648648 if (LOps.FoundRoot == false &&
649- match (X, m_OneUse (m_ShlOrSelf (
650- m_OneUse (m_ZExt (m_OneUse (m_Instruction (L1)))), ShAmt1)))) {
649+ (match (X, m_OneUse (m_ZExt (m_Instruction (L1)))) ||
650+ match (X, m_OneUse (m_Shl (m_OneUse (m_ZExt (m_OneUse (m_Instruction (L1)))),
651+ m_ConstantInt (ShAmt1)))))) {
651652 LI1 = dyn_cast<LoadInst>(L1);
652653 }
653654 LoadInst *LI2 = dyn_cast<LoadInst>(L2);
0 commit comments