Skip to content
Open
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
27 changes: 0 additions & 27 deletions include/triton-shared/Dialect/TPtr/IR/TPtrDialect.td
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,9 @@ def TPtr_Dialect : Dialect {
Typed Pointer Dialect.
}];

let extraClassDeclaration = [{
void registerTypes();
}];

let dependentDialects = [
"mlir::ptr::PtrDialect"
];

let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 1;
}

class TPtrTypeDef<string name, string _mnemonic, list<Trait> traits = []>
: TypeDef<TPtr_Dialect, name, traits> {
// Used by printer/parser
let mnemonic = _mnemonic;
}

class TPtr_Attr<string name, string _mnemonic,
list<Trait> traits = []>
: AttrDef<TPtr_Dialect, name, traits> {
let mnemonic = _mnemonic;
}

// Memory space attr is required for building Ptr ops
// This acts as default memory space since there is
// no such default implemented upstream
def DefaultMemorySpaceAttr
: TPtr_Attr<"DefaultMemorySpace", "default_memory_space",
[DeclareAttrInterfaceMethods<MemorySpaceAttrInterface>]> {
}

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "mlir/Conversion/ReconcileUnrealizedCasts/ReconcileUnrealizedCasts.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/Ptr/IR/PtrAttrs.h"
#include "mlir/Dialect/Ptr/IR/PtrTypes.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinDialect.h"
Expand Down Expand Up @@ -95,9 +96,8 @@ struct FromMemrefConverter
input);
auto memrefToPtr = rewriter.create<tptr::FromMemrefOp>(
op->getLoc(),
ptr::PtrType::get(
rewriter.getContext(),
tptr::DefaultMemorySpaceAttr::get(rewriter.getContext())),
ptr::PtrType::get(rewriter.getContext(),
ptr::GenericSpaceAttr::get(rewriter.getContext())),
rankedMemref);

