@@ -11,7 +11,6 @@ SPDX-License-Identifier: MIT
11
11
#include " Compiler/CISACodeGen/CastToGASAnalysis.h"
12
12
#include " Compiler/CodeGenContextWrapper.hpp"
13
13
#include " Compiler/MetaDataUtilsWrapper.h"
14
- #include " Metrics/IGCMetric.h"
15
14
#include " Compiler/IGCPassSupport.h"
16
15
#include " WrapperLLVM/Utils.h"
17
16
#include " llvm/ADT/PostOrderIterator.h"
@@ -1345,7 +1344,6 @@ namespace IGC
1345
1344
void updateMetadata (Function* oldFunc, Function* newFunc);
1346
1345
Function* createFuncWithLoweredArgs (Function* F, GenericPointerArgs& argsInfo);
1347
1346
std::vector<Function*> findCandidates (CallGraph& CG);
1348
- void replaceValueInDbgInfoIntrinsic (llvm::Value* Old, llvm::Value* New, llvm::Module& M);
1349
1347
};
1350
1348
} // End anonymous namespace
1351
1349
@@ -1631,7 +1629,7 @@ void LowerGPCallArg::updateFunctionArgs(Function* oldFunc, Function* newFunc)
1631
1629
// used to directly update uses in metadata node. In case of GAS, RAUW asserts because
1632
1630
// addrspace used in Old/New values are different and this is interpreted as different
1633
1631
// types by LLVM and RAUW on different types is forbidden.
1634
- void LowerGPCallArg:: replaceValueInDbgInfoIntrinsic (llvm::Value* Old, llvm::Value* New, llvm::Module& M)
1632
+ void replaceValueInDbgInfoIntrinsic (llvm::Value* Old, llvm::Value* New, llvm::Module& M)
1635
1633
{
1636
1634
if (Old->isUsedByMetadata ())
1637
1635
{
@@ -1640,10 +1638,10 @@ void LowerGPCallArg::replaceValueInDbgInfoIntrinsic(llvm::Value* Old, llvm::Valu
1640
1638
if (addrSpaceMD)
1641
1639
{
1642
1640
llvm::DIBuilder DIB (M);
1643
- std::vector<llvm::Instruction *> instToDelete ;
1641
+ std::vector<llvm::DbgInfoIntrinsic *> DbgInfoInstToDelete ;
1644
1642
for (auto * User : addrSpaceMD->users ())
1645
1643
{
1646
- if (isa <DbgInfoIntrinsic>(User))
1644
+ if (cast <DbgInfoIntrinsic>(User))
1647
1645
{
1648
1646
// User->dump();
1649
1647
if (auto DbgV = cast<DbgValueInst>(User))
@@ -1658,26 +1656,12 @@ void LowerGPCallArg::replaceValueInDbgInfoIntrinsic(llvm::Value* Old, llvm::Valu
1658
1656
DbgD->getVariable (), DbgD->getExpression (), DbgD->getDebugLoc ().get (),
1659
1657
cast<llvm::Instruction>(User));
1660
1658
}
1661
-
1662
- instToDelete.push_back (cast<llvm::DbgInfoIntrinsic>(User));
1663
- }
1664
- else if (isa<CallInst>(User))
1665
- {
1666
- if (auto callInst = cast<CallInst>(User))
1667
- {
1668
- if (IGCMetrics::IGCMetric::isMetricFuncCall (
1669
- cast<CallInst>(User)))
1670
- {
1671
- m_ctx->metrics .UpdateVariable (Old, New);
1672
- }
1673
- }
1674
-
1675
- instToDelete.push_back (cast<llvm::CallInst>(User));
1659
+ DbgInfoInstToDelete.push_back (cast<llvm::DbgInfoIntrinsic>(User));
1676
1660
}
1677
1661
}
1678
1662
1679
- for (auto inst : instToDelete )
1680
- inst ->eraseFromParent ();
1663
+ for (auto DbgInfoInst : DbgInfoInstToDelete )
1664
+ DbgInfoInst ->eraseFromParent ();
1681
1665
}
1682
1666
}
1683
1667
}
0 commit comments