spatial icon indicating copy to clipboard operation
spatial copied to clipboard

Mysterious mux deletion

Open dkoeplin opened this issue 6 years ago • 1 comments

val reg = Reg[Int](0)
if (i.to[I32] == reg) 0x80.to[UInt8] else 0.to[UInt8]

Appears to be deleting the mux, but removing the .to[I32] fixes this.

image

dkoeplin avatar Aug 17 '18 03:08 dkoeplin

I don't think this is the same root cause but I think its worth addressing and is kind of the same behavior. In SW_alg, we have if ((c == length | r == length) & ...) possible_entry_point := entry_tuple(r, c, update.score) c and r are iterators and length is an ArgIn. This code gets replaced with a hardcoded false, probably because it thinks an iterator will never equal an ArgIn and it is fixed if you do .value on the ArgIns. This seems like an easy thing to overlook and be confused about when debugging.

EDIT: I guess it shows warnings, but I think this is the kind of thing that should crash instead of warn

mattfel1 avatar Sep 01 '18 02:09 mattfel1