From 4907d78e78af2df158bb79db4ec1bc7506a7fd59 Mon Sep 17 00:00:00 2001 From: Ivan Perez Date: Mon, 1 Apr 2024 04:42:15 +0000 Subject: [PATCH] Switch pass order (#205). 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). --- frontend/llvm/src/ikos_pp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/llvm/src/ikos_pp.cpp b/frontend/llvm/src/ikos_pp.cpp index 047cc9ec..2804bda3 100644 --- a/frontend/llvm/src/ikos_pp.cpp +++ b/frontend/llvm/src/ikos_pp.cpp @@ -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());