@@ -1086,7 +1086,7 @@ void CodeGenPassBuilder<Derived, TargetMachineT>::addRegAllocPass(
10861086 addPass (RAGreedyPass ());
10871087 break ;
10881088 default :
1089- llvm_unreachable (" Register allocator not supported yet." );
1089+ report_fatal_error (" Register allocator not supported yet." , false );
10901090 }
10911091 return ;
10921092 }
@@ -1162,20 +1162,23 @@ void CodeGenPassBuilder<Derived, TargetMachineT>::addOptimizedRegAlloc(
11621162 // PreRA instruction scheduling.
11631163 addPass (MachineSchedulerPass ());
11641164
1165- if (derived ().addRegAssignmentOptimized (addPass)) {
1166- // Allow targets to expand pseudo instructions depending on the choice of
1167- // registers before MachineCopyPropagation.
1168- derived ().addPostRewrite (addPass);
1165+ if (auto E = derived ().addRegAssignmentOptimized (addPass)) {
1166+ // addRegAssignmentOptimized did not add a reg alloc pass, so do nothing.
1167+ // FIXME: This is not really an error.
1168+ return ;
1169+ }
1170+ // Allow targets to expand pseudo instructions depending on the choice of
1171+ // registers before MachineCopyPropagation.
1172+ derived ().addPostRewrite (addPass);
11691173
1170- // Copy propagate to forward register uses and try to eliminate COPYs that
1171- // were not coalesced.
1172- addPass (MachineCopyPropagationPass ());
1174+ // Copy propagate to forward register uses and try to eliminate COPYs that
1175+ // were not coalesced.
1176+ addPass (MachineCopyPropagationPass ());
11731177
1174- // Run post-ra machine LICM to hoist reloads / remats.
1175- //
1176- // FIXME: can this move into MachineLateOptimization?
1177- addPass (MachineLICMPass ());
1178- }
1178+ // Run post-ra machine LICM to hoist reloads / remats.
1179+ //
1180+ // FIXME: can this move into MachineLateOptimization?
1181+ addPass (MachineLICMPass ());
11791182}
11801183
11811184// ===---------------------------------------------------------------------===//
0 commit comments