From fc94dff7dcb4e7a91f6edaef1b9c1485340fd7c6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 20 Dec 2005 08:00:11 +0000 Subject: [PATCH] Run lower-switch after lower-invoke. Only run lower-allocations and lower-select for the simple isel llvm-svn: 24881 --- .../Target/SparcV8/SparcV8TargetMachine.cpp | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp b/llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp index 65e97aa678fd..e0766d1a2ad6 100644 --- a/llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp +++ b/llvm/lib/Target/SparcV8/SparcV8TargetMachine.cpp @@ -73,28 +73,25 @@ bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM, // FIXME: Implement efficient support for garbage collection intrinsics. PM.add(createLowerGCPass()); - // Replace malloc and free instructions with library calls. - PM.add(createLowerAllocationsPass()); - - // FIXME: implement the switch instruction in the instruction selector. - PM.add(createLowerSwitchPass()); + // Make sure that no unreachable blocks are instruction selected. + PM.add(createUnreachableBlockEliminationPass()); // FIXME: implement the invoke/unwind instructions! PM.add(createLowerInvokePass()); - // Make sure that no unreachable blocks are instruction selected. - PM.add(createUnreachableBlockEliminationPass()); - - // FIXME: implement the select instruction in the instruction selector. - PM.add(createLowerSelectPass()); + // FIXME: implement the switch instruction in the instruction selector. + PM.add(createLowerSwitchPass()); // Print LLVM code input to instruction selector: if (PrintMachineCode) PM.add(new PrintFunctionPass()); - if (DisableV8DAGDAG) + if (DisableV8DAGDAG) { + // Replace malloc and free instructions with library calls. + PM.add(createLowerAllocationsPass()); + PM.add(createLowerSelectPass()); PM.add(createSparcV8SimpleInstructionSelector(*this)); - else + } else PM.add(createSparcV8ISelDag(*this)); // Print machine instructions as they were initially generated. @@ -110,6 +107,7 @@ bool SparcV8TargetMachine::addPassesToEmitFile(PassManager &PM, PM.add(createMachineFunctionPrinterPass(&std::cerr)); PM.add(createSparcV8FPMoverPass(*this)); + PM.add(createSparcV8DelaySlotFillerPass(*this)); // Print machine instructions after filling delay slots. -- GitLab