Skip to content

Commit 99488f9

Browse files
committed
skip load users outside the loop
1 parent badebd0 commit 99488f9

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4824,13 +4824,10 @@ getAppleRuntimeUnrollPreferences(Loop *L, ScalarEvolution &SE,
48244824
continue;
48254825
if (isa<LoadInst>(&I)) {
48264826
LoadedValuesPlus.insert(&I);
4827-
// Included 1st users of loaded values
4828-
for (auto *U : I.users()) {
4829-
auto *Inst = cast<Instruction>(U);
4830-
if (!Inst)
4831-
continue;
4832-
LoadedValuesPlus.insert(U);
4833-
}
4827+
// Include in-loop 1st users of loaded values.
4828+
for (auto *U : I.users())
4829+
if (L->contains(cast<Instruction>(U)))
4830+
LoadedValuesPlus.insert(U);
48344831
} else
48354832
Stores.push_back(cast<StoreInst>(&I));
48364833
}

0 commit comments

Comments
 (0)