tensor.empty op elimination is an optimization that brings IR in a more bufferization-friendly form. E.g.:
%0 = tensor.empty() %1 = linalg.fill(%cst, %0) {inplace = [true]} %2 = tensor.insert_slice %1 into %t[10][20][1]
Is rewritten to:
%0 = tensor.extract_slice %t[10][20][1] %1 = linalg.fill(%cst, %0) {inplace = [true]} %2 = tensor.insert_slice %1 into %t[10][20][1]
This optimization used to operate on bufferization.alloc_tensor ops. This is not correct because the documentation of bufferization.alloc_tensor says that it always bufferizes to an allocation. Instead, this optimization should operate on tensor.empty ops, which can then be lowered to bufferization.alloc_tensor ops (if they don't get eliminated).