Subzero: fix another load from constant data
When I (hack) fixed the fact that Subzero fails to load from a constant
source because it interprets it as an offset, I did so by routing all
loads into sz::createLoad, and in there, making sure to bitcast constant
sources to variables. I thought this covered all loads, but it turns out
that one of our optimization passes optimizes stores by removing
intermediate stores. This would sometimes replace a variable source with
a constant one, so I applied a similar hack here to avoid doing replace
in this case.
Bug: b/148272103
Change-Id: I809688e2c79fa1b62918d3b484a8e2a9e601bd90
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/41269
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Reactor/SubzeroReactor.cpp b/src/Reactor/SubzeroReactor.cpp
index fbbec49..f2dbdef 100644
--- a/src/Reactor/SubzeroReactor.cpp
+++ b/src/Reactor/SubzeroReactor.cpp
@@ -922,10 +922,10 @@
rr::optimize(currFunc);
currFunc->computeInOutEdges();
- ASSERT(!currFunc->hasError());
+ ASSERT_MSG(!currFunc->hasError(), "%s", currFunc->getError().c_str());
currFunc->translate();
- ASSERT(!currFunc->hasError());
+ ASSERT_MSG(!currFunc->hasError(), "%s", currFunc->getError().c_str());
currFunc->getAssembler<>()->setInternal(currFunc->getInternal());