Subzero, Wasm: Link and run torture tests; bug fixes.
This modifies the torture test script to actually link and run the
tests in addition to just translating them.
It includes a number of bug fixes as well, particularly in the
handling of boolean values. There is some cleanup of memory address
handling, and in many cases it can avoid generating useless address
computations.
BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4369
R=jpp@chromium.org
Review URL: https://codereview.chromium.org/1890283002 .
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index 94acff9..fb3708b 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -28,7 +28,7 @@
// Adds an instruction to either the Phi list or the regular instruction list.
// Validates that all Phis are added before all regular instructions.
-void CfgNode::appendInst(Inst *Instr, bool AllowPhisAnywhere) {
+void CfgNode::appendInst(Inst *Instr) {
++InstCountEstimate;
if (BuildDefs::wasm()) {
@@ -41,7 +41,7 @@
}
if (auto *Phi = llvm::dyn_cast<InstPhi>(Instr)) {
- if (!AllowPhisAnywhere && !Insts.empty()) {
+ if (!Insts.empty()) {
Func->setError("Phi instruction added to the middle of a block");
return;
}
@@ -84,6 +84,7 @@
void CfgNode::computeSuccessors() {
OutEdges.clear();
InEdges.clear();
+ assert(!Insts.empty());
OutEdges = Insts.rbegin()->getTerminatorEdges();
}