Skip to content

Commit 982053e

Browse files
committed
[Attributor][NFC] Improve debug code and comments
1 parent 0ece283 commit 982053e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

llvm/lib/Transforms/IPO/Attributor.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ Attributor::getAssumedConstant(const IRPosition &IRP,
10291029
return C;
10301030
// First check all callbacks provided by outside AAs. If any of them returns
10311031
// a non-null value that is different from the associated value, or None, we
1032-
// assume it's simpliied.
1032+
// assume it's simplified.
10331033
for (auto &CB : SimplificationCallbacks.lookup(IRP)) {
10341034
Optional<Value *> SimplifiedV = CB(IRP, &AA, UsedAssumedInformation);
10351035
if (!SimplifiedV.hasValue())
@@ -1067,7 +1067,7 @@ Attributor::getAssumedSimplified(const IRPosition &IRP,
10671067
bool &UsedAssumedInformation) {
10681068
// First check all callbacks provided by outside AAs. If any of them returns
10691069
// a non-null value that is different from the associated value, or None, we
1070-
// assume it's simpliied.
1070+
// assume it's simplified.
10711071
for (auto &CB : SimplificationCallbacks.lookup(IRP))
10721072
return CB(IRP, AA, UsedAssumedInformation);
10731073

@@ -1917,7 +1917,8 @@ ChangeStatus Attributor::cleanupIR() {
19171917
<< ToBeDeletedBlocks.size() << " blocks and "
19181918
<< ToBeDeletedInsts.size() << " instructions and "
19191919
<< ToBeChangedValues.size() << " values and "
1920-
<< ToBeChangedUses.size() << " uses. "
1920+
<< ToBeChangedUses.size() << " uses. To insert "
1921+
<< ToBeChangedToUnreachableInsts.size() << " unreachables."
19211922
<< "Preserve manifest added " << ManifestAddedBlocks.size()
19221923
<< " blocks\n");
19231924

@@ -1937,7 +1938,7 @@ ChangeStatus Attributor::cleanupIR() {
19371938

19381939
Instruction *I = dyn_cast<Instruction>(U->getUser());
19391940
assert((!I || isRunOn(*I->getFunction())) &&
1940-
"Cannot replace an invoke outside the current SCC!");
1941+
"Cannot replace an instruction outside the current SCC!");
19411942

19421943
// Do not replace uses in returns if the value is a must-tail call we will
19431944
// not delete.
@@ -3108,8 +3109,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS,
31083109
if (!S.isValidState())
31093110
OS << "full-set";
31103111
else {
3111-
for (auto &it : S.getAssumedSet())
3112-
OS << it << ", ";
3112+
for (auto &It : S.getAssumedSet())
3113+
OS << It << ", ";
31133114
if (S.undefIsContained())
31143115
OS << "undef ";
31153116
}

llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5400,9 +5400,9 @@ struct AAValueSimplifyImpl : AAValueSimplify {
54005400
/// See AbstractAttribute::getAsStr().
54015401
const std::string getAsStr() const override {
54025402
LLVM_DEBUG({
5403-
errs() << "SAV: " << (bool)SimplifiedAssociatedValue << " ";
5403+
dbgs() << "SAV: " << (bool)SimplifiedAssociatedValue << " ";
54045404
if (SimplifiedAssociatedValue && *SimplifiedAssociatedValue)
5405-
errs() << "SAV: " << **SimplifiedAssociatedValue << " ";
5405+
dbgs() << "SAV: " << **SimplifiedAssociatedValue << " ";
54065406
});
54075407
return isValidState() ? (isAtFixpoint() ? "simplified" : "maybe-simple")
54085408
: "not-simple";

0 commit comments

Comments
 (0)