[LLVM IR] Where (e.g., which pass) is it enforced that "Both arguments to the ‘lshr’ instruction must be the same integer or vector of integer type"

Hi,
For LLVM IR lshr, it’s documented (LLVM Language Reference Manual — LLVM 16.0.0git documentation) that " Both arguments to the ‘lshr ’ instruction must be the same integer or vector of integer type."

With <result> = lshr <ty> <op1>, <op2> ; yields ty:result, my interpretation is that

  1. if op1 is integer, op2 must be integer (of the same type)
  2. if op2 is vector of integer, op2 must be vector of integer (with the same integer type).

If this is guaranteed in code (more than doc), using pattern matchers are much easier for my use case (where op1 is known to be a vector already, so I could assume op2 is a vector and not worry about scalar for whatever reason).

I wonder how (where) this is enforced?

Please advise what i miss, thanks!

Oh actually the enforcement (op1 vs op2 type) is for all binary operators (llvm-project/Verifier.cpp at 27d666b9adc12a13f67ccde96d5b4d181f56ffc5 · llvm/llvm-project · GitHub) so this is indeed enforced.