Skip to content

Commit 2171f34

Browse files
authored
[MLIR][LLVM] Remove the type consistency pass (#93283)
This commit removes the LLVM dialect's type consistency pass. This pass was originally introduced to make type information on memory operations consistent. The main benefactor of this consistency where Mem2Reg and SROA, which were in the meantime improved to no longer require consistent type information. Apart from providing a no longer required functionality, the pass had some fundamental flaws that lead to issues: * It introduced trivial GEPs (only zero indices) that could be folded again. * Aggressively splitting stores lead to substantial performance regressions in some cases. Subsequent memory coalescing were not able to recover this information, due to using non-trivial bit-fiddling.
1 parent ebc6c28 commit 2171f34

File tree

6 files changed

+0
-1201
lines changed

6 files changed

+0
-1201
lines changed

mlir/include/mlir/Dialect/LLVMIR/Transforms/Passes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "mlir/Dialect/LLVMIR/Transforms/LegalizeForExport.h"
1414
#include "mlir/Dialect/LLVMIR/Transforms/OptimizeForNVVM.h"
1515
#include "mlir/Dialect/LLVMIR/Transforms/RequestCWrappers.h"
16-
#include "mlir/Dialect/LLVMIR/Transforms/TypeConsistency.h"
1716
#include "mlir/Pass/Pass.h"
1817

1918
namespace mlir {

mlir/include/mlir/Dialect/LLVMIR/Transforms/Passes.td

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,6 @@ def LLVMRequestCWrappers
4343
let constructor = "::mlir::LLVM::createRequestCWrappersPass()";
4444
}
4545

46-
def LLVMTypeConsistency
47-
: Pass<"llvm-type-consistency", "::mlir::LLVM::LLVMFuncOp"> {
48-
let summary = "Rewrites to improve type consistency";
49-
let description = [{
50-
Set of rewrites to improve the coherency of types within an LLVM dialect
51-
program. This will adjust operations operating on pointers so they interpret
52-
their associated pointee type as consistently as possible.
53-
}];
54-
let constructor = "::mlir::LLVM::createTypeConsistencyPass()";
55-
56-
let options = [
57-
Option<"maxVectorSplitSize", "max-vector-split-size", "unsigned",
58-
/*default=*/"512",
59-
"Maximum size in bits of a vector value in a load or store operation"
60-
" operating on multiple elements that should still be split">,
61-
];
62-
}
63-
6446
def NVVMOptimizeForTarget : Pass<"llvm-optimize-for-nvvm-target"> {
6547
let summary = "Optimize NVVM IR";
6648
let constructor = "::mlir::NVVM::createOptimizeForTargetPass()";

mlir/include/mlir/Dialect/LLVMIR/Transforms/TypeConsistency.h

Lines changed: 0 additions & 73 deletions
This file was deleted.

mlir/lib/Dialect/LLVMIR/Transforms/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ add_mlir_dialect_library(MLIRLLVMIRTransforms
66
LegalizeForExport.cpp
77
OptimizeForNVVM.cpp
88
RequestCWrappers.cpp
9-
TypeConsistency.cpp
109

1110
DEPENDS
1211
MLIRLLVMPassIncGen

0 commit comments

Comments
 (0)