This reverts commit 73ece231 and reapplies 7bfcdbcb with mlir changes. Also reverts commit 423ba129 and includes the unit test changes of 16da2140.