@@ -1086,7 +1086,7 @@ void CodeGenPassBuilder<Derived, TargetMachineT>::addRegAllocPass(
1086
1086
addPass (RAGreedyPass ());
1087
1087
break ;
1088
1088
default :
1089
- llvm_unreachable (" Register allocator not supported yet." );
1089
+ report_fatal_error (" Register allocator not supported yet." , false );
1090
1090
}
1091
1091
return ;
1092
1092
}
@@ -1162,20 +1162,23 @@ void CodeGenPassBuilder<Derived, TargetMachineT>::addOptimizedRegAlloc(
1162
1162
// PreRA instruction scheduling.
1163
1163
addPass (MachineSchedulerPass ());
1164
1164
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);
1169
1173
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 ());
1173
1177
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 ());
1179
1182
}
1180
1183
1181
1184
// ===---------------------------------------------------------------------===//
0 commit comments