https://github.com/gysit approved this pull request. LGTM I would probably assert patternWidth == 8 or even use 8 directly when computing the constant. That way it is more obvious there cannot be an overflow (which triggers an assert IUC). https://github.com/llvm/llvm-project/pull/131621