Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[broken][IREE] Update IREE submodule and make compile (but not pass CI). #644

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions include/Dialect/VectorExt/VectorExtOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class VectorExt_Op<string mnemonic, list<Trait> traits = []> :

def VectorExt_PredicateOp : VectorExt_Op<"predicate",
[DeclareOpInterfaceMethods<RegionBranchOpInterface>,
SingleBlockImplicitTerminator<"vector_ext::YieldOp">, RecursiveSideEffects]> {
SingleBlockImplicitTerminator<"vector_ext::YieldOp">,
RecursiveMemoryEffects]> {
let summary = "vector.predicate operation";
let description = [{ TODO }];

Expand All @@ -43,7 +44,7 @@ def VectorExt_PredicateOp : VectorExt_Op<"predicate",
}

def VectorExt_YieldOp : VectorExt_Op<"yield", [
NoSideEffect, ReturnLike, Terminator]> {
NoMemoryEffect, ReturnLike, Terminator]> {
let summary = "VectorExt yield op";
let description = [{
`vector_ext.yield` is a special terminator operation for blocks inside
Expand Down
16 changes: 8 additions & 8 deletions lib/Dialect/VectorExt/IR/VectorExtOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void mlir::vector_ext::buildTerminatedBody(OpBuilder &builder, Location loc) {
void PredicateOp::build(OpBuilder &builder, OperationState &result,
Value predicateMask, ValueRange indices,
Value incomingMask) {
build(builder, result, /*resultTypes=*/llvm::None, predicateMask, indices,
build(builder, result, /*resultTypes=*/std::nullopt, predicateMask, indices,
incomingMask);
}

Expand Down Expand Up @@ -100,22 +100,22 @@ ParseResult mlir::vector_ext::PredicateOp::parse(OpAsmParser &parser,
void mlir::vector_ext::PredicateOp::print(OpAsmPrinter &p) {
bool printBlockTerminators = false;

p << "(" << predicateMask() << ", [" << indices() << "], " << incomingMask()
<< ") : " << predicateMask().getType();
if (!results().empty()) {
p << "(" << getPredicateMask() << ", [" << getIndices() << "], "
<< getIncomingMask() << ") : " << getPredicateMask().getType();
if (!getResults().empty()) {
p << " -> (" << getResultTypes() << ")";
// Print yield explicitly if the op defines values.
printBlockTerminators = true;
}
p << " ";
p.printRegion(truePredicateRegion(),
p.printRegion(getTruePredicateRegion(),
/*printEntryBlockArgs=*/true,
/*printBlockTerminators=*/printBlockTerminators);

p.printOptionalAttrDict(getOperation()->getAttrs());
}

/// Given the region at `index`, or the parent operation if `index` is None,
/// Given the region at `index`, or the parent operation if `index` is nullopt,
/// return the successor regions. These are the regions that may be selected
/// during the flow of control. `operands` is a set of optional attributes that
/// correspond to a constant value for each operand, or null if that operand is
Expand All @@ -124,15 +124,15 @@ void PredicateOp::getSuccessorRegions(
Optional<unsigned> index, ArrayRef<Attribute> operands,
SmallVectorImpl<RegionSuccessor> &regions) {
// The `truePredicate` region branch back to the parent operation.
if (index.hasValue()) {
if (index.has_value()) {
regions.push_back(RegionSuccessor(getResults()));
return;
}

// The `truePredicate` (and the future `falsePredicate` region) will always
// be executed regardless of the condition since they are not modeling control
// but data flow.
regions.push_back(RegionSuccessor(&truePredicateRegion()));
regions.push_back(RegionSuccessor(&getTruePredicateRegion()));
}

#define GET_OP_CLASSES
Expand Down
14 changes: 7 additions & 7 deletions lib/Dialect/VectorExt/Transform/VectorMaskingUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "Dialect/VectorExt/VectorMaskingUtils.h"
#include "Dialect/VectorExt/VectorExtOps.h"
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/AffineMap.h"
Expand Down Expand Up @@ -77,7 +77,7 @@ Optional<PredicateOp> mlir::vector_ext::predicateOp(
Optional<Value> maybeIncomingMask) {
// TODO: Support multi-block regions.
if (!regionToPredicate->hasOneBlock())
return llvm::None;
return std::nullopt;

// Compute the range of operations that will be moved within vector.predicate
// and the definitions within the range with users outside the range.
Expand All @@ -95,7 +95,7 @@ Optional<PredicateOp> mlir::vector_ext::predicateOp(
builder.setInsertionPointToStart(&blockToPredicate);
Value predicateMask = createPredicateMask(builder);
if (!predicateMask)
return llvm::None;
return std::nullopt;

// Generate the vector.predicate operation and move 'opsToMove' within its
// truePredicateRegion. We have to rewire the def-use chain for those
Expand All @@ -113,7 +113,7 @@ Optional<PredicateOp> mlir::vector_ext::predicateOp(
en.value().replaceAllUsesWith(vecPredOp.getResult(en.index()));

Operation *truePredTerminator =
&vecPredOp.truePredicateRegion().front().back();
&vecPredOp.getTruePredicateRegion().front().back();
moveOperationsBefore(opsToMove, truePredTerminator);

// The existing terminator of TruePredicateRegion doesn't yield any value.
Expand All @@ -140,9 +140,9 @@ static void maskPredicateOp(OpBuilder &builder, PredicateOp predOp,
// Actions before visiting the TruePredicateRegion: Generate the new active
// mask (= predicate_mask & incoming_mask) influencing the region.
if (stage.isBeforeAllRegions()) {
builder.setInsertionPointToStart(&predOp.truePredicateRegion().front());
builder.setInsertionPointToStart(&predOp.getTruePredicateRegion().front());
Value trueMask = builder.create<arith::AndIOp>(
predOp.getLoc(), predOp.incomingMask(), predOp.predicateMask());
predOp.getLoc(), predOp.getIncomingMask(), predOp.getPredicateMask());
activeMasks.push_back(trueMask);
return;
}
Expand All @@ -167,7 +167,7 @@ static void maskPredicateOp(OpBuilder &builder, PredicateOp predOp,

// Inline truePredicateRegion into parent op (except its terminator).
// TODO: Move this to builder.inlineRegionBefore?
auto &blocksToMove = predOp.truePredicateRegion().getBlocks();
auto &blocksToMove = predOp.getTruePredicateRegion().getBlocks();
assert(blocksToMove.size() == 1 && "Expected only one block");
assert(predOp.getResults().empty() &&
"TODO: Support vector.predicate with results");
Expand Down
2 changes: 1 addition & 1 deletion third_party/iree
Submodule iree updated from 853dd6 to badd59