[llvm] [nfc] Fix RTTI for `InstrProf` intrinsics (PR #83511)
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 5 16:07:41 PST 2024
================
@@ -1429,7 +1429,35 @@ class VACopyInst : public IntrinsicInst {
/// A base class for all instrprof intrinsics.
class InstrProfInstBase : public IntrinsicInst {
+protected:
+ static bool isCounterBase(const IntrinsicInst &I) {
+ switch (I.getIntrinsicID()) {
+ case Intrinsic::instrprof_cover:
+ case Intrinsic::instrprof_increment:
+ case Intrinsic::instrprof_increment_step:
+ case Intrinsic::instrprof_timestamp:
+ case Intrinsic::instrprof_value_profile:
+ return true;
+ }
+ return false;
+ }
+ static bool isMCDCBitmapBase(const IntrinsicInst &I) {
+ switch (I.getIntrinsicID()) {
+ case Intrinsic::instrprof_mcdc_parameters:
+ case Intrinsic::instrprof_mcdc_tvbitmap_update:
+ return true;
+ }
+ return false;
+ }
+
public:
+ static bool classof(const Value *V) {
+ if (const auto *Instr = dyn_cast<IntrinsicInst>(V))
+ return isCounterBase(*Instr) || isMCDCBitmapBase(*Instr) ||
+ Instr->getIntrinsicID() ==
+ Intrinsic::instrprof_mcdc_condbitmap_update;
----------------
ellishg wrote:
Nevermind, I found the comment for `InstrProfMCDCCondBitmapUpdate`
https://github.com/llvm/llvm-project/pull/83511
More information about the llvm-commits
mailing list