[Mlir-commits] [mlir] [mlir][vector] Add pattern for dropping unit dims from for loops (PR #109585)
Quinn Dawkins
llvmlistbot at llvm.org
Thu Sep 26 15:10:32 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,
+ scf::ForOp forOp,
+ OpOperand &operand,
----------------
qedawkins wrote:
There's no copy constructor for `OpOperand` and `operand.getOperandNumber()` is non-const so I think it has to be `OpOperand &`. Maybe it is a bug that `getOperandNumber` is non-const, but I'm not familiar with that code.
https://github.com/llvm/llvm-project/pull/109585
More information about the Mlir-commits
mailing list