Skip to content

Commit 95a2784

Browse files
pkwasnie-intelpszymich
authored andcommitted
don't count debug instructions in GenIntrinsicsTTIImpl
Don't count debug instructions in GenIntrinsicsTTIImpl. (cherry picked from commit f1925bd)
1 parent 15a9f48 commit 95a2784

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
@@ -85,6 +85,8 @@ namespace llvm {
8585
llvm::BasicBlock* BB = const_cast<llvm::BasicBlock*>(&*BBI);
8686
for (auto II = BB->begin(); II != BB->end(); II++)
8787
{
88+
if (IGCLLVM::isDebugOrPseudoInst(*II))
89+
continue;
8890
if (llvm::GenIntrinsicInst* pIntrinsic = llvm::dyn_cast<llvm::GenIntrinsicInst>(II))
8991
{
9092
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)