Skip to content

Commit

Permalink
Integrate llvm-project at ac1ffd3caca1 and bump dependencies. (iree-o…
Browse files Browse the repository at this point in the history
…rg#11813)

- llvm-project: ac1ffd3caca1
- mlir-hlo: e802b722d88a2f80bd4fca6d82862d093fbc5401
- tensorflow: 3e2e312efcb74391897d7a948bd789e3a822b52f

cherry-pick llvm-project commits:
- 71c837f6d7d74e44f156ac60a47b1198727ba90f
- b4477dd8c5d1f9b27cc6d8f52106359e4f0afe66
- bdcba89356f8bf8ba0141875a150aba342a85416
- 4313b6f9ebc2556ff039249691a4dc619e32840c

Co-authored-by: Diego Caballero <[email protected]>
  • Loading branch information
hanhanW and dcaballe authored Jan 13, 2023
1 parent e937ab1 commit e9a5491
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ TileAndFuseDispatchUsingSCFForOp::returningMatchAndRewrite(
tileAndFuseResult.loops.append(tilingResult->loops);

// Get all ops to tile and fuse.
auto fusableProducersRef = llvm::makeArrayRef(fusableProducers);
auto fusableProducersRef = llvm::ArrayRef(fusableProducers);
while (!fusableProducersRef.empty()) {
auto fusableProducer = cast<TilingInterface>(fusableProducersRef.back());
fusableProducersRef = fusableProducersRef.drop_back();
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/iree/compiler/Codegen/Common/VectorizePad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ struct VectorizePadWithConditions final
[&](OpBuilder builder, Location Loc) {
Value read = builder.create<vector::TransferReadOp>(
loc, sliceVectorType, padOp.getSource(), readIndices,
paddingValue, llvm::makeArrayRef(inBounds));
paddingValue, llvm::ArrayRef(inBounds));
builder.create<scf::YieldOp>(loc, read);
},
[&](OpBuilder builder, Location Loc) {
Expand All @@ -206,7 +206,7 @@ struct VectorizePadWithConditions final
// Insert this slice back to the full vector.
fullVector = rewriter.create<vector::InsertStridedSliceOp>(
loc, ifOp.getResult(0), fullVector,
llvm::makeArrayRef(staticIndices).take_back(fullVectorType.getRank()),
llvm::ArrayRef(staticIndices).take_back(fullVectorType.getRank()),
staticStrides);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ llvm::SmallVector<unsigned> getPartitionableLoopsImpl(
if (maxNumPartitionedLoops.has_value() &&
parallelLoops.size() > maxNumPartitionedLoops.value()) {
parallelLoops =
llvm::to_vector(llvm::makeArrayRef(parallelLoops)
llvm::to_vector(llvm::ArrayRef(parallelLoops)
.take_back(maxNumPartitionedLoops.value()));
}
return parallelLoops;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct CreateFastSlowPath final : public OpRewritePattern<scf::ForOp> {
}
}
Value ifCond = eqZeroCmpVals.front();
for (Value cmp : llvm::makeArrayRef(eqZeroCmpVals).drop_front())
for (Value cmp : llvm::ArrayRef(eqZeroCmpVals).drop_front())
ifCond = rewriter.create<arith::AndIOp>(loc, ifCond, cmp);

SmallVector<Operation *> cloneOps;
Expand Down
3 changes: 1 addition & 2 deletions compiler/src/iree/compiler/Codegen/SPIRV/SPIRVEmulateI64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ static VectorType flattenVectorType(Type type) {
if (vecTy.isScalable() || vecTy.getRank() <= 1) return nullptr;

int64_t totalElements = vecTy.getNumElements();
return VectorType::get(llvm::makeArrayRef(totalElements),
vecTy.getElementType());
return VectorType::get(llvm::ArrayRef(totalElements), vecTy.getElementType());
}

// Flattens 2+-D elementwise vector ops into ops over 1-D vectors by inserting
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/iree/compiler/Codegen/Utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ Operation *createLinalgCopyOp(OpBuilder &b, Location loc, Value from, Value to,
loc,
/*inputs=*/from,
/*outputs=*/to,
/*indexingMaps=*/llvm::makeArrayRef({id, id}),
/*indexingMaps=*/llvm::ArrayRef({id, id}),
/*iteratorTypes=*/iteratorTypes,
[](OpBuilder &b, Location loc, ValueRange args) {
b.create<linalg::YieldOp>(loc, args.front());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class MetalSPIRVTargetBackend : public TargetBackend {
for (const auto &entryPoint : entryPointNames) {
llvm::Optional<MetalShader> mslShader = crossCompileSPIRVToMSL(
// We can use ArrayRef here given spvBinary reserves 0 bytes on stack.
llvm::makeArrayRef(spvBinary.data(), spvBinary.size()), entryPoint);
llvm::ArrayRef(spvBinary.data(), spvBinary.size()), entryPoint);
if (!mslShader) {
return variantOp.emitError()
<< "failed to cross compile SPIR-V to Metal shader";
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/iree/compiler/Dialect/Util/IR/ClosureOpUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void excludeClosureOperandsAndResults(
SmallVector<Value, 4> oldOperandDims = operandDims;
operandValues.clear();
operandDims.clear();
auto remainingOperandDims = llvm::makeArrayRef(oldOperandDims);
auto remainingOperandDims = llvm::ArrayRef(oldOperandDims);
for (auto it : llvm::enumerate(oldOperandValues)) {
unsigned numDynamicDims = 0;
auto type = it.value().getType();
Expand All @@ -71,7 +71,7 @@ void excludeClosureOperandsAndResults(
SmallVector<Value, 4> oldResultDims = resultDims;
resultTypes.clear();
resultDims.clear();
auto remainingResultDims = llvm::makeArrayRef(oldResultDims);
auto remainingResultDims = llvm::ArrayRef(oldResultDims);
for (auto it : llvm::enumerate(oldResultTypes)) {
unsigned numDynamicDims = 0;
auto type = it.value();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ struct FoldBlockArgumentsPattern
region.getBlocks().end())) {
unsigned numArgs = block.getNumArguments();
if (numArgs == 0) continue;
auto blockSources = llvm::makeArrayRef(blockSourceMap[&block]);
auto blockSources = llvm::ArrayRef(blockSourceMap[&block]);
if (blockSources.size() == 0) continue;

// Which args we'll end up erasing.
Expand Down Expand Up @@ -211,7 +211,7 @@ struct ElideBranchOperandsPattern
region.getBlocks().end())) {
unsigned numArgs = block.getNumArguments();
if (numArgs == 0) continue;
auto blockSources = llvm::makeArrayRef(blockSourceMap[&block]);
auto blockSources = llvm::ArrayRef(blockSourceMap[&block]);
if (blockSources.size() == 0) continue;

// Which args we'll end up erasing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Value broadcast(OpBuilder &builder, Location loc, Value operand,
auto generic = builder.create<linalg::GenericOp>(
loc, TypeRange{init.getType()}, ValueRange{operand},
/*outputBuffers=*/ValueRange{init},
llvm::makeArrayRef({
llvm::ArrayRef({
AffineMap::get(/*dimCount=*/nloops, /*symbolCount=*/0, dimExprs,
builder.getContext()),
builder.getMultiDimIdentityMap(nloops),
Expand Down
2 changes: 1 addition & 1 deletion integrations/tensorflow/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

TENSORFLOW_COMMIT = "8dfaeff87fd1493ea974afd41454c9fc843758b8"
TENSORFLOW_COMMIT = "3e2e312efcb74391897d7a948bd789e3a822b52f"

git_repository(
name = "org_tensorflow",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ struct AllDimsExcept {
explicit AllDimsExcept(std::initializer_list<int64_t> range) {
llvm::append_range(exceptions, range);
}
ArrayRef<int64_t> getExcluded() const {
return llvm::makeArrayRef(exceptions);
}
ArrayRef<int64_t> getExcluded() const { return llvm::ArrayRef(exceptions); }

private:
SmallVector<int64_t> exceptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ transform_ext::MatchCallbackResult::getPayloadGroup(int64_t position) const {
for (int64_t i = 0; i < position; ++i) {
start += payloadGroupLengths[i];
}
return llvm::makeArrayRef(payloadOperations)
return llvm::ArrayRef(payloadOperations)
.slice(start, payloadGroupLengths[position]);
}

Expand Down
2 changes: 1 addition & 1 deletion third_party/llvm-project
2 changes: 1 addition & 1 deletion third_party/mlir-hlo

0 comments on commit e9a5491

Please sign in to comment.