[Mlir-commits] [mlir] [mlir][vector] Add pattern for dropping unit dims from for loops (PR #109585)
Quinn Dawkins
llvmlistbot at llvm.org
Sun Sep 22 11:04:26 PDT 2024
================
@@ -107,6 +107,17 @@ LoopNest buildLoopNest(OpBuilder &builder, Location loc, ValueRange lbs,
function_ref<void(OpBuilder &, Location, ValueRange)>
bodyBuilder = nullptr);
+/// Perform a replacement of one iter OpOperand of an scf.for to the
+/// `replacement` value with a different type. A callback is used to insert
+/// cast ops inside the block to account for type differences.
+using ValueTypeCastFnTy =
+ std::function<Value(OpBuilder &, Location loc, Type, Value)>;
+SmallVector<Value> replaceAndCastForOpIterArg(RewriterBase &rewriter,
----------------
qedawkins wrote:
It feels like this helper should go in `SCF/Utils/Utils.h`, however that would introduce a circular dep because this was split out from a canonicalizer. Any suggestions for a better place for this helper?
https://github.com/llvm/llvm-project/pull/109585
More information about the Mlir-commits
mailing list