-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds - the explicit use/casting to address space 0 in CreateTerm.cpp. - the infrastructure to define the functions that contain the `addrspacecast` instructions for the various address spaces (a separate file, linked after the regular passes, and the always inline pass executed afterwards). Current status: The tests work as expected when the conditional compilation flag `use_gcstrategy` that enables the use of the LLVM backend strategy is disabled. Enabling the flag, e.g. by adding the tests ``` // RUN: %gcs-interpreter // RUN: %check-grep ``` in defn/imp.kore, results in the test failing (that interpreter fails with segfault). This is WIP, and is merged in order to keep the code up to date until we revisit this, to - address the segfault - replace address space 0 with the actual address space needed in each place - similarly edit the other files
- Loading branch information
Showing
11 changed files
with
141 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef OPAQUE_CPP_H | ||
#define OPAQUE_CPP_H | ||
|
||
/* This header file declares a string containing the textual bitcode of | ||
* runtime/opaque/opaque.ll. The reason we use a separate IR file for the | ||
* functions in opaque.ll is that the instructions they include confuse the | ||
* RewriteStatepointsForGC pass. Therefore, we first perform all the regular | ||
* optimization passes, then link, and then run the inline pass again. | ||
*/ | ||
extern unsigned char opaque_ll[]; | ||
extern unsigned int opaque_ll_len; | ||
|
||
#endif // define OPAQUE_CPP_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/runtime/opaque/opaque_cpp.cpp | ||
COMMAND xxd -i opaque.ll opaque_cpp.cpp | ||
DEPENDS opaque.ll | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/runtime/opaque | ||
) | ||
|
||
add_library(opaque-cpp STATIC | ||
${CMAKE_BINARY_DIR}/runtime/opaque/opaque_cpp.cpp | ||
) | ||
|
||
set_target_properties(opaque-cpp PROPERTIES EXPORT_COMPILE_COMMANDS Off) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
target datalayout = "@BACKEND_TARGET_DATALAYOUT@" | ||
target triple = "@BACKEND_TARGET_TRIPLE@" | ||
|
||
define ptr addrspace(0) @addrspace_0_to_0(ptr %in) #0 { | ||
; %out = addrspacecast ptr %in to ptr addrspace(0) | ||
; ret ptr addrspace(0) %out | ||
ret ptr addrspace(0) %in | ||
} | ||
|
||
attributes #0 = { alwaysinline } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters