Skip to content

Commit 94e9e53

Browse files
committed
Expression rewriting may enable further constant propagation
1 parent bc4454a commit 94e9e53

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/analyses/constant_propagator.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,18 @@ bool constant_propagator_domaint::ai_simplify(
269269
exprt &condition,
270270
const namespacet &ns) const
271271
{
272-
bool b=values.replace_const.replace(condition);
273-
b&=simplify(condition, ns);
272+
bool no_change = true;
274273

275-
return b;
274+
while(!values.replace_const.replace(condition))
275+
{
276+
no_change = false;
277+
simplify(condition, ns);
278+
}
279+
280+
if(no_change)
281+
no_change &= simplify(condition, ns);
282+
283+
return no_change;
276284
}
277285

278286

0 commit comments

Comments
 (0)