| OLD | NEW |
| 1 //===-- PNaClABISimplify.cpp - Lists PNaCl ABI simplification passes ------===// | 1 //===-- PNaClABISimplify.cpp - Lists PNaCl ABI simplification passes ------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file implements the meta-passes "-pnacl-abi-simplify-preopt" | 10 // This file implements the meta-passes "-pnacl-abi-simplify-preopt" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 PM.add(createLowerInvokePass()); | 40 PM.add(createLowerInvokePass()); |
| 41 // Remove landingpad blocks made unreachable by LowerInvoke. | 41 // Remove landingpad blocks made unreachable by LowerInvoke. |
| 42 PM.add(createCFGSimplificationPass()); | 42 PM.add(createCFGSimplificationPass()); |
| 43 } | 43 } |
| 44 | 44 |
| 45 // Internalize all symbols in the module except _start, which is the only | 45 // Internalize all symbols in the module except _start, which is the only |
| 46 // symbol a stable PNaCl pexe is allowed to export. | 46 // symbol a stable PNaCl pexe is allowed to export. |
| 47 const char *SymbolsToPreserve[] = { "_start" }; | 47 const char *SymbolsToPreserve[] = { "_start" }; |
| 48 PM.add(createInternalizePass(SymbolsToPreserve)); | 48 PM.add(createInternalizePass(SymbolsToPreserve)); |
| 49 | 49 |
| 50 // Expand out computed gotos (indirectbr and blockaddresses) into switches. |
| 51 PM.add(createExpandIndirectBrPass()); |
| 52 |
| 50 // LowerExpect converts Intrinsic::expect into branch weights, | 53 // LowerExpect converts Intrinsic::expect into branch weights, |
| 51 // which can then be removed after BlockPlacement. | 54 // which can then be removed after BlockPlacement. |
| 52 PM.add(createLowerExpectIntrinsicPass()); | 55 PM.add(createLowerExpectIntrinsicPass()); |
| 53 // Rewrite unsupported intrinsics to simpler and portable constructs. | 56 // Rewrite unsupported intrinsics to simpler and portable constructs. |
| 54 PM.add(createRewriteLLVMIntrinsicsPass()); | 57 PM.add(createRewriteLLVMIntrinsicsPass()); |
| 55 | 58 |
| 56 // Expand out some uses of struct types. | 59 // Expand out some uses of struct types. |
| 57 PM.add(createExpandArithWithOverflowPass()); | 60 PM.add(createExpandArithWithOverflowPass()); |
| 58 // ExpandStructRegs must be run after ExpandArithWithOverflow to | 61 // ExpandStructRegs must be run after ExpandArithWithOverflow to |
| 59 // expand out the insertvalue instructions that | 62 // expand out the insertvalue instructions that |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // Strip dead prototytes to appease the intrinsic ABI checks. | 131 // Strip dead prototytes to appease the intrinsic ABI checks. |
| 129 // ExpandVarArgs leaves around vararg intrinsics, and | 132 // ExpandVarArgs leaves around vararg intrinsics, and |
| 130 // ReplacePtrsWithInts leaves the lifetime.start/end intrinsics. | 133 // ReplacePtrsWithInts leaves the lifetime.start/end intrinsics. |
| 131 PM.add(createStripDeadPrototypesPass()); | 134 PM.add(createStripDeadPrototypesPass()); |
| 132 | 135 |
| 133 // Eliminate simple dead code that the post-opt passes could have | 136 // Eliminate simple dead code that the post-opt passes could have |
| 134 // created. | 137 // created. |
| 135 PM.add(createDeadInstEliminationPass()); | 138 PM.add(createDeadInstEliminationPass()); |
| 136 PM.add(createDeadCodeEliminationPass()); | 139 PM.add(createDeadCodeEliminationPass()); |
| 137 } | 140 } |
| OLD | NEW |