-
Notifications
You must be signed in to change notification settings - Fork 18
Lots of changes #1369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Lots of changes #1369
Conversation
# Conflicts: # jlm/tooling/Command.cpp
| ThetaGammaInversion, | ||
|
|
||
| LastEnumValue // must always be the last enum value, used for iteration | ||
| , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noise. Please remove
jlm/tooling/CommandLine.cpp
Outdated
| { OptimizationId::PartialRedundancyElimination, | ||
| OptimizationCommandLineArgument::PartialRedundancyElimination_ }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
jlm/tooling/Command.cpp
Outdated
| return std::make_unique<llvm::DeadNodeElimination>(); | ||
| case JlmOptCommandLineOptions::OptimizationId::PartialRedundancyElimination: | ||
| return std::make_unique<llvm::PartialRedundancyElimination>(); | ||
| return std::make_shared<llvm::DeadNodeElimination>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not just print, but throw exception please.
jlm/llvm/Makefile.sub
Outdated
| jlm/llvm/opt/PartialRedundancyElimination.cpp \ | ||
| jlm/llvm/opt/gvn.cpp \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files are alphabetically ordered.
| 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove.
|
|
||
| TraverseTopDownRecursively(root, dump_node); | ||
| TraverseTopDownRecursively(root, dump_region); | ||
| std::cout << TR_PURPLE << "=================================================" << TR_RESET << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove
|
|
||
| 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove.
| for (auto& reg : sn.Subregions()) | ||
| { | ||
| this->TraverseTopDownRecursively(reg, cb); | ||
| std::cout << ind() << TR_GRAY << "..........................." << TR_RESET << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove.
| /* | ||
| 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; | ||
| } | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code, can be removed, no?
| #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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw these pragmas out, please
| #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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw these pragmas out, please.
GVN for thetas