@@ -1415,37 +1415,38 @@ void GCNPassConfig::addFastRegAlloc() {
1415
1415
}
1416
1416
1417
1417
void GCNPassConfig::addOptimizedRegAlloc () {
1418
- // Allow the scheduler to run before SIWholeQuadMode inserts exec manipulation
1419
- // instructions that cause scheduling barriers.
1420
- insertPass (&MachineSchedulerID, &SIWholeQuadModeID);
1421
-
1422
- if (OptExecMaskPreRA)
1423
- insertPass (&MachineSchedulerID, &SIOptimizeExecMaskingPreRAID);
1424
-
1425
- if (EnableRewritePartialRegUses)
1426
- insertPass (&RenameIndependentSubregsID, &GCNRewritePartialRegUsesID);
1427
-
1428
- if (isPassEnabled (EnablePreRAOptimizations))
1429
- insertPass (&RenameIndependentSubregsID, &GCNPreRAOptimizationsID);
1430
-
1431
- // This is not an essential optimization and it has a noticeable impact on
1432
- // compilation time, so we only enable it from O2.
1433
- if (TM->getOptLevel () > CodeGenOptLevel::Less)
1434
- insertPass (&MachineSchedulerID, &SIFormMemoryClausesID);
1418
+ if (EnableDCEInRA)
1419
+ insertPass (&DetectDeadLanesID, &DeadMachineInstructionElimID);
1435
1420
1436
1421
// FIXME: when an instruction has a Killed operand, and the instruction is
1437
1422
// inside a bundle, seems only the BUNDLE instruction appears as the Kills of
1438
1423
// the register in LiveVariables, this would trigger a failure in verifier,
1439
1424
// we should fix it and enable the verifier.
1440
1425
if (OptVGPRLiveRange)
1441
1426
insertPass (&LiveVariablesID, &SIOptimizeVGPRLiveRangeID);
1427
+
1442
1428
// This must be run immediately after phi elimination and before
1443
1429
// TwoAddressInstructions, otherwise the processing of the tied operand of
1444
1430
// SI_ELSE will introduce a copy of the tied operand source after the else.
1445
1431
insertPass (&PHIEliminationID, &SILowerControlFlowID);
1446
1432
1447
- if (EnableDCEInRA)
1448
- insertPass (&DetectDeadLanesID, &DeadMachineInstructionElimID);
1433
+ if (EnableRewritePartialRegUses)
1434
+ insertPass (&RenameIndependentSubregsID, &GCNRewritePartialRegUsesID);
1435
+
1436
+ if (isPassEnabled (EnablePreRAOptimizations))
1437
+ insertPass (&RenameIndependentSubregsID, &GCNPreRAOptimizationsID);
1438
+
1439
+ // Allow the scheduler to run before SIWholeQuadMode inserts exec manipulation
1440
+ // instructions that cause scheduling barriers.
1441
+ insertPass (&MachineSchedulerID, &SIWholeQuadModeID);
1442
+
1443
+ if (OptExecMaskPreRA)
1444
+ insertPass (&MachineSchedulerID, &SIOptimizeExecMaskingPreRAID);
1445
+
1446
+ // This is not an essential optimization and it has a noticeable impact on
1447
+ // compilation time, so we only enable it from O2.
1448
+ if (TM->getOptLevel () > CodeGenOptLevel::Less)
1449
+ insertPass (&MachineSchedulerID, &SIFormMemoryClausesID);
1449
1450
1450
1451
TargetPassConfig::addOptimizedRegAlloc ();
1451
1452
}
0 commit comments