Skip to content

Commit f05137b

Browse files
nbpatelsilee2
andauthored
Update LLVM SHA (#541)
* Update LLVM SHA * BugFix: Use ShapedType::kDynamic instead of magic number "-1" for "?" Co-authored-by: [email protected] <Nishant Patel> Co-authored-by: Sang Ik Lee <[email protected]>
1 parent a63873a commit f05137b

File tree

5 files changed

+35
-22
lines changed

5 files changed

+35
-22
lines changed

build_tools/llvm_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
06e972ed91e6d173025dc122d202f546d1a5e8ce
1+
ac1ec9e2904a696e360b40572c3b3c29d67981ef

lib/Conversion/DistToStandard/DistToStandard.cpp

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,23 @@ struct RuntimePrototypesOpConverter
8585
auto dtypeType = rewriter.getIntegerType(sizeof(int) * 8);
8686
auto opType =
8787
rewriter.getIntegerType(sizeof(::imex::ptensor::ReduceOpId) * 8);
88-
requireFunc(loc, rewriter, module, "_idtr_init_dtensor",
89-
{::mlir::RankedTensorType::get({-1}, dtype), i64Type},
90-
{i64Type});
91-
requireFunc(loc, rewriter, module, "_idtr_local_shape",
92-
{i64Type, ::mlir::RankedTensorType::get({-1}, dtype), i64Type},
93-
{});
94-
requireFunc(loc, rewriter, module, "_idtr_local_offsets",
95-
{i64Type, ::mlir::RankedTensorType::get({-1}, dtype), i64Type},
96-
{});
88+
requireFunc(
89+
loc, rewriter, module, "_idtr_init_dtensor",
90+
{::mlir::RankedTensorType::get({::mlir::ShapedType::kDynamic}, dtype),
91+
i64Type},
92+
{i64Type});
93+
requireFunc(
94+
loc, rewriter, module, "_idtr_local_shape",
95+
{i64Type,
96+
::mlir::RankedTensorType::get({::mlir::ShapedType::kDynamic}, dtype),
97+
i64Type},
98+
{});
99+
requireFunc(
100+
loc, rewriter, module, "_idtr_local_offsets",
101+
{i64Type,
102+
::mlir::RankedTensorType::get({::mlir::ShapedType::kDynamic}, dtype),
103+
i64Type},
104+
{});
97105
requireFunc(loc, rewriter, module, "_idtr_reduce_all",
98106
{::mlir::RankedTensorType::get({}, dtype), dtypeType, opType},
99107
{});
@@ -117,10 +125,14 @@ struct RegisterPTensorOpConverter
117125
auto i64Rank = rewriter.create<::mlir::arith::IndexCastOp>(
118126
loc, rewriter.getI64Type(), rank);
119127
auto shapeTnsr = rewriter.create<::mlir::tensor::CastOp>(
120-
loc, ::mlir::RankedTensorType::get({-1}, rewriter.getIndexType()),
128+
loc,
129+
::mlir::RankedTensorType::get({::mlir::ShapedType::kDynamic},
130+
rewriter.getIndexType()),
121131
shape);
122132
auto i64Tnsr = rewriter.create<::mlir::arith::IndexCastOp>(
123-
loc, ::mlir::RankedTensorType::get({-1}, rewriter.getI64Type()),
133+
loc,
134+
::mlir::RankedTensorType::get({::mlir::ShapedType::kDynamic},
135+
rewriter.getI64Type()),
124136
shapeTnsr);
125137
auto fsa = rewriter.getStringAttr("_idtr_init_dtensor");
126138
rewriter.replaceOpWithNewOp<::mlir::func::CallOp>(

lib/Dialect/PTensor/Transforms/PTensorDist.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,10 @@ struct DistARange : public RecOpRewritePattern<::imex::ptensor::ARangeOp> {
189189
auto stop = rewriter.create<::mlir::arith::AddIOp>(
190190
loc, start, tmp2); // start + (lShape[0] * stride)
191191
// get type of local tensor
192-
::llvm::ArrayRef<int64_t> lShape({-1});
192+
::llvm::ArrayRef<int64_t> lShape({::mlir::ShapedType::kDynamic});
193193
auto artype = ::imex::ptensor::PTensorType::get(
194-
rewriter.getContext(), ::mlir::RankedTensorType::get({-1}, dtype),
194+
rewriter.getContext(),
195+
::mlir::RankedTensorType::get({::mlir::ShapedType::kDynamic}, dtype),
195196
false, false);
196197
// finally create local arange
197198
auto dmy = ::mlir::Value(); // createInt<1>(loc, rewriter, 0);

lib/Transforms/SetSPIRVCapabilities.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ struct SetSPIRVCapabilitiesPass
8383
auto triple = spirv::VerCapExtAttr::get(
8484
spirv::Version::V_1_0, caps_opencl, exts_opencl, context);
8585
auto attr = spirv::TargetEnvAttr::get(
86-
triple, spirv::Vendor::Unknown, spirv::DeviceType::Unknown,
87-
spirv::TargetEnvAttr::kUnknownDeviceID,
88-
spirv::getDefaultResourceLimits(context));
86+
triple, spirv::getDefaultResourceLimits(context),
87+
spirv::ClientAPI::OpenCL, spirv::Vendor::Unknown,
88+
spirv::DeviceType::Unknown, spirv::TargetEnvAttr::kUnknownDeviceID);
8989
auto op = getOperation();
9090
op->walk([&](mlir::gpu::GPUModuleOp op) {
9191
op->setAttr(spirv::getTargetEnvAttrName(), attr);
@@ -94,9 +94,9 @@ struct SetSPIRVCapabilitiesPass
9494
auto triple = spirv::VerCapExtAttr::get(
9595
spirv::Version::V_1_0, caps_vulkan, exts_vulkan, context);
9696
auto attr = spirv::TargetEnvAttr::get(
97-
triple, spirv::Vendor::Unknown, spirv::DeviceType::Unknown,
98-
spirv::TargetEnvAttr::kUnknownDeviceID,
99-
spirv::getDefaultResourceLimits(context));
97+
triple, spirv::getDefaultResourceLimits(context),
98+
spirv::ClientAPI::Vulkan, spirv::Vendor::Unknown,
99+
spirv::DeviceType::Unknown, spirv::TargetEnvAttr::kUnknownDeviceID);
100100
auto op = getOperation();
101101
op->walk([&](mlir::gpu::GPUModuleOp op) {
102102
op->setAttr(spirv::getTargetEnvAttrName(), attr);

test/Transforms/set-spirv-capability.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
module attributes {gpu.container_module} {
55

66
// OPENCL: module attributes {gpu.container_module} {
7-
// OPENCL: gpu.module @main_kernel attributes {spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [Addresses, Float16Buffer, Int64, Int16, Int8, Kernel, Linkage, Vector16, GenericPointer, Groups, Float16, Float64, AtomicFloat32AddEXT, ExpectAssumeKHR], [SPV_EXT_shader_atomic_float_add, SPV_KHR_expect_assume]>, #spirv.resource_limits<>>} {
7+
// OPENCL: gpu.module @main_kernel attributes {spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [Addresses, Float16Buffer, Int64, Int16, Int8, Kernel, Linkage, Vector16, GenericPointer, Groups, Float16, Float64, AtomicFloat32AddEXT, ExpectAssumeKHR], [SPV_EXT_shader_atomic_float_add, SPV_KHR_expect_assume]>, api=OpenCL, #spirv.resource_limits<>>} {
88
// VULKAN: module attributes {gpu.container_module} {
9-
// VULKAN: gpu.module @main_kernel attributes {spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, #spirv.resource_limits<>>} {
9+
// VULKAN: gpu.module @main_kernel attributes {spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [Shader], [SPV_KHR_storage_buffer_storage_class]>, api=Vulkan, #spirv.resource_limits<>>} {
1010
gpu.module @main_kernel {
1111
gpu.func @main_kernel(%arg0: memref<8xf32>, %arg1: memref<8xf32>, %arg2: memref<8xf32>) kernel attributes {spirv.entry_point_abi = #spirv.entry_point_abi<>} {
1212
cf.br ^bb1

0 commit comments

Comments
 (0)