Skip to content

Commit f1925bd

Browse files
pkwasnie-inteligcbot
authored andcommitted
don't count debug instructions in GenIntrinsicsTTIImpl
Don't count debug instructions in GenIntrinsicsTTIImpl.
1 parent 99ded45 commit f1925bd

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

IGC/Compiler/GenTTI.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ namespace llvm {
8484
llvm::BasicBlock* BB = const_cast<llvm::BasicBlock*>(&*BBI);
8585
for (auto II = BB->begin(); II != BB->end(); II++)
8686
{
87+
if (IGCLLVM::isDebugOrPseudoInst(*II))
88+
continue;
8789
if (llvm::GenIntrinsicInst* pIntrinsic = llvm::dyn_cast<llvm::GenIntrinsicInst>(II))
8890
{
8991
if (CheckSendMsg && isSendMessage(pIntrinsic))

IGC/WrapperLLVM/include/llvmWrapper/IR/Instructions.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SPDX-License-Identifier: MIT
1010
#define IGCLLVM_IR_INSTRUCTIONS_H
1111

1212
#include "llvm/Config/llvm-config.h"
13+
#include "llvm/IR/IntrinsicInst.h"
1314
#include "llvm/IR/Instructions.h"
1415
#include "llvm/IR/User.h"
1516

@@ -79,6 +80,15 @@ namespace IGCLLVM
7980
return false;
8081
#else
8182
return llvm::isa<llvm::FreezeInst>(I);
83+
#endif
84+
}
85+
86+
inline bool isDebugOrPseudoInst(llvm::Instruction& I)
87+
{
88+
#if LLVM_VERSION_MAJOR < 14
89+
return llvm::isa<llvm::DbgInfoIntrinsic>(&I);
90+
#else
91+
return I.isDebugOrPseudoInst();
8292
#endif
8393
}
8494
}

0 commit comments

Comments
 (0)