Commit b59b7786 by Antonio Maiorano

Subzero: add subzeroEmitTextAsm flag

If enabled, and ALLOW_DUMP = 1, emit() outputs text asm to stdout along with liveness info. Useful for debugging register allocation. Bug: b/144688789 Change-Id: I36137c439f6f2ca32af6f208146501b095ccfac4 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38478Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 05ac79a5
......@@ -162,9 +162,11 @@ namespace
const bool emulateMismatchedBitCast = CPUID::ARM;
constexpr bool subzeroDumpEnabled = false;
constexpr bool subzeroEmitTextAsm = false;
#if !ALLOW_DUMP
static_assert(!subzeroDumpEnabled, "Compile Subzero with ALLOW_DUMP=1 for subzeroDumpEnabled");
static_assert(!subzeroEmitTextAsm, "Compile Subzero with ALLOW_DUMP=1 for subzeroEmitTextAsm");
#endif
}
......@@ -600,6 +602,12 @@ namespace rr
static llvm::raw_os_ostream cout(std::cout);
static llvm::raw_os_ostream cerr(std::cerr);
if (subzeroEmitTextAsm)
{
// Decorate text asm with liveness info
Flags.setDecorateAsm(true);
}
if(false) // Write out to a file
{
std::error_code errorCode;
......@@ -679,6 +687,12 @@ namespace rr
}
::context->emitFileHeader();
if (subzeroEmitTextAsm)
{
::function->emit();
}
::function->emitIAS();
auto assembler = ::function->releaseAssembler();
auto objectWriter = ::context->getObjectWriter();
......
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