-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The complexity analysis was ignoring intrinsics operations that can contain functor calls. It had an impact on the reordering of conditions that would move a functor call too early when it is within an intrinsic operation. fix #2373
- Loading branch information
Showing
8 changed files
with
83 additions
and
3 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,35 @@ | ||
# Souffle - A Datalog Compiler | ||
# Copyright (c) 2022 The Souffle Developers. All rights reserved | ||
# Licensed under the Universal Permissive License v 1.0 as shown at: | ||
# - https://opensource.org/licenses/UPL | ||
# - <souffle root>/licenses/SOUFFLE-UPL.txt | ||
|
||
add_library(issue2373 SHARED functors.cpp) | ||
target_include_directories(issue2373 PRIVATE "${CMAKE_SOURCE_DIR}/src/include") | ||
|
||
target_compile_features(issue2373 | ||
PUBLIC cxx_std_17) | ||
|
||
set_target_properties(issue2373 PROPERTIES CXX_EXTENSIONS OFF) | ||
set_target_properties(issue2373 PROPERTIES OUTPUT_NAME "functors") | ||
set_target_properties(issue2373 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) | ||
|
||
if (NOT MSVC) | ||
target_compile_options(issue2373 | ||
PUBLIC "-Wall;-Wextra;-Werror;-fwrapv") | ||
else () | ||
target_compile_options(issue2373 PUBLIC /W3 /WX) | ||
endif() | ||
|
||
if (WIN32) | ||
# Prefix all shared libraries with 'lib'. | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "lib") | ||
|
||
# Prefix all static libraries with 'lib'. | ||
set(CMAKE_STATIC_LIBRARY_PREFIX "lib") | ||
endif () | ||
|
||
if (SOUFFLE_DOMAIN_64BIT) | ||
target_compile_definitions(issue2373 | ||
PUBLIC RAM_DOMAIN_SIZE=64) | ||
endif() |
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 @@ | ||
1 $A(1000) |
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,16 @@ | ||
// functors.cpp | ||
#include "souffle/RecordTable.h" | ||
#include "souffle/SymbolTable.h" | ||
|
||
extern "C" { | ||
|
||
souffle::RamDomain id(souffle::SymbolTable*, souffle::RecordTable*, souffle::RamDomain x) { | ||
return x; | ||
} | ||
|
||
souffle::RamDomain blubb( | ||
souffle::SymbolTable* symbolTable, souffle::RecordTable*, souffle::RamDomain, souffle::RamDomain y) { | ||
symbolTable->decode(y); | ||
return 1; | ||
} | ||
} |
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,16 @@ | ||
//mini-rules.dl | ||
.type T = A {N: number} | B {S : symbol} | ||
|
||
.decl P(N: number, T: T) | ||
|
||
.functor blubb(symbol, symbol): number stateful | ||
.functor id(symbol): symbol stateful | ||
|
||
.output P | ||
|
||
P(1, $A(1000)). | ||
|
||
P(0, $B(?_p)) :- | ||
(1-@blubb("60",?_p)) != 0, | ||
(?_p != @id("40")), | ||
P(1, $B(?_p)). |
Empty file.
Empty file.