| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 if (!isEmscripten) // JSBackend can handle external_weak. | 116 if (!isEmscripten) // JSBackend can handle external_weak. |
| 117 PM.add(createGlobalCleanupPass()); | 117 PM.add(createGlobalCleanupPass()); |
| 118 | 118 |
| 119 if (EnableEmAsyncify) | 119 if (EnableEmAsyncify) |
| 120 PM.add(createLowerEmAsyncifyPass()); | 120 PM.add(createLowerEmAsyncifyPass()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void llvm::PNaClABISimplifyAddPostOptPasses(Triple *T, PassManagerBase &PM) { | 123 void llvm::PNaClABISimplifyAddPostOptPasses(Triple *T, PassManagerBase &PM) { |
| 124 bool isEmscripten = T->isOSEmscripten(); | 124 bool isEmscripten = T->isOSEmscripten(); |
| 125 | 125 |
| 126 PM.add(createPNaClVectorCanonicalizationPass()); |
| 127 |
| 126 if (!isEmscripten) // setjmp/longjmp are handled in LowerEmSetjmp, | 128 if (!isEmscripten) // setjmp/longjmp are handled in LowerEmSetjmp, |
| 127 // memcpy/memmove/memset are handled in JSBackend. | 129 // memcpy/memmove/memset are handled in JSBackend. |
| 128 PM.add(createRewritePNaClLibraryCallsPass()); | 130 PM.add(createRewritePNaClLibraryCallsPass()); |
| 129 | 131 |
| 130 // ExpandStructRegs must be run after ExpandArithWithOverflow to expand out | 132 // ExpandStructRegs must be run after ExpandArithWithOverflow to expand out |
| 131 // the insertvalue instructions that ExpandArithWithOverflow introduces. | 133 // the insertvalue instructions that ExpandArithWithOverflow introduces. |
| 132 PM.add(createExpandArithWithOverflowPass()); | 134 PM.add(createExpandArithWithOverflowPass()); |
| 133 | 135 |
| 134 // We place ExpandByVal after optimization passes because some byval | 136 // We place ExpandByVal after optimization passes because some byval |
| 135 // arguments can be expanded away by the ArgPromotion pass. Leaving | 137 // arguments can be expanded away by the ArgPromotion pass. Leaving |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 if (!isEmscripten) // Dead prototypes ignored by JSBackend. | 235 if (!isEmscripten) // Dead prototypes ignored by JSBackend. |
| 234 PM.add(createStripDeadPrototypesPass()); | 236 PM.add(createStripDeadPrototypesPass()); |
| 235 | 237 |
| 236 // Eliminate simple dead code that the post-opt passes could have created. | 238 // Eliminate simple dead code that the post-opt passes could have created. |
| 237 PM.add(createDeadCodeEliminationPass()); | 239 PM.add(createDeadCodeEliminationPass()); |
| 238 | 240 |
| 239 // This should be the last step before PNaCl ABI validation. | 241 // This should be the last step before PNaCl ABI validation. |
| 240 if (!isEmscripten) | 242 if (!isEmscripten) |
| 241 PM.add(createCleanupUsedGlobalsMetadataPass()); | 243 PM.add(createCleanupUsedGlobalsMetadataPass()); |
| 242 } | 244 } |
| OLD | NEW |