File tree Expand file tree Collapse file tree
lib/Conversion/ForthToMemRef
test/Conversion/ForthToMemRef Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111#include " mlir/Dialect/Func/Transforms/FuncConversions.h"
1212#include " mlir/Dialect/GPU/IR/GPUDialect.h"
1313#include " mlir/Dialect/LLVMIR/LLVMDialect.h"
14+ #include " mlir/Dialect/LLVMIR/NVVMDialect.h"
1415#include " mlir/Dialect/MemRef/IR/MemRef.h"
1516#include " mlir/IR/BuiltinTypes.h"
1617#include " mlir/IR/PatternMatch.h"
@@ -28,8 +29,9 @@ namespace {
2829
2930// Stack configuration constants
3031constexpr int64_t kStackSize = 256 ;
32+ // NVPTX shared memory address space for LLVM ptr types.
3133constexpr unsigned kWorkgroupAddressSpace =
32- static_cast <unsigned >(gpu::AddressSpace::Workgroup );
34+ static_cast <unsigned >(NVVM:: kSharedMemorySpace );
3335
3436// / Type converter for forth.stack -> memref + index
3537class ForthToMemRefTypeConverter : public TypeConverter {
Original file line number Diff line number Diff line change 1616// CHECK: llvm.store %{{.*}}, %{{.*}} : i64, !llvm.ptr
1717
1818// shared load (S@): pop address, inttoptr shared addrspace, llvm.load
19- // CHECK: llvm.inttoptr %{{.*}} : i64 to !llvm.ptr<{{[1-9][0-9]*}} >
20- // CHECK: llvm.load %{{.*}} : !llvm.ptr<{{[1-9][0-9]*}} > -> i64
19+ // CHECK: llvm.inttoptr %{{.*}} : i64 to !llvm.ptr<3 >
20+ // CHECK: llvm.load %{{.*}} : !llvm.ptr<3 > -> i64
2121
2222// shared store (S!): pop address + value, inttoptr shared addrspace, llvm.store
23- // CHECK: llvm.inttoptr %{{.*}} : i64 to !llvm.ptr<{{[1-9][0-9]*}} >
24- // CHECK: llvm.store %{{.*}}, %{{.*}} : i64, !llvm.ptr<{{[1-9][0-9]*}} >
23+ // CHECK: llvm.inttoptr %{{.*}} : i64 to !llvm.ptr<3 >
24+ // CHECK: llvm.store %{{.*}}, %{{.*}} : i64, !llvm.ptr<3 >
2525
2626module {
2727 func.func private @main () {
You can’t perform that action at this time.
0 commit comments