Fix incorrect condition in varNotReferenced (#2873)
The intention was to not merge impure assignments, but the actual predicate failed if the assignment was indeed pure. This fix gains 1.5% speed on SweRV EH1.
This commit is contained in:
parent
273fcce095
commit
4f36e3e6c9
|
|
@ -1531,7 +1531,7 @@ private:
|
||||||
// Return false if referenced, or tree too deep to be worth it, or side effects
|
// Return false if referenced, or tree too deep to be worth it, or side effects
|
||||||
if (!nodep) return true;
|
if (!nodep) return true;
|
||||||
if (level > 2) return false;
|
if (level > 2) return false;
|
||||||
if (nodep->isPure()) return false; // For example a $fgetc can't be reordered
|
if (!nodep->isPure()) return false; // For example a $fgetc can't be reordered
|
||||||
if (VN_IS(nodep, NodeVarRef) && VN_CAST(nodep, NodeVarRef)->varp() == varp) return false;
|
if (VN_IS(nodep, NodeVarRef) && VN_CAST(nodep, NodeVarRef)->varp() == varp) return false;
|
||||||
return (varNotReferenced(nodep->nextp(), varp, level + 1)
|
return (varNotReferenced(nodep->nextp(), varp, level + 1)
|
||||||
&& varNotReferenced(nodep->op1p(), varp, level + 1)
|
&& varNotReferenced(nodep->op1p(), varp, level + 1)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ execute(
|
||||||
check_finished => 1,
|
check_finished => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
file_grep($Self->{stats}, qr/SplitVar,\s+Split packed variables\s+(\d+)/i, 13);
|
file_grep($Self->{stats}, qr/SplitVar,\s+Split packed variables\s+(\d+)/i, 11);
|
||||||
file_grep($Self->{stats}, qr/SplitVar,\s+Split unpacked arrays\s+(\d+)/i, 27);
|
file_grep($Self->{stats}, qr/SplitVar,\s+Split unpacked arrays\s+(\d+)/i, 27);
|
||||||
ok(1);
|
ok(1);
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ execute(
|
||||||
);
|
);
|
||||||
|
|
||||||
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
|
vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename});
|
||||||
file_grep($Self->{stats}, qr/SplitVar,\s+Split packed variables\s+(\d+)/i, 12);
|
file_grep($Self->{stats}, qr/SplitVar,\s+Split packed variables\s+(\d+)/i, 10);
|
||||||
file_grep($Self->{stats}, qr/SplitVar,\s+Split unpacked arrays\s+(\d+)/i, 27);
|
file_grep($Self->{stats}, qr/SplitVar,\s+Split unpacked arrays\s+(\d+)/i, 27);
|
||||||
|
|
||||||
ok(1);
|
ok(1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue