Commit 9770a466 by Nicolas Capens Committed by Nicolas Capens

Implement Reactor breakpoints

For LLVM, uses the debugtrap intrinsic which is more debugging specific than the trap intrinsic. The Subzero implementationuses a Trap intrinsic. Both translate to 'int 3' on x86. Bug: b/135997638 Change-Id: I6eca71e74752c4646baeade9a39b338e17053336 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33369Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent a25f5438
...@@ -3732,6 +3732,13 @@ namespace rr ...@@ -3732,6 +3732,13 @@ namespace rr
for (auto arg : args) { arguments.push_back(V(arg)); } for (auto arg : args) { arguments.push_back(V(arg)); }
return V(::builder->CreateCall(funcPtr, arguments)); return V(::builder->CreateCall(funcPtr, arguments));
} }
void Breakpoint()
{
llvm::Function *debugtrap = llvm::Intrinsic::getDeclaration(::module, llvm::Intrinsic::debugtrap);
::builder->CreateCall(debugtrap);
}
} }
namespace rr namespace rr
...@@ -4293,12 +4300,6 @@ namespace rr ...@@ -4293,12 +4300,6 @@ namespace rr
} }
#endif // ENABLE_RR_PRINT #endif // ENABLE_RR_PRINT
void Break()
{
auto trap = ::llvm::Intrinsic::getDeclaration(module, llvm::Intrinsic::trap);
builder->CreateCall(trap);
}
void Nop() void Nop()
{ {
auto voidTy = ::llvm::Type::getVoidTy(*context); auto voidTy = ::llvm::Type::getVoidTy(*context);
......
...@@ -3465,6 +3465,14 @@ namespace rr ...@@ -3465,6 +3465,14 @@ namespace rr
return V(ret); return V(ret);
} }
void Breakpoint()
{
const Ice::Intrinsics::IntrinsicInfo intrinsic = {Ice::Intrinsics::Trap, Ice::Intrinsics::SideEffects_F, Ice::Intrinsics::ReturnsTwice_F, Ice::Intrinsics::MemoryWrite_F};
auto target = ::context->getConstantUndef(Ice::IceType_i32);
auto trap = Ice::InstIntrinsicCall::create(::function, 0, nullptr, target, intrinsic);
::basicBlock->appendInst(trap);
}
// Below are functions currently unimplemented for the Subzero backend. // Below are functions currently unimplemented for the Subzero backend.
// They are stubbed to satisfy the linker. // They are stubbed to satisfy the linker.
void Nucleus::createFence(std::memory_order memoryOrder) { UNIMPLEMENTED("Subzero createFence()"); } void Nucleus::createFence(std::memory_order memoryOrder) { UNIMPLEMENTED("Subzero createFence()"); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment