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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // atomics: a ``fence seq_cst`` surrounded by ``asm("":::"memory")`` | 147 // atomics: a ``fence seq_cst`` surrounded by ``asm("":::"memory")`` |
148 // has special meaning and is translated differently. | 148 // has special meaning and is translated differently. |
149 PM.add(createRemoveAsmMemoryPass()); | 149 PM.add(createRemoveAsmMemoryPass()); |
150 | 150 |
151 PM.add(createSimplifyAllocasPass()); | 151 PM.add(createSimplifyAllocasPass()); |
152 | 152 |
153 // ReplacePtrsWithInts assumes that getelementptr instructions and | 153 // ReplacePtrsWithInts assumes that getelementptr instructions and |
154 // ConstantExprs have already been expanded out. | 154 // ConstantExprs have already been expanded out. |
155 PM.add(createReplacePtrsWithIntsPass()); | 155 PM.add(createReplacePtrsWithIntsPass()); |
156 | 156 |
| 157 // Convert struct reg function params to struct* byval |
| 158 PM.add(createSimplifyStructRegSignaturesPass()); |
| 159 |
157 // The atomic cmpxchg instruction returns a struct, and is rewritten to an | 160 // The atomic cmpxchg instruction returns a struct, and is rewritten to an |
158 // intrinsic as a post-opt pass, we therefore need to expand struct regs. | 161 // intrinsic as a post-opt pass, we therefore need to expand struct regs. |
159 PM.add(createExpandStructRegsPass()); | 162 PM.add(createExpandStructRegsPass()); |
160 | 163 |
161 // We place StripAttributes after optimization passes because many | 164 // We place StripAttributes after optimization passes because many |
162 // analyses add attributes to reflect their results. | 165 // analyses add attributes to reflect their results. |
163 // StripAttributes must come after ExpandByVal and | 166 // StripAttributes must come after ExpandByVal and |
164 // ExpandSmallArguments. | 167 // ExpandSmallArguments. |
165 PM.add(createStripAttributesPass()); | 168 PM.add(createStripAttributesPass()); |
166 | 169 |
167 // Strip dead prototytes to appease the intrinsic ABI checks. | 170 // Strip dead prototytes to appease the intrinsic ABI checks. |
168 // ExpandVarArgs leaves around vararg intrinsics, and | 171 // ExpandVarArgs leaves around vararg intrinsics, and |
169 // ReplacePtrsWithInts leaves the lifetime.start/end intrinsics. | 172 // ReplacePtrsWithInts leaves the lifetime.start/end intrinsics. |
170 PM.add(createStripDeadPrototypesPass()); | 173 PM.add(createStripDeadPrototypesPass()); |
171 | 174 |
172 // Eliminate simple dead code that the post-opt passes could have | 175 // Eliminate simple dead code that the post-opt passes could have |
173 // created. | 176 // created. |
174 PM.add(createDeadInstEliminationPass()); | 177 PM.add(createDeadInstEliminationPass()); |
175 PM.add(createDeadCodeEliminationPass()); | 178 PM.add(createDeadCodeEliminationPass()); |
176 } | 179 } |
OLD | NEW |