Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
TiarkRompf committed Dec 17, 2016
1 parent f9da84b commit 16b0ead
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/internal/Expressions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ trait Expressions extends Utils {
case _ => None
}

def infix_defines[A: Manifest](stm: Stm, rhs: Def[A]): Option[Sym[A]] = stm match {
case TP(sym: Sym[A], `rhs`) if sym.tp <:< manifest[A] => Some(sym)
def infix_defines[A: Typ](stm: Stm, rhs: Def[A]): Option[Sym[A]] = stm match {
case TP(sym: Sym[A], `rhs`) if sym.tp <:< typ[A] => Some(sym)
case _ => None
}

Expand Down Expand Up @@ -139,7 +139,7 @@ trait Expressions extends Utils {
globalDefsCache.get(s)
//globalDefs.find(x => x.defines(s).nonEmpty)

def findDefinition[T: Manifest](d: Def[T]): Option[Stm] =
def findDefinition[T: Typ](d: Def[T]): Option[Stm] =
globalDefs.find(x => x.defines(d).nonEmpty)

def findOrCreateDefinition[T:Typ](d: Def[T], pos: List[SourceContext]): Stm =
Expand Down
4 changes: 2 additions & 2 deletions src/internal/FatExpressions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ trait FatExpressions extends Expressions {
case _ => super.infix_defines(stm, sym)
}

override def infix_defines[A: Manifest](stm: Stm, rhs: Def[A]): Option[Sym[A]] = stm match {
override def infix_defines[A: Typ](stm: Stm, rhs: Def[A]): Option[Sym[A]] = stm match {
case TTP(lhs, mhs, rhs) => mhs.indexOf(rhs) match {
case idx if idx >= 0 =>
val sym = lhs(idx)
if (sym.tp <:< manifest[A])
if (sym.tp <:< typ[A])
Some(sym.asInstanceOf[Sym[A]])
else
None
Expand Down
1 change: 0 additions & 1 deletion test-out/epfl/test9-struct3.check
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ partitions: List(TTP(List(Sym(4), Sym(5), Sym(13)),List(SimpleLoop(Const(100),Sy
considering TP(Sym(9),ArrayIndex(Sym(5),Sym(7)))
replace TP(Sym(9),ArrayIndex(Sym(5),Sym(7))) at 1 within TTP(List(Sym(4), Sym(5), Sym(13)),List(SimpleLoop(Const(100),Sym(1),ArrayElem(Block(Sym(1)))), SimpleLoop(Const(100),Sym(1),ArrayElem(Block(Sym(2)))), SimpleLoop(Const(100),Sym(7),ArrayElem(Block(Sym(11))))),SimpleFatLoop(Const(100),Sym(1),List(ArrayElem(Block(Sym(1))), ArrayElem(Block(Sym(2))), ArrayElem(Block(Sym(11))))))
warning: mirroring of Sym(11)=DoubleMinus(Const(0.0),Sym(9)) type Double returned Sym(1) type Int (not a subtype)
warning: mirroring of Sym(13)=SimpleLoop(Const(100),Sym(7),ArrayElem(Block(Sym(11)))) type Array[Double] returned Sym(4)=SimpleLoop(Const(100),Sym(1),ArrayElem(Block(Sym(1)))) type Array[Int] (not a subtype)
try once more ...
wtableneg: List()
partitions: List(TTP(List(Sym(4), Sym(17)),List(SimpleLoop(Const(100),Sym(1),ArrayElem(Block(Sym(1)))), SimpleLoop(Const(100),Sym(1),ArrayElem(Block(Sym(1))))),SimpleFatLoop(Const(100),Sym(1),List(ArrayElem(Block(Sym(1))), ArrayElem(Block(Sym(1)))))))
Expand Down
2 changes: 1 addition & 1 deletion test-src/epfl/test1-arith/Arrays.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trait ArraysExp extends Arrays with BaseExp {

case class ArrayApply[T:Typ](x:Rep[Array[T]], i:Int) extends Def[T]
//case class ArrayUpdate[T](x:Rep[Array[T]], i:Int) extends Def[T]
case class MakeArray[T](x:List[Rep[T]])(implicit val m: Manifest[T]) extends Def[Array[T]]
case class MakeArray[T](x:List[Rep[T]])(implicit val m: Typ[T]) extends Def[Array[T]]

def arrayApply[T:Typ](x: Rep[Array[T]], i:Int) = ArrayApply(x, i)
//def arrayUpdate(x: Rep[Double]) = ArrayUpdate(x)
Expand Down
2 changes: 1 addition & 1 deletion test-src/epfl/test2-fft/DisableOpts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package test2
import internal._

trait DisableCSE extends Expressions {
override def findDefinition[T: Manifest](d: Def[T]) = None
override def findDefinition[T: Typ](d: Def[T]) = None
}


Expand Down
2 changes: 1 addition & 1 deletion test-src/epfl/test3-parsers/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trait Parsers { this: Matching with Extractors =>
type Elem
type Input = List[Elem]
// Don't declare as implicit val in children, it gives problems with initialization order!
implicit val mE: Manifest[Elem]
implicit val mE: Typ[Elem]

abstract class Parser {
def apply(in: Rep[Input]): Rep[ParseResult]
Expand Down

0 comments on commit 16b0ead

Please sign in to comment.