Skip to content

Commit ea50bf8

Browse files
committed
Unconditionally disable LLVM's FastISel on AArch64
Before ca07e256f62f772d14c42f41af46f2aeacc54983, LLVM's AArch64FastISel had a sign (and zero?) extension bug. Until rustc gets its LLVM past that commit, the way of workaround is to pass an option to LLVM that forces the disabling of FastISel (which would normally kick in for -O0). Fixes #21627
1 parent 7615e18 commit ea50bf8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc_trans/back/write.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,9 @@ unsafe fn configure_llvm(sess: &Session) {
10121012
if sess.time_llvm_passes() { add("-time-passes"); }
10131013
if sess.print_llvm_passes() { add("-debug-pass=Structure"); }
10141014

1015+
// FIXME #21627 disable faulty FastISel on AArch64 (even for -O0)
1016+
if sess.target.target.arch.as_slice() == "aarch64" { add("-fast-isel=0"); }
1017+
10151018
for arg in sess.opts.cg.llvm_args.iter() {
10161019
add(&(*arg)[]);
10171020
}

0 commit comments

Comments
 (0)