Skip to content

Commit

Permalink
Switch pass order (#205).
Browse files Browse the repository at this point in the history
The current order of passes in the frontend leads to issues due to the
expansion of switches and the introduction of branching instructions,
potentially leading to dead cycles.

This commit delays the dead cycles pass until after the switch pass
(remove switch constructions).
  • Loading branch information
ivanperez-keera committed Apr 1, 2024
1 parent 39a88c0 commit 4907d78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/llvm/src/ikos_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ int main(int argc, char** argv) {
// Dead code elimination (opt -dce)
pass_manager.add(llvm::createDeadCodeEliminationPass());

// Remove unreachable blocks also dead cycles
pass_manager.add(ikos_pp::create_remove_unreachable_blocks_pass());

// Remove switch constructions (opt -lowerswitch)
pass_manager.add(llvm::createLowerSwitchPass());

// Remove unreachable blocks also dead cycles
pass_manager.add(ikos_pp::create_remove_unreachable_blocks_pass());

// Lower down atomic instructions (opt -loweratomic)
pass_manager.add(llvm::createLowerAtomicPass());

Expand Down

0 comments on commit 4907d78

Please sign in to comment.