-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[nfc] Fix RTTI for InstrProf
intrinsics
#83511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-llvm-ir Author: Mircea Trofin (mtrofin) ChangesFull diff: https://github.com/llvm/llvm-project/pull/83511.diff 1 Files Affected:
diff --git a/llvm/include/llvm/IR/IntrinsicInst.h b/llvm/include/llvm/IR/IntrinsicInst.h
index fbaaef8ea44315..2bd4f94f53170e 100644
--- a/llvm/include/llvm/IR/IntrinsicInst.h
+++ b/llvm/include/llvm/IR/IntrinsicInst.h
@@ -1428,8 +1428,15 @@ class VACopyInst : public IntrinsicInst {
};
/// A base class for all instrprof intrinsics.
+class InstrProfInstBase;
+class InstrProfMCDCBitmapInstBase;
+class InstrProfMCDCCondBitmapUpdate;
class InstrProfInstBase : public IntrinsicInst {
public:
+ static bool classof(const Value *V) {
+ return isa<InstrProfInstBase>(V) || isa<InstrProfMCDCBitmapInstBase>(V) ||
+ isa<InstrProfMCDCCondBitmapUpdate>(V);
+ }
// The name of the instrumented function.
GlobalVariable *getName() const {
return cast<GlobalVariable>(
@@ -1442,8 +1449,17 @@ class InstrProfInstBase : public IntrinsicInst {
};
/// A base class for all instrprof counter intrinsics.
+class InstProfCoverInst;
+class InstProfIncrementInst;
+class InstrProfTimestampInst;
+class InstrProfValueProfileInst;
class InstrProfCntrInstBase : public InstrProfInstBase {
public:
+ static bool classof(const Value *V){
+ return isa<InstProfCoverInst>(V) || isa<InstProfIncrementInst>(V) ||
+ isa<InstrProfTimestampInst>(V) || isa<InstrProfValueProfileInst>(V);
+ }
+
// The number of counters for the instrumented function.
ConstantInt *getNumCounters() const;
// The index of the counter that this instruction acts on.
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
InstrProf
intrinsicsInstrProf
intrinsics
…#83364) Simpler code, compared to tracking state of 2 variables and the ambiguity of "0" CountValue (is it 0 or is it invalid?)
@ellishg - is this good to go? thanks! |
if (const auto *Instr = dyn_cast<IntrinsicInst>(V)) | ||
return isCounterBase(*Instr) || isMCDCBitmapBase(*Instr) || | ||
Instr->getIntrinsicID() == | ||
Intrinsic::instrprof_mcdc_condbitmap_update; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should be in isMCDCBitmapBase()
CC @evodius96
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I found the comment for InstrProfMCDCCondBitmapUpdate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Following up PR llvm#83511, added a test to cover the inheritance graph for these intrinsics.
No description provided.