Commit 05ac79a5 by Antonio Maiorano

Subzero: add subzeroDumpEnabled flag

When enabled, coupled with ALLOW_DUMP = 1, will enable verbose and unbuffered logging. Helpful for debugging Subzero bugs. Bug: b/144688789 Change-Id: Ia5ae4456e4ec43dcf616f7f14cf88cd0911fe17b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38477 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
parent 85e5e458
...@@ -160,6 +160,12 @@ namespace ...@@ -160,6 +160,12 @@ namespace
const bool CPUID::SSE4_1 = CPUID::detectSSE4_1(); const bool CPUID::SSE4_1 = CPUID::detectSSE4_1();
const bool emulateIntrinsics = false; const bool emulateIntrinsics = false;
const bool emulateMismatchedBitCast = CPUID::ARM; const bool emulateMismatchedBitCast = CPUID::ARM;
constexpr bool subzeroDumpEnabled = false;
#if !ALLOW_DUMP
static_assert(!subzeroDumpEnabled, "Compile Subzero with ALLOW_DUMP=1 for subzeroDumpEnabled");
#endif
} }
namespace rr namespace rr
...@@ -588,7 +594,7 @@ namespace rr ...@@ -588,7 +594,7 @@ namespace rr
Flags.setOutFileType(Ice::FT_Elf); Flags.setOutFileType(Ice::FT_Elf);
Flags.setOptLevel(toIce(getDefaultConfig().getOptimization().getLevel())); Flags.setOptLevel(toIce(getDefaultConfig().getOptimization().getLevel()));
Flags.setApplicationBinaryInterface(Ice::ABI_Platform); Flags.setApplicationBinaryInterface(Ice::ABI_Platform);
Flags.setVerbose(false ? Ice::IceV_Most : Ice::IceV_None); Flags.setVerbose(subzeroDumpEnabled ? Ice::IceV_Most : Ice::IceV_None);
Flags.setDisableHybridAssembly(true); Flags.setDisableHybridAssembly(true);
static llvm::raw_os_ostream cout(std::cout); static llvm::raw_os_ostream cout(std::cout);
...@@ -644,6 +650,12 @@ namespace rr ...@@ -644,6 +650,12 @@ namespace rr
std::shared_ptr<Routine> Nucleus::acquireRoutine(const char *name, const Config::Edit &cfgEdit /* = Config::Edit::None */) std::shared_ptr<Routine> Nucleus::acquireRoutine(const char *name, const Config::Edit &cfgEdit /* = Config::Edit::None */)
{ {
if (subzeroDumpEnabled)
{
// Output dump strings immediately, rather than once buffer is full. Useful for debugging.
context->getStrDump().SetUnbuffered();
}
if(basicBlock->getInsts().empty() || basicBlock->getInsts().back().getKind() != Ice::Inst::Ret) if(basicBlock->getInsts().empty() || basicBlock->getInsts().back().getKind() != Ice::Inst::Ret)
{ {
createRetVoid(); createRetVoid();
......
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