From 9bc2e6daaf3a3a08aefe485aa924c820689de981 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Wed, 31 Oct 2018 14:59:40 -0700 Subject: Remove all uses of get_flip and deprecate It is O(n) and every use is in an O(n) iteration resulting in O(n^2). Same information can be extracted from create_exps which happens to also be called at every use of get_flip. --- src/main/scala/firrtl/Utils.scala | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/scala/firrtl/Utils.scala') diff --git a/src/main/scala/firrtl/Utils.scala b/src/main/scala/firrtl/Utils.scala index 53e8c157..44b16bf8 100644 --- a/src/main/scala/firrtl/Utils.scala +++ b/src/main/scala/firrtl/Utils.scala @@ -300,6 +300,7 @@ object Utils extends LazyLogging { onExp(expression) ReferenceTarget(main, module, Nil, ref, tokens) } + @deprecated("get_flip is fundamentally slow, use to_flip(gender(expr))", "1.2") def get_flip(t: Type, i: Int, f: Orientation): Orientation = { if (i >= get_size(t)) throwInternalError(s"get_flip: shouldn't be here - $i >= get_size($t)") t match { -- cgit v1.2.3