-
Work around Subzero constant folding limitation. · a972758dNicolas Capens authored
The Subzero JIT only supports constants in the second operand of arithmetic operations, not the first. It assumes constant folding already took place (true for NaCl which takes LLVM IR as input). Reactor has constant folding as part of the static C++ compilation, but the Optimizer may substitute the first operand for a constant (i.e. constant propagation). Addressing it in the Optimizer by not performing the substitution is not trivial because we'd have to check each use. And it would cost run-time performance. Ideally we'd have a pass for legalization/optimization which performs constant folding. For now, avoid hitting 'unreachable' code in Subzero by multiplying constants at the Reactor level. Fixes regression caused by https://swiftshader-review.googlesource.com/22910 Bug chromium:904265 Bug swiftshader:14 Change-Id: Ifdc72ac997ad5d71c1f7006259f54f3d715cb613 Reviewed-on: https://swiftshader-review.googlesource.com/c/22930Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
a972758d
×