# TVM code generation has redundant border?

Using the below tvm code:
A = tvm.placeholder((1080, 1920), name=‘A’, dtype=dtype)
K = tvm.placeholder((3, 3), name=‘K’, dtype=dtype)
ry = tvm.reduce_axis((0, 3), name=‘ry’)
rx = tvm.reduce_axis((0, 3), name=‘rx’)

C = tvm.compute((1080-2, 1920-2), lambda i, j: tvm.sum((A[i + ry, j + rx] *K[ry, rx]), axis=[ry, rx]), name=‘C’)
print(“C shape:”, C.shape)

print(“F shape:”, F.shape)

s = tvm.create_schedule(F.op)
print(tvm.lower(s, [A, K, C, F], simple_mode=True))

The print IR code is:

``````C shape: [1078, 1918]
F shape: [1080, 1920]
produce C {
for (i, 0, 1080) {
for (j, 0, 1920) {
C[(((i1918) + j) + -1919)] = 0.000000f
for (ry, 0, 3) {
for (rx, 0, 3) {
if (likely((1 <= i))) {
if (likely((i < 1079))) {
if (likely((1 <= j))) {
if (likely((j < 1919))) {
C[(((i1918) + j) + -1919)] = (C[(((i1918) + j) + -1919)] + (A[(((((i + ry)1920) + j) + rx) + -1921)]K[((ry3) + rx)]))
}
}
}
}
}
}
}
}
}
Even though the linked post is old and I think there wasn’t a definite answer, the `schedule.normalize()` will bring all the loops to a common representation (in this case since C can be embedded in the iteration space of F, the boundaries are those of F)