Skip to content

Commit ee79716

Browse files
committed
[flang][NFC] AliasAnalysis: Use Indirect not Unknown for LoadOp
As mentioned at <llvm#126156 (comment)>: PR llvm#126156 causes AliasAnalysis::getSource to sometimes return SourceKind::Unknown when it used to return SourceKind::Indirect for a LoadOp. This patch restores that part of the old behavior. It should not affect user-visible behavior because AliasAnalysis::alias treats SourceKind::Unknown and SourceKind::Indirect equivalently, but it does improve debugging output.
1 parent 8fc03e4 commit ee79716

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

flang/lib/Optimizer/Analysis/AliasAnalysis.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -641,14 +641,13 @@ AliasAnalysis::Source AliasAnalysis::getSource(mlir::Value v,
641641
} else if (isDummyArgument(def)) {
642642
defOp = nullptr;
643643
v = def;
644+
} else {
645+
type = SourceKind::Indirect;
644646
}
645-
646-
breakFromLoop = true;
647-
return;
647+
} else {
648+
// No further tracking for addresses loaded from memory for now.
649+
type = SourceKind::Indirect;
648650
}
649-
650-
// No further tracking for addresses loaded from memory for now.
651-
type = SourceKind::Indirect;
652651
breakFromLoop = true;
653652
})
654653
.Case<fir::AddrOfOp>([&](auto op) {

0 commit comments

Comments
 (0)