diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp --- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp +++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp @@ -50,11 +50,6 @@ #define DEBUG_TYPE "lower-matrix-intrinsics" -static cl::opt EnableShapePropagation( - "matrix-propagate-shape", cl::init(true), cl::Hidden, - cl::desc("Enable/disable shape propagation from matrix intrinsics to other " - "instructions.")); - static cl::opt FuseMatrix("fuse-matrix", cl::init(true), cl::Hidden, cl::desc("Enable/disable fusing matrix instructions.")); @@ -660,33 +655,32 @@ } bool Visit() { - if (EnableShapePropagation) { - SmallVector WorkList; - - // Initially only the shape of matrix intrinsics is known. - // Initialize the work list with ops carrying shape information. - for (BasicBlock &BB : Func) - for (Instruction &Inst : BB) { - IntrinsicInst *II = dyn_cast(&Inst); - if (!II) - continue; + SmallVector WorkList; + + // Initially only the shape of matrix intrinsics is known. + // Initialize the work list with ops carrying shape information. + for (BasicBlock &BB : Func) + for (Instruction &Inst : BB) { + IntrinsicInst *II = dyn_cast(&Inst); + if (!II) + continue; - switch (II->getIntrinsicID()) { - case Intrinsic::matrix_multiply: - case Intrinsic::matrix_transpose: - case Intrinsic::matrix_column_major_load: - case Intrinsic::matrix_column_major_store: - WorkList.push_back(&Inst); - break; - default: - break; - } + switch (II->getIntrinsicID()) { + case Intrinsic::matrix_multiply: + case Intrinsic::matrix_transpose: + case Intrinsic::matrix_column_major_load: + case Intrinsic::matrix_column_major_store: + WorkList.push_back(&Inst); + break; + default: + break; } - // Propagate shapes until nothing changes any longer. - while (!WorkList.empty()) { - WorkList = propagateShapeForward(WorkList); - WorkList = propagateShapeBackward(WorkList); } + + // Propagate shapes until nothing changes any longer. + while (!WorkList.empty()) { + WorkList = propagateShapeForward(WorkList); + WorkList = propagateShapeBackward(WorkList); } bool Changed = false;