[llvm] Unroll loops apple (PR #149358)

Jon Roelofs via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 23 11:46:46 PDT 2025


================
@@ -4821,9 +4821,16 @@ getAppleRuntimeUnrollPreferences(Loop *L, ScalarEvolution &SE,
         const SCEV *PtrSCEV = SE.getSCEV(Ptr);
         if (SE.isLoopInvariant(PtrSCEV, L))
           continue;
-        if (isa<LoadInst>(&I))
-          LoadedValues.insert(&I);
-        else
+        if (isa<LoadInst>(&I)) {
+          LoadedValuesPlus.insert(&I);
+          // Included 1st users of loaded values
----------------
jroelofs wrote:

Some comment here explaining the "why" / intuition would help.

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


More information about the llvm-commits mailing list