Skip to content

Commit

Permalink
fix: don't mutate src module when running passes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugobros3 committed Apr 16, 2024
1 parent 13276ac commit 5554b9c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/shady/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@ void add_scheduler_source(const CompilerConfig* config, Module* dst) {
}

CompilationResult run_compiler_passes(CompilerConfig* config, Module** pmod) {
if (config->dynamic_scheduling) {
add_scheduler_source(config, *pmod);
}

IrArena* initial_arena = (*pmod)->arena;
Module* old_mod = NULL;

if (config->dynamic_scheduling) {
*pmod = import(config, *pmod); // we don't want to mess with the original module

add_scheduler_source(config, *pmod);
log_module(ERROR, config, *pmod);
//exit(0);
}

RUN_PASS(reconvergence_heuristics)

Expand Down

0 comments on commit 5554b9c

Please sign in to comment.