Skip to content

Commit 9a736e8

Browse files
swote-gitjoker-eph
andauthored
[MLIR] Clarify createOrFold() doc as opportunistic eager folding (#160565)
This addresses user confusion about createOrFold behavior compared to canonicalization passes, as discussed in #159844. --------- Co-authored-by: Mehdi Amini <[email protected]>
1 parent bef2658 commit 9a736e8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mlir/include/mlir/IR/Builders.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,12 @@ class OpBuilder : public Builder {
515515
/// Create an operation of specific op type at the current insertion point,
516516
/// and immediately try to fold it. This functions populates 'results' with
517517
/// the results of the operation.
518+
///
519+
/// Note: This performs opportunistic eager folding during IR construction.
520+
/// The folders are designed to operate efficiently on canonical IR, which
521+
/// this API does not enforce. Complete folding isn't only expected in the
522+
/// context of canonicalization which intertwine folders with pattern
523+
/// rewrites until fixed-point.
518524
template <typename OpTy, typename... Args>
519525
void createOrFold(SmallVectorImpl<Value> &results, Location location,
520526
Args &&...args) {

0 commit comments

Comments
 (0)