Skip to content

Commit 555e41b

Browse files
committed
[AliasSet] Fix UnknownInstructions printing
Summary: AliasSet::print uses `I->printAsOperand` to print UnknownInstructions. The problem is that not all UnknownInstructions have names (e.g. call instructions). When such instructions are printed, they appear as `<badref>` in AliasSets, which is very confusing, as the values are perfectly valid. This patch fixes that by printing UnknownInstructions without a name using `print` instead of `printAsOperand`. Reviewers: asbirlea, chandlerc, sanjoy, grosser Reviewed By: asbirlea Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48609 llvm-svn: 335751
1 parent 7b7b5eb commit 555e41b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm/lib/Analysis/AliasSetTracker.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,12 @@ void AliasSet::print(raw_ostream &OS) const {
639639
OS << "\n " << UnknownInsts.size() << " Unknown instructions: ";
640640
for (unsigned i = 0, e = UnknownInsts.size(); i != e; ++i) {
641641
if (i) OS << ", ";
642-
if (auto *I = getUnknownInst(i))
643-
I->printAsOperand(OS);
642+
if (auto *I = getUnknownInst(i)) {
643+
if (I->hasName())
644+
I->printAsOperand(OS);
645+
else
646+
I->print(OS);
647+
}
644648
}
645649
}
646650
OS << "\n";

0 commit comments

Comments
 (0)