[llvm] [mfc] Fix RTTI for `InstrProf` intrinsics (PR #83511)
Mircea Trofin via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 29 17:09:04 PST 2024
https://github.com/mtrofin created https://github.com/llvm/llvm-project/pull/83511
None
>From 6344b6a0618006ddbaac6c773dd39f1f49de7530 Mon Sep 17 00:00:00 2001
From: Mircea Trofin <mtrofin at google.com>
Date: Thu, 29 Feb 2024 17:08:19 -0800
Subject: [PATCH] [mfc] Fix RTTI for `InstrProf` intrinsics
---
llvm/include/llvm/IR/IntrinsicInst.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
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.
More information about the llvm-commits
mailing list