Skip to content

Commit

Permalink
Edited opaque.ll.
Browse files Browse the repository at this point in the history
- Data layout and target triple configured.
- Temporarily comment out the addrspacecast command (cannot cast to same AS).
  • Loading branch information
mariaKt committed Dec 19, 2024
1 parent 1541b7d commit ee7aa80
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 4 additions & 1 deletion runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")

file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/main)
configure_file(main/main.ll ${CMAKE_CURRENT_BINARY_DIR}/main @ONLY)
configure_file(main/main.ll ${CMAKE_CURRENT_BINARY_DIR}/main @ONLY)

file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/opaque)
configure_file(opaque/opaque.ll ${CMAKE_CURRENT_BINARY_DIR}/opaque @ONLY)

install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/main/main.ll main/search.cpp
Expand Down
5 changes: 0 additions & 5 deletions runtime/opaque/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
configure_file(opaque.ll
${CMAKE_BINARY_DIR}/runtime/opaque/opaque.ll
COPYONLY
)

add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/runtime/opaque/opaque_cpp.cpp
COMMAND xxd -i opaque.ll opaque_cpp.cpp
DEPENDS opaque.ll
Expand Down
9 changes: 5 additions & 4 deletions runtime/opaque/opaque.ll
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
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
; %out = addrspacecast ptr %in to ptr addrspace(0)
; ret ptr addrspace(0) %out
ret ptr addrspace(0) %in
}

attributes #0 = { alwaysinline }

0 comments on commit ee7aa80

Please sign in to comment.