Ignore source mapping for LLVM debug, lifetime, invariant instructions

This commit is contained in:
Jake Turner
2025-01-06 11:22:12 +00:00
parent 80e4d5e1a6
commit b370ba10d6
@@ -113,10 +113,10 @@ bool IsLLVMIntrinsicCall(const Instruction &inst)
bool ShouldIgnoreSourceMapping(const Instruction &inst)
{
// Do not set source mapping for handle creation instructions
if(inst.op == Operation::Call)
{
rdcstr funcCallName = inst.getFuncCall()->name;
// Do not set source mapping for handle creation instructions
if(funcCallName.beginsWith("dx.op."))
{
DXOp dxOpCode = DXOp::NumOpCodes;
@@ -131,6 +131,24 @@ bool ShouldIgnoreSourceMapping(const Instruction &inst)
default: break;
}
}
else if(funcCallName.beginsWith("llvm."))
{
// Do not set source mapping for LLVM debug instructions
if(funcCallName.beginsWith("llvm.dbg."))
{
return true;
}
// Do not set source mapping for LLVM lifetime instructions
else if(funcCallName.beginsWith("llvm.lifetime."))
{
return true;
}
// Do not set source mapping for LLVM invariant instructions
else if(funcCallName.beginsWith("llvm.invariant"))
{
return true;
}
}
}
return false;
}