[llvm] [SystemZ] Enable liveness reduction in pre-RA sched strategy. (PR #188823)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 03:51:51 PDT 2026


================
@@ -154,9 +151,22 @@ void SystemZPreRASchedStrategy::initialize(ScheduleDAGMI *dag) {
 
   Cmp0SrcReg = SystemZ::NoRegister;
 
-  initializeLatencyReduction();
-  LLVM_DEBUG(dbgs() << "Latency scheduling " << (HasDataSequences ? "" : "not ")
-                    << "enabled for data sequences.\n";);
+  unsigned DAGHeight = 0;
+  for (unsigned Idx = 0, End = DAG->SUnits.size(); Idx != End; ++Idx)
+    DAGHeight = std::max(DAGHeight, DAG->SUnits[Idx].getHeight());
+
+  if (RegionPolicy.ShouldTrackPressure) {
+    float Ratio = DAG->SUnits.size() < 50 ? 0.25 : 0.5;
+    LivenessHeightCutOff = std::floor(Ratio * float(DAGHeight));
----------------
uweigand wrote:

I don't think we should be using floating-point computation here, and it's also completely unnecessary.  The "floor" of a division by 2 or 4 can be done via integer arithmetic (or a simple shift).

https://github.com/llvm/llvm-project/pull/188823


More information about the llvm-commits mailing list