Skip to content

Commit

Permalink
[Attributor][NFC] Improve debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jdoerfert committed Mar 7, 2022
1 parent 87ec6f4 commit 8fa839a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Expand Up @@ -3452,7 +3452,7 @@ struct AAIsDeadValueImpl : public AAIsDead {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr() const override {
virtual const std::string getAsStr() const override {
return isAssumedDead() ? "assumed-dead" : "assumed-live";
}

Expand Down Expand Up @@ -3538,6 +3538,15 @@ struct AAIsDeadFloating : public AAIsDeadValueImpl {
});
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr() const override {
Instruction *I = dyn_cast<Instruction>(&getAssociatedValue());
if (isa_and_nonnull<StoreInst>(I))
if (isValidState())
return "assumed-dead-store";
return AAIsDeadValueImpl::getAsStr();
}

/// See AbstractAttribute::updateImpl(...).
ChangeStatus updateImpl(Attributor &A) override {
Instruction *I = dyn_cast<Instruction>(&getAssociatedValue());
Expand Down

0 comments on commit 8fa839a

Please sign in to comment.