// Three-element dot product. i32 add/mul wrap without overflow flags.
func.func @dot3(%a: memref<3xi32>, %b: memref<3xi32>) -> i32 {
  %c0 = arith.constant 0 : index
  %c1 = arith.constant 1 : index
  %c3 = arith.constant 3 : index
  %zero = arith.constant 0 : i32
  %sum = scf.for %k = %c0 to %c3 step %c1
      iter_args(%acc = %zero) -> (i32) {
    %av = memref.load %a[%k] : memref<3xi32>
    %bv = memref.load %b[%k] : memref<3xi32>
    %product = arith.muli %av, %bv : i32
    %next = arith.addi %acc, %product : i32
    scf.yield %next : i32
  }
  return %sum : i32
}
