Skip to content

Commit 62b42dc

Browse files
librustc: Sync the order of PNaCl's simplification passes with pnacl-llvm.
1 parent 2f6e0fc commit 62b42dc

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/librustc/back/link.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,17 +1722,16 @@ pub fn link_pnacl_module(sess: &Session,
17221722
"expand-indirectbr".with_c_str(|s| ap(s) );
17231723
"lower-expect".with_c_str(|s| ap(s) );
17241724
"rewrite-llvm-intrinsic-calls".with_c_str(|s| ap(s) );
1725+
"expand-varargs".with_c_str(|s| ap(s) );
17251726
"expand-arith-with-overflow".with_c_str(|s| ap(s) );
17261727
"expand-constant-expr".with_c_str(|s| ap(s) );
17271728
"promote-returned-structures".with_c_str(|s| ap(s) );
17281729
"promote-structure-arguments".with_c_str(|s| ap(s) );
1729-
"nacl-rewrite-atomics".with_c_str(|s| ap(s) );
17301730
"expand-struct-regs".with_c_str(|s| ap(s) );
1731-
"expand-varargs".with_c_str(|s| ap(s) );
17321731
"nacl-expand-ctors".with_c_str(|s| ap(s) );
17331732
"resolve-aliases".with_c_str(|s| ap(s) );
1734-
"nacl-expand-tls".with_c_str(|s| ap(s) );
17351733
"nacl-expand-tls-constant-expr".with_c_str(|s| ap(s) );
1734+
"nacl-expand-tls".with_c_str(|s| ap(s) );
17361735
"nacl-global-cleanup".with_c_str(|s| ap(s) );
17371736
},
17381737
|pm| {
@@ -1750,10 +1749,17 @@ pub fn link_pnacl_module(sess: &Session,
17501749
"constant-insert-extract-element-index".with_c_str(|s| ap(s) );
17511750
"fix-vector-load-store-alignment".with_c_str(|s| ap(s) );
17521751
"canonicalize-mem-intrinsics".with_c_str(|s| ap(s) );
1752+
"constmerge".with_c_str(|s| ap(s) );
17531753
"flatten-globals".with_c_str(|s| ap(s) );
17541754
"expand-constant-expr".with_c_str(|s| ap(s) );
17551755
"nacl-promote-ints".with_c_str(|s| ap(s) );
17561756
"expand-getelementptr".with_c_str(|s| ap(s) );
1757+
// This MUST be in the post-opt set of passes. Otherwise
1758+
// the LTO passes will reorder the calls to
1759+
// llvm.nacl.atomic.*, not realizing the nature of the
1760+
// atomic operations.
1761+
"nacl-rewrite-atomics".with_c_str(|s| ap(s) );
1762+
"expand-struct-regs".with_c_str(|s| ap(s) );
17571763
"remove-asm-memory".with_c_str(|s| ap(s) );
17581764
"replace-ptrs-with-ints".with_c_str(|s| ap(s) );
17591765
"strip-dead-prototypes".with_c_str(|s| ap(s) );

0 commit comments

Comments
 (0)