Skip to content
Merged
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
8 changes: 2 additions & 6 deletions test/Pipeline/i64-memory-alignment.forth
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
\ RUN: %warpforthc %s -o %t.ptx
\ RUN: %FileCheck %s --implicit-check-not='{{(ld|st)[.a-z]*\.[bsuf]32}}' < %t.ptx

\ i64 global accesses and the stack slots in word functions are naturally
\ aligned, so each is a single 64-bit memory operation.
\ i64 global accesses are naturally aligned, so each is a single 64-bit memory
\ operation.

\! kernel main
\! param A i64[256]
Expand All @@ -18,7 +18,3 @@ GLOBAL-ID CELLS A + !
\ CHECK: ld{{(\.global)?}}.{{[bsuf]}}64 {{%[a-z]+[0-9]+}}, [
\ CHECK: ld{{(\.global)?}}.{{[bsuf]}}64 {{%[a-z]+[0-9]+}}, [
\ CHECK: st{{(\.global)?}}.{{[bsuf]}}64 [

\ CHECK-LABEL: .func {{.*}}SUM3(
\ CHECK: ld{{(\.global)?}}.{{[bsuf]}}64 {{%[a-z]+[0-9]+}}, [
\ CHECK: st{{(\.global)?}}.{{[bsuf]}}64 [
13 changes: 13 additions & 0 deletions test/Pipeline/inlined-words.forth
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
\ RUN: %warpforthc %s -o %t.ptx
\ RUN: %FileCheck %s < %t.ptx

\ Words inlined into the kernel must not survive as device functions.
\ CHECK-NOT: .func
\ CHECK: .entry k(
\ CHECK-NOT: .func

\! kernel k
\! param a i64[256]
: sq DUP * ;
: sumsq 0 SWAP 0 DO I sq + LOOP ;
GLOBAL-ID sumsq GLOBAL-ID CELLS a + !
1 change: 1 addition & 0 deletions tools/warpforthc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ target_link_libraries(warpforthc
MLIRArithToLLVM
MLIRBuiltinToLLVMIRTranslation
MLIRControlFlowToLLVM
MLIRFuncInlinerExtension
MLIRFuncToLLVM
MLIRGPUToLLVMIRTranslation
MLIRLLVMToLLVMIRTranslation
Expand Down
6 changes: 4 additions & 2 deletions tools/warpforthc/warpforthc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
#include "mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h"
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlow.h" // IWYU pragma: keep
#include "mlir/Dialect/Func/IR/FuncOps.h" // IWYU pragma: keep
#include "mlir/Dialect/MemRef/IR/MemRef.h" // IWYU pragma: keep
#include "mlir/Dialect/Func/Extensions/InlinerExtension.h"
#include "mlir/Dialect/Func/IR/FuncOps.h" // IWYU pragma: keep
#include "mlir/Dialect/MemRef/IR/MemRef.h" // IWYU pragma: keep
#include "mlir/IR/AsmState.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Diagnostics.h"
Expand Down Expand Up @@ -75,6 +76,7 @@ int main(int argc, char **argv) {
cf::registerConvertControlFlowToLLVMInterface(registry);
registerConvertFuncToLLVMInterface(registry);
registerConvertMemRefToLLVMInterface(registry);
func::registerInlinerExtension(registry);

registerBuiltinDialectTranslation(registry);
registerGPUDialectTranslation(registry);
Expand Down
Loading