aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/synth/synth-inference.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/synth/synth-inference.adb b/src/synth/synth-inference.adb
index 4ac726c32..e9a6eeab0 100644
--- a/src/synth/synth-inference.adb
+++ b/src/synth/synth-inference.adb
@@ -464,7 +464,13 @@ package body Synth.Inference is
Enable : Net;
begin
if not Flags.Flag_Debug_Noinference then
- Find_Longest_Loop (Val, Prev_Val, Last_Mux, Len);
+ if Get_First_Sink (Prev_Val) = No_Input then
+ -- PREV_VAL is never read, so there cannot be any loop.
+ -- This is an important optimization for control signals.
+ Len := -1;
+ else
+ Find_Longest_Loop (Val, Prev_Val, Last_Mux, Len);
+ end if;
else
Len := -1;
end if;