if (BitShift.uge(BitWidth))
return Result;
+ // For bswap-only, limit shift amounts to whole bytes, for an early exit.
+ if (!MatchBitReversals && (BitShift.getZExtValue() % 8) != 0)
+ return Result;
+
const auto &Res =
collectBitParts(X, MatchBSwaps, MatchBitReversals, BPS, Depth + 1);
if (!Res)
if (cast<IntrinsicInst>(I)->getIntrinsicID() == Intrinsic::fshr)
ModAmt = BitWidth - ModAmt;
+ // For bswap-only, limit shift amounts to whole bytes, for an early exit.
+ if (!MatchBitReversals && (ModAmt % 8) != 0)
+ return Result;
+
const auto &LHS =
collectBitParts(X, MatchBSwaps, MatchBitReversals, BPS, Depth + 1);
const auto &RHS =