================
@@ -935,7 +935,7 @@ bool 
AArch64ConditionalCompares::runOnMachineFunction(MachineFunction &MF) {
   SchedModel = MF.getSubtarget().getSchedModel();
   MRI = &MF.getRegInfo();
   DomTree = &getAnalysis<MachineDominatorTree>();
-  Loops = getAnalysisIfAvailable<MachineLoopInfo>();
+  Loops = &getAnalysis<MachineLoopInfo>();
----------------
bjope wrote:

I think there are some "weird" things going on here. But maybe not worth 
digging into those unless being an AArch64 maintainer.

Afaict the goal here is to make sure MachineLoopInfo is preserved. So this pass 
shouldn't really need to require it explicitly. However, the 
MachineTraceMetrics pass is also using MachineLoopInfo transitively. So, the 
MachineLoopInfo analysis will be run. Although I think there is a "bug" in 
MachineTraceMetrics related to not using addRequiredTransitive. So things might 
break if removing the addRequired in this pass.

To sum up. The proposed change is probably harmless and OK. Just saying that 
the analysis pass dependencies used in here seem to be a bit ad-hoc(?).

https://github.com/llvm/llvm-project/pull/65729
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to