Skip to content
Snippets Groups Projects
Commit f7142b16 authored by Richard Angersbach's avatar Richard Angersbach
Browse files

Remove lanes arg from PsVecHorizontal

parent 99726a97
No related branches found
No related tags found
1 merge request!438Reduction Support
...@@ -56,23 +56,13 @@ class PsVecHorizontal(PsBinOp, PsVectorOp): ...@@ -56,23 +56,13 @@ class PsVecHorizontal(PsBinOp, PsVectorOp):
def __init__( def __init__(
self, self,
lanes: int,
scalar_operand: PsExpression, scalar_operand: PsExpression,
vector_operand: PsExpression, vector_operand: PsExpression,
reduction_op: ReductionOp, reduction_op: ReductionOp,
): ):
super().__init__(scalar_operand, vector_operand) super().__init__(scalar_operand, vector_operand)
self._lanes = lanes
self._reduction_op = reduction_op self._reduction_op = reduction_op
@property
def lanes(self) -> int:
return self._lanes
@lanes.setter
def lanes(self, n: int):
self._lanes = n
@property @property
def scalar_operand(self) -> PsExpression: def scalar_operand(self) -> PsExpression:
return self._op1 return self._op1
...@@ -99,7 +89,7 @@ class PsVecHorizontal(PsBinOp, PsVectorOp): ...@@ -99,7 +89,7 @@ class PsVecHorizontal(PsBinOp, PsVectorOp):
def _clone_expr(self) -> PsVecHorizontal: def _clone_expr(self) -> PsVecHorizontal:
return PsVecHorizontal( return PsVecHorizontal(
self._lanes, self._op1.clone(), self._op2.clone(), self._reduction_op self._op1.clone(), self._op2.clone(), self._reduction_op
) )
def structurally_equal(self, other: PsAstNode) -> bool: def structurally_equal(self, other: PsAstNode) -> bool:
...@@ -107,7 +97,6 @@ class PsVecHorizontal(PsBinOp, PsVectorOp): ...@@ -107,7 +97,6 @@ class PsVecHorizontal(PsBinOp, PsVectorOp):
return False return False
return ( return (
super().structurally_equal(other) super().structurally_equal(other)
and self._lanes == other._lanes
and self._reduction_op == other._reduction_op and self._reduction_op == other._reduction_op
) )
......
...@@ -77,14 +77,14 @@ class IRAstPrinter(BasePrinter): ...@@ -77,14 +77,14 @@ class IRAstPrinter(BasePrinter):
f"vec_broadcast<{lanes}>({operand_code})", Ops.Weakest f"vec_broadcast<{lanes}>({operand_code})", Ops.Weakest
) )
case PsVecHorizontal(lanes, scalar_operand, vector_operand, reduction_op): case PsVecHorizontal(scalar_operand, vector_operand, reduction_op):
pc.push_op(Ops.Weakest, LR.Middle) pc.push_op(Ops.Weakest, LR.Middle)
scalar_operand_code = self.visit(scalar_operand, pc) scalar_operand_code = self.visit(scalar_operand, pc)
vector_operand_code = self.visit(vector_operand, pc) vector_operand_code = self.visit(vector_operand, pc)
pc.pop_op() pc.pop_op()
return pc.parenthesize( return pc.parenthesize(
f"vec_horizontal_{reduction_op.name.lower()}<{lanes}>({scalar_operand_code, vector_operand_code})", f"vec_horizontal_{reduction_op.name.lower()}({scalar_operand_code, vector_operand_code})",
Ops.Weakest, Ops.Weakest,
) )
......
...@@ -162,7 +162,6 @@ class LoopVectorizer: ...@@ -162,7 +162,6 @@ class LoopVectorizer:
PsAssignment( PsAssignment(
PsSymbolExpr(symb), PsSymbolExpr(symb),
PsVecHorizontal( PsVecHorizontal(
self._lanes,
PsSymbolExpr(symb), PsSymbolExpr(symb),
PsSymbolExpr(vector_symb), PsSymbolExpr(vector_symb),
reduction_info.op, reduction_info.op,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment