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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 PM.add(createExpandByValPass()); | 85 PM.add(createExpandByValPass()); |
86 | 86 |
87 // We place ExpandSmallArguments after optimization passes because | 87 // We place ExpandSmallArguments after optimization passes because |
88 // some optimizations undo its changes. Note that | 88 // some optimizations undo its changes. Note that |
89 // ExpandSmallArguments requires that ExpandVarArgs has already been | 89 // ExpandSmallArguments requires that ExpandVarArgs has already been |
90 // run. | 90 // run. |
91 PM.add(createExpandSmallArgumentsPass()); | 91 PM.add(createExpandSmallArgumentsPass()); |
92 | 92 |
93 PM.add(createPromoteI1OpsPass()); | 93 PM.add(createPromoteI1OpsPass()); |
94 | 94 |
| 95 // Vector simplifications. |
| 96 // TODO(jfb) Remove duplicate constant vector values using |
| 97 // ConstantMerge after the GlobalizeConstantVectors pass? |
| 98 PM.add(createGlobalizeConstantVectorsPass()); |
| 99 // The following pass inserts GEPs, it must precede |
| 100 // ExpandGetElementPtr. It also creates vector loads and stores, the |
| 101 // subsequent pass cleans them up to fix their alignment. |
| 102 PM.add(createConstantInsertExtractElementIndexPass()); |
| 103 PM.add(createFixVectorLoadStoreAlignmentPass()); |
| 104 |
95 // Optimization passes and ExpandByVal introduce | 105 // Optimization passes and ExpandByVal introduce |
96 // memset/memcpy/memmove intrinsics with a 64-bit size argument. | 106 // memset/memcpy/memmove intrinsics with a 64-bit size argument. |
97 // This pass converts those arguments to 32-bit. | 107 // This pass converts those arguments to 32-bit. |
98 PM.add(createCanonicalizeMemIntrinsicsPass()); | 108 PM.add(createCanonicalizeMemIntrinsicsPass()); |
99 | 109 |
100 // We place StripMetadata after optimization passes because | 110 // We place StripMetadata after optimization passes because |
101 // optimizations depend on the metadata. | 111 // optimizations depend on the metadata. |
102 PM.add(createStripMetadataPass()); | 112 PM.add(createStripMetadataPass()); |
103 | 113 |
104 // FlattenGlobals introduces ConstantExpr bitcasts of globals which | 114 // FlattenGlobals introduces ConstantExpr bitcasts of globals which |
(...skipping 28 matching lines...) Expand all Loading... |
133 // Strip dead prototytes to appease the intrinsic ABI checks. | 143 // Strip dead prototytes to appease the intrinsic ABI checks. |
134 // ExpandVarArgs leaves around vararg intrinsics, and | 144 // ExpandVarArgs leaves around vararg intrinsics, and |
135 // ReplacePtrsWithInts leaves the lifetime.start/end intrinsics. | 145 // ReplacePtrsWithInts leaves the lifetime.start/end intrinsics. |
136 PM.add(createStripDeadPrototypesPass()); | 146 PM.add(createStripDeadPrototypesPass()); |
137 | 147 |
138 // Eliminate simple dead code that the post-opt passes could have | 148 // Eliminate simple dead code that the post-opt passes could have |
139 // created. | 149 // created. |
140 PM.add(createDeadInstEliminationPass()); | 150 PM.add(createDeadInstEliminationPass()); |
141 PM.add(createDeadCodeEliminationPass()); | 151 PM.add(createDeadCodeEliminationPass()); |
142 } | 152 } |
OLD | NEW |