Lots of changes#1369
Open
computerdisciple wants to merge 55 commits into
Open
Conversation
# Conflicts: # jlm/tooling/Command.cpp
phate
requested changes
Nov 6, 2025
| ThetaGammaInversion, | ||
|
|
||
| LastEnumValue // must always be the last enum value, used for iteration | ||
| , |
Comment on lines
+151
to
+152
| { OptimizationId::PartialRedundancyElimination, | ||
| OptimizationCommandLineArgument::PartialRedundancyElimination_ }, |
Comment on lines
425
to
428
| return std::make_unique<llvm::DeadNodeElimination>(); | ||
| case JlmOptCommandLineOptions::OptimizationId::PartialRedundancyElimination: | ||
| return std::make_unique<llvm::PartialRedundancyElimination>(); | ||
| return std::make_shared<llvm::DeadNodeElimination>(); |
Owner
There was a problem hiding this comment.
There are two return statements here. Please fix.
| return output_to_gvn_[edge]; | ||
| } | ||
|
|
||
| std::cout << "Logic error: missing input for edge" + ctx_node->DebugString() + std::to_string(ctx_node->GetNodeId()); |
Owner
There was a problem hiding this comment.
Do not just print, but throw exception please.
Comment on lines
+66
to
+67
| jlm/llvm/opt/PartialRedundancyElimination.cpp \ | ||
| jlm/llvm/opt/gvn.cpp \ |
Owner
There was a problem hiding this comment.
The files are alphabetically ordered.
Comment on lines
+221
to
+224
| std::cout << TR_GRAY << "=================================================" << TR_RESET << std::endl; | ||
| std::cout <<TR_CYAN << "Gamma node count:" << stat_gamma_count << TR_RESET << std::endl; | ||
| std::cout <<TR_CYAN << "Theta node count:" << stat_theta_count << TR_RESET << std::endl; | ||
| std::cout << TR_GRAY << "=================================================" << TR_RESET << std::endl; |
|
|
||
| TraverseTopDownRecursively(root, dump_node); | ||
| TraverseTopDownRecursively(root, dump_region); | ||
| std::cout << TR_PURPLE << "=================================================" << TR_RESET << std::endl; |
|
|
||
| for (auto kv : thetas_){ | ||
| auto ic = kv.second.stat_iteration_count; | ||
| std::cout << TR_ORANGE << kv.first->DebugString() << kv.first->GetNodeId() << " Iteration count: " << ic << TR_RESET << std::endl; |
| for (auto& reg : sn.Subregions()) | ||
| { | ||
| this->TraverseTopDownRecursively(reg, cb); | ||
| std::cout << ind() << TR_GRAY << "..........................." << TR_RESET << std::endl; |
Comment on lines
+297
to
+332
| /* | ||
| static StateEdgesAt findStateIndices(rvsdg::Node* node) | ||
| { | ||
| StateEdgesAt edge_indices; | ||
| edge_indices.io_state = std::make_pair(0,0); | ||
| edge_indices.mem_state = std::make_pair(0,0); | ||
|
|
||
| bool found_io_state = false; | ||
| bool found_mem_state = false; | ||
|
|
||
| for (size_t i = 0 ; i < node->ninputs() ; i++){ | ||
| if ( rvsdg::is<MemoryStateType>(node->input(i)->Type()) ){ | ||
| edge_indices.mem_state->first = i; | ||
| found_io_state = true; | ||
| } | ||
| if ( rvsdg::is<IOStateType>(node->input(i)->Type()) ){ | ||
| edge_indices.io_state->first = i; | ||
| found_mem_state = true; | ||
| } | ||
| } | ||
|
|
||
| for (size_t o = 0 ; o < node->noutputs() ; o++){ | ||
| if ( rvsdg::is<MemoryStateType>(node->output(o)->Type()) ){ | ||
| edge_indices.mem_state->second = o; | ||
| } | ||
| if ( rvsdg::is<IOStateType>(node->input(o)->Type()) ){ | ||
| edge_indices.io_state->second = o; | ||
| } | ||
| } | ||
|
|
||
| if (!found_io_state){edge_indices.io_state = std::nullopt;} | ||
| if (!found_mem_state){edge_indices.mem_state = std::nullopt;} | ||
|
|
||
| return edge_indices; | ||
| } | ||
| */ |
phate
requested changes
Nov 6, 2025
Comment on lines
+42
to
+48
| #pragma GCC diagnostic push | ||
| #pragma GCC diagnostic ignored "-Warray-bounds" | ||
| #pragma GCC diagnostic ignored "-Wstringop-overflow" | ||
| if (operands.size() == 1){ | ||
| return {operands}; | ||
| } | ||
| #pragma GCC diagnostic pop |
Comment on lines
+165
to
+171
| #pragma GCC diagnostic push | ||
| #pragma GCC diagnostic ignored "-Warray-bounds" | ||
| #pragma GCC diagnostic ignored "-Wstringop-overflow" | ||
| if (operands.size() == 1){ | ||
| return {operands}; | ||
| } | ||
| #pragma GCC diagnostic pop |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GVN for thetas