@@ -633,7 +633,7 @@ unsafe fn optimize(cgcx: &CodegenContext,
633
633
None ,
634
634
& format ! ( "llvm module passes [{}]" , module_name. unwrap( ) ) ,
635
635
|| {
636
- llvm:: LLVMRunPassManager ( mpm, llmod) ;
636
+ llvm:: LLVMRunPassManager ( mpm, llmod)
637
637
} ) ;
638
638
639
639
// Deallocate managers that we're now done with
@@ -691,38 +691,6 @@ unsafe fn codegen(cgcx: &CodegenContext,
691
691
create_msvc_imps ( cgcx, llcx, llmod) ;
692
692
}
693
693
694
- // Ok now this one's a super interesting invocations. SIMD in rustc is
695
- // difficult where we want some parts of the program to be able to use
696
- // some SIMD features while other parts of the program don't. The real
697
- // tough part is that we want this to actually work correctly!
698
- //
699
- // We go to great lengths to make sure this works, and one crucial
700
- // aspect is that vector arguments (simd types) are never passed by
701
- // value in the ABI of functions. It turns out, however, that LLVM will
702
- // undo our "clever work" of passing vector types by reference. Its
703
- // argument promotion pass will promote these by-ref arguments to
704
- // by-val. That, however, introduces codegen errors!
705
- //
706
- // The upstream LLVM bug [1] has unfortunatey not really seen a lot of
707
- // activity. The Rust bug [2], however, has seen quite a lot of reports
708
- // of this in the wild. As a result, this is worked around locally here.
709
- // We have a custom transformation, `LLVMRustDemoteSimdArguments`, which
710
- // does the opposite of argument promotion by demoting any by-value SIMD
711
- // arguments in function signatures to pointers intead of being
712
- // by-value.
713
- //
714
- // This operates at the LLVM IR layer because LLVM is thwarting our
715
- // codegen and this is the only chance we get to make sure it's correct
716
- // before we hit codegen.
717
- //
718
- // Hopefully one day the upstream LLVM bug will be fixed and we'll no
719
- // longer need this!
720
- //
721
- // [1]: https://bugs.llvm.org/show_bug.cgi?id=37358
722
- // [2]: https://github.com/rust-lang/rust/issues/50154
723
- llvm:: LLVMRustDemoteSimdArguments ( llmod) ;
724
- cgcx. save_temp_bitcode ( & module, "simd-demoted" ) ;
725
-
726
694
// A codegen-specific pass manager is used to generate object
727
695
// files for an LLVM module.
728
696
//
0 commit comments