rewriter.replaceAllUsesWith(output, memrefToPtr);
Expand Down
22 changes: 9 additions & 13 deletions lib/Conversion/TritonToLinalgExperimental/TritonToPtrPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/Ptr/IR/PtrAttrs.h"
#include "mlir/Dialect/Ptr/IR/PtrDialect.h"
#include "mlir/Dialect/Ptr/IR/PtrTypes.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
Expand Down Expand Up @@ -98,9 +99,8 @@ struct EmptyTensorConverter : public OpConversionPattern<tensor::EmptyOp> {
ConversionPatternRewriter &rewriter) const override {
rewriter.replaceOpWithNewOp<tensor::EmptyOp>(
op, op.getType().getShape(),
ptr::PtrType::get(
rewriter.getContext(),
tptr::DefaultMemorySpaceAttr::get(rewriter.getContext())));
ptr::PtrType::get(rewriter.getContext(),
ptr::GenericSpaceAttr::get(rewriter.getContext())));
return success();
}
};
Expand Down Expand Up @@ -187,9 +187,8 @@ struct AddPtrConverter : public OpConversionPattern<triton::AddPtrOp> {
rewriter.create<arith::MulIOp>(loc, op.getOffset(), pointeeSizeInBytes);
rewriter.replaceOpWithNewOp<tptr::PtrAddOp>(
op,
ptr::PtrType::get(
rewriter.getContext(),
tptr::DefaultMemorySpaceAttr::get(rewriter.getContext())),
ptr::PtrType::get(rewriter.getContext(),
ptr::GenericSpaceAttr::get(rewriter.getContext())),
adaptor.getPtr(), scaledOffset);
return success();
}
Expand Down Expand Up @@ -325,9 +324,8 @@ struct IntToPtrConverter : public OpConversionPattern<triton::IntToPtrOp> {
}
rewriter.replaceOpWithNewOp<tptr::IntToPtrOp>(
op,
ptr::PtrType::get(
rewriter.getContext(),
tptr::DefaultMemorySpaceAttr::get(rewriter.getContext())),
ptr::PtrType::get(rewriter.getContext(),
ptr::GenericSpaceAttr::get(rewriter.getContext())),
adaptor.getSrc());
return success();
}
Expand Down Expand Up @@ -417,15 +415,13 @@ class TritonPtrTypeConverter : public TypeConverter {
TritonPtrTypeConverter(MLIRContext *context) {
addConversion([](Type type) { return type; });
addConversion([context](triton::PointerType ptrType) {
return ptr::PtrType::get(context,
tptr::DefaultMemorySpaceAttr::get(context));
return ptr::PtrType::get(context, ptr::GenericSpaceAttr::get(context));
});
addConversion([context](RankedTensorType tensorType) {
if (isa<triton::PointerType>(tensorType.getElementType())) {
return RankedTensorType::get(
tensorType.getShape(),
ptr::PtrType::get(context,
tptr::DefaultMemorySpaceAttr::get(context)));
ptr::PtrType::get(context, ptr::GenericSpaceAttr::get(context)));
}
return tensorType;
});
Expand Down
48 changes: 0 additions & 48 deletions lib/Dialect/TPtr/IR/TPtrDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,64 +29,16 @@ void printIntType(OpAsmPrinter &p, Operation *op, Type ty) {
//===----------------------------------------------------------------------===//
// Dialect
//===----------------------------------------------------------------------===//
void mlir::tptr::TPtrDialect::registerTypes() {
addTypes<
#define GET_TYPEDEF_LIST
#include "triton-shared/Dialect/TPtr/IR/TPtrTypes.cpp.inc"
>();
}

/// Dialect creation, the instance will be owned by the context. This is the
/// point of registration of custom types and operations for the dialect.
void mlir::tptr::TPtrDialect::initialize() {
addAttributes<
#define GET_ATTRDEF_LIST
#include "triton-shared/Dialect/TPtr/IR/TPtrAttributes.cpp.inc"
>();
registerTypes();
addOperations<
#define GET_OP_LIST
#include "triton-shared/Dialect/TPtr/IR/TPtrOps.cpp.inc"
>();
}

bool tptr::DefaultMemorySpaceAttr::isValidLoad(
Type type, mlir::ptr::AtomicOrdering ordering, IntegerAttr alignment,
llvm::function_ref<InFlightDiagnostic()> emitError) const {
return true;
}

bool tptr::DefaultMemorySpaceAttr::isValidStore(
Type type, mlir::ptr::AtomicOrdering ordering, IntegerAttr alignment,
llvm::function_ref<InFlightDiagnostic()> emitError) const {
return true;
}

bool tptr::DefaultMemorySpaceAttr::isValidAtomicOp(
mlir::ptr::AtomicBinOp binOp, Type type, mlir::ptr::AtomicOrdering ordering,
IntegerAttr alignment,
llvm::function_ref<InFlightDiagnostic()> emitError) const {
return true;
}

bool tptr::DefaultMemorySpaceAttr::isValidAtomicXchg(
Type type, mlir::ptr::AtomicOrdering successOrdering,
mlir::ptr::AtomicOrdering failureOrdering, IntegerAttr alignment,
llvm::function_ref<InFlightDiagnostic()> emitError) const {
return true;
}

bool tptr::DefaultMemorySpaceAttr::isValidAddrSpaceCast(
Type tgt, Type src,
llvm::function_ref<InFlightDiagnostic()> emitError) const {
return true;
}

bool tptr::DefaultMemorySpaceAttr::isValidPtrIntCast(
Type intLikeTy, Type ptrLikeTy,
llvm::function_ref<InFlightDiagnostic()> emitError) const {
return true;
}
//===----------------------------------------------------------------------===//
// TableGen'd op method definitions
//===----------------------------------------------------------------------===//
Expand Down
12 changes: 6 additions & 6 deletions test/Conversion/ReconcilePtrCasts/ptr_into_memref.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ module {
%c1_i32 = arith.constant 1 : i32
%c2 = arith.constant 2 : index
%1 = builtin.unrealized_conversion_cast %arg1 : memref<*xi32> to !tt.ptr<i32>
%2 = builtin.unrealized_conversion_cast %1 : !tt.ptr<i32> to !ptr.ptr<#tptr.default_memory_space>
%2 = builtin.unrealized_conversion_cast %1 : !tt.ptr<i32> to !ptr.ptr<#ptr.generic_space>
%3 = builtin.unrealized_conversion_cast %arg0 : memref<*xi32> to !tt.ptr<i32>
%4 = builtin.unrealized_conversion_cast %3 : !tt.ptr<i32> to !ptr.ptr<#tptr.default_memory_space>
%4 = builtin.unrealized_conversion_cast %3 : !tt.ptr<i32> to !ptr.ptr<#ptr.generic_space>
%5 = arith.muli %c1_i32, %0 : i32
%6 = tptr.ptradd %4 %5 : !ptr.ptr<#tptr.default_memory_space>, i32 to !ptr.ptr<#tptr.default_memory_space>
%7 = builtin.unrealized_conversion_cast %6 : !ptr.ptr<#tptr.default_memory_space> to !tt.ptr<i64>
%6 = tptr.ptradd %4 %5 : !ptr.ptr<#ptr.generic_space>, i32 to !ptr.ptr<#ptr.generic_space>
%7 = builtin.unrealized_conversion_cast %6 : !ptr.ptr<#ptr.generic_space> to !tt.ptr<i64>
%8 = builtin.unrealized_conversion_cast %7 : !tt.ptr<i64> to memref<*xi64>
%reinterpret_cast = memref.reinterpret_cast %8 to offset: [%c2], sizes: [16], strides: [1] : memref<*xi64> to memref<16xi64, strided<[1], offset: ?>>
%alloc = memref.alloc() : memref<16xi64>
memref.copy %reinterpret_cast, %alloc : memref<16xi64, strided<[1], offset: ?>> to memref<16xi64>
%9 = bufferization.to_tensor %alloc restrict writable : memref<16xi64> to tensor<16xi64>
%10 = tptr.ptradd %2 %5 : !ptr.ptr<#tptr.default_memory_space>, i32 to !ptr.ptr<#tptr.default_memory_space>
%11 = builtin.unrealized_conversion_cast %10 : !ptr.ptr<#tptr.default_memory_space> to !tt.ptr<i64>
%10 = tptr.ptradd %2 %5 : !ptr.ptr<#ptr.generic_space>, i32 to !ptr.ptr<#ptr.generic_space>
%11 = builtin.unrealized_conversion_cast %10 : !ptr.ptr<#ptr.generic_space> to !tt.ptr<i64>
%12 = builtin.unrealized_conversion_cast %11 : !tt.ptr<i64> to memref<*xi64>
%reinterpret_cast_0 = memref.reinterpret_cast %12 to offset: [%c2], sizes: [16], strides: [1] : memref<*xi64> to memref<16xi64, strided<[1], offset: ?>>
bufferization.materialize_in_destination %9 in writable %reinterpret_cast_0 : (tensor<16xi64>, memref<16xi64, strided<[1], offset: ?>>) -> ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ module {
// CHECK-DAG: [[CST_1_:%.+]] = arith.constant 1 : i32
// CHECK-DAG: [[VAR_cast_:%.+]] = memref.cast [[PARAM_0_]] : memref<*xf32> to memref<1xf32>
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_1_:%.+]] = tptr.from_memref [[VAR_cast_]] : memref<1xf32> to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_1_:%.+]] = tptr.from_memref [[VAR_cast_]] : memref<1xf32> to <#ptr.generic_space>
// CHECK-DAG: [[VAR_2_:%.+]] = arith.cmpi eq, [[PARAM_2_]], [[CST_1_]] : i32
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_3_:%.+]] = scf.if [[VAR_2_]] -> (!ptr.ptr<#tptr.default_memory_space>) {
// CHECK-DAG: [[VAR_3_:%.+]] = scf.if [[VAR_2_]] -> (!ptr.ptr<#ptr.generic_space>) {
// CHECK-DAG: [[VAR_6_:%.+]] = arith.muli [[PARAM_2_]], [[CST_2_]] : i32
// CHECK: [[VAR_7_:%.+]] = arith.muli [[VAR_6_]], [[VAR_0_]] : i32
// CHECK: [[VAR_8_:%.+]] = tptr.ptradd [[VAR_1_]] [[VAR_7_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK: scf.yield [[VAR_8_]] : !ptr.ptr<#tptr.default_memory_space>
// CHECK: [[VAR_8_:%.+]] = tptr.ptradd [[VAR_1_]] [[VAR_7_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK: scf.yield [[VAR_8_]] : !ptr.ptr<#ptr.generic_space>
// CHECK: } else {
// CHECK: [[VAR_6_1_:%.+]] = arith.muli [[PARAM_2_]], [[VAR_0_]] : i32
// CHECK: [[VAR_7_1_:%.+]] = tptr.ptradd [[VAR_1_]] [[VAR_6_1_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK: scf.yield [[VAR_7_1_]] : !ptr.ptr<#tptr.default_memory_space>
// CHECK: [[VAR_7_1_:%.+]] = tptr.ptradd [[VAR_1_]] [[VAR_6_1_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK: scf.yield [[VAR_7_1_]] : !ptr.ptr<#ptr.generic_space>
// CHECK: }
// CHECK: [[VAR_4_:%.+]] = tptr.to_memref [[VAR_3_]] : <#tptr.default_memory_space> to memref<1xf32>
// CHECK: [[VAR_4_:%.+]] = tptr.to_memref [[VAR_3_]] : <#ptr.generic_space> to memref<1xf32>
// CHECK-DAG: [[VAR_reinterpret_cast_:%.+]] = memref.reinterpret_cast [[VAR_4_]] to offset: {{.}}[[CST_6_]]{{.}}, sizes: [4], strides: [1] : memref<1xf32> to memref<4xf32, strided<[1], offset: ?>>
// CHECK-DAG: [[RES_:%.+]] = memref.alloc() : memref<4xf32>
// CHECK: memref.copy [[VAR_reinterpret_cast_]], [[RES_]] : memref<4xf32, strided<[1], offset: ?>> to memref<4xf32>
Expand Down
38 changes: 19 additions & 19 deletions test/Conversion/TritonToPtr/cast_with_int_ptr.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -55,49 +55,49 @@ module {
// CHECK-DAG: [[CST_2_:%.+]] = arith.constant 2 : i32
// CHECK-DAG: [[CST_3_:%.+]] = arith.constant 3 : i32
// CHECK-DAG: [[CST_4_:%.+]] = arith.constant 4 : i32
// CHECK-DAG: [[VAR_5_:%.+]] = builtin.unrealized_conversion_cast [[PARAM_1_]] : !tt.ptr<i32> to !ptr.ptr<#tptr.default_memory_space>
// CHECK-DAG: [[VAR_6_:%.+]] = builtin.unrealized_conversion_cast [[PARAM_0_]] : !tt.ptr<i32> to !ptr.ptr<#tptr.default_memory_space>
// CHECK-DAG: [[VAR_5_:%.+]] = builtin.unrealized_conversion_cast [[PARAM_1_]] : !tt.ptr<i32> to !ptr.ptr<#ptr.generic_space>
// CHECK-DAG: [[VAR_6_:%.+]] = builtin.unrealized_conversion_cast [[PARAM_0_]] : !tt.ptr<i32> to !ptr.ptr<#ptr.generic_space>
// CHECK: [[VAR_7_:%.+]] = arith.muli [[CST_111_]], [[VAR_4_]] : i32
// CHECK-DAG: [[VAR_8_:%.+]] = tptr.ptradd [[VAR_6_]] [[VAR_7_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_8_:%.+]] = tptr.ptradd [[VAR_6_]] [[VAR_7_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_9_:%.+]] = arith.muli [[CST_10_]], [[VAR_3_]] : i32
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_10_:%.+]] = tptr.ptradd [[VAR_8_]] [[VAR_9_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_11_:%.+]] = tptr.ptrtoint [[VAR_5_]] : <#tptr.default_memory_space> to i64
// CHECK-DAG: [[VAR_10_:%.+]] = tptr.ptradd [[VAR_8_]] [[VAR_9_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_11_:%.+]] = tptr.ptrtoint [[VAR_5_]] : <#ptr.generic_space> to i64
// CHECK: [[VAR_12_:%.+]] = arith.muli [[VAR_11_]], [[VAR_2_]] : i64
// CHECK-DAG: [[VAR_13_:%.+]] = tptr.ptradd [[VAR_5_]] [[VAR_12_]] : <#tptr.default_memory_space>, i64 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_13_:%.+]] = tptr.ptradd [[VAR_5_]] [[VAR_12_]] : <#ptr.generic_space>, i64 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_14_:%.+]] = arith.muli [[CST_9_]], [[VAR_4_]] : i32
// CHECK: [[VAR_15_:%.+]] = tptr.ptradd [[VAR_13_]] [[VAR_14_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK: [[VAR_16_:%.+]] = tptr.ptrtoint [[VAR_15_]] : <#tptr.default_memory_space> to i64
// CHECK: [[VAR_15_:%.+]] = tptr.ptradd [[VAR_13_]] [[VAR_14_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK: [[VAR_16_:%.+]] = tptr.ptrtoint [[VAR_15_]] : <#ptr.generic_space> to i64
// CHECK-DAG: [[VAR_17_:%.+]] = arith.remsi [[VAR_16_]], [[CST_10_1_]] : i64
// CHECK-DAG: [[VAR_18_:%.+]] = arith.muli [[CST_1_]], [[VAR_4_]] : i32
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_19_:%.+]] = tptr.ptradd [[VAR_10_]] [[VAR_18_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_19_:%.+]] = tptr.ptradd [[VAR_10_]] [[VAR_18_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_20_:%.+]] = arith.muli [[VAR_17_]], [[VAR_2_]] : i64
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_21_:%.+]] = tptr.ptradd [[VAR_19_]] [[VAR_20_]] : <#tptr.default_memory_space>, i64 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_21_:%.+]] = tptr.ptradd [[VAR_19_]] [[VAR_20_]] : <#ptr.generic_space>, i64 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_22_:%.+]] = arith.muli [[CST_2_]], [[VAR_1_]] : i32
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_23_:%.+]] = tptr.ptradd [[VAR_21_]] [[VAR_22_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_23_:%.+]] = tptr.ptradd [[VAR_21_]] [[VAR_22_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_24_:%.+]] = arith.muli [[PARAM_2_]], [[VAR_1_]] : i32
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_25_:%.+]] = tptr.ptradd [[VAR_23_]] [[VAR_24_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_25_:%.+]] = tptr.ptradd [[VAR_23_]] [[VAR_24_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_26_:%.+]] = arith.muli [[CST_3_]], [[VAR_1_]] : i32
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_27_:%.+]] = tptr.ptradd [[VAR_25_]] [[VAR_26_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_27_:%.+]] = tptr.ptradd [[VAR_25_]] [[VAR_26_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_28_:%.+]] = arith.muli [[CST_4_]], [[VAR_0_]] : i32
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_29_:%.+]] = tptr.ptradd [[VAR_27_]] [[VAR_28_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_29_:%.+]] = tptr.ptradd [[VAR_27_]] [[VAR_28_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_30_:%.+]] = arith.muli [[PARAM_2_]], [[VAR_0_]] : i32
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_31_:%.+]] = tptr.ptradd [[VAR_29_]] [[VAR_30_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK-DAG: [[VAR_31_:%.+]] = tptr.ptradd [[VAR_29_]] [[VAR_30_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK-DAG: [[VAR_32_:%.+]] = arith.muli [[CST_3_]], [[VAR_0_]] : i32
// CHECK: [[VAR_33_:%.+]] = tptr.ptradd [[VAR_31_]] [[VAR_32_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
// CHECK: [[VAR_34_:%.+]] = tptr.to_memref [[VAR_33_]] : <#tptr.default_memory_space> to memref<1xi32>
// CHECK: [[VAR_33_:%.+]] = tptr.ptradd [[VAR_31_]] [[VAR_32_]] : <#ptr.generic_space>, i32 to <#ptr.generic_space>
// CHECK: [[VAR_34_:%.+]] = tptr.to_memref [[VAR_33_]] : <#ptr.generic_space> to memref<1xi32>
// CHECK-DAG: [[LOAD_VAR_34_MEM_:%.+]] = memref.load [[VAR_34_]]{{.}}[[CST_0_]]{{.}} : memref<1xi32>
// CHECK-DAG: [[VAR_36_:%.+]] = arith.extsi [[PARAM_2_]] : i32 to i64
// CHECK: [[VAR_37_:%.+]] = arith.addi [[VAR_17_]], [[VAR_36_]] : i64
// CHECK: [[VAR_38_:%.+]] = tptr.inttoptr [[VAR_37_]] : i64 to <#tptr.default_memory_space>
// CHECK: [[VAR_39_:%.+]] = tptr.to_memref [[VAR_38_]] : <#tptr.default_memory_space> to memref<1xi32>
// CHECK: [[VAR_38_:%.+]] = tptr.inttoptr [[VAR_37_]] : i64 to <#ptr.generic_space>
// CHECK: [[VAR_39_:%.+]] = tptr.to_memref [[VAR_38_]] : <#ptr.generic_space> to memref<1xi32>
// CHECK: memref.store [[LOAD_VAR_34_MEM_]], [[VAR_39_]]{{.}}[[CST_0_]]{{.}} : memref<1xi32>
// CHECK: return
// CHECK: }
Loading