Skip to content

Commit

Permalink
try tweaking pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
j2kun committed Mar 4, 2024
1 parent fb4fc32 commit 6d6cead
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/Dialect/TensorExt/IR/TensorExtPatterns.td
Expand Up @@ -6,19 +6,16 @@ include "mlir/Dialect/Arith/IR/ArithOps.td"
include "mlir/Dialect/Tensor/IR/TensorOps.td"
include "mlir/IR/PatternBase.td"

def GetZeroAttr : NativeCodeCall<"$_builder.getIndexAttr(0)">;

def InsertRotations : Pattern<
(Arith_AddIOp
(Tensor_ExtractOp $t1, (variadic $i1)),
(Tensor_ExtractOp $t2, (variadic $i2)),
$overflow),
[
(Arith_ConstantOp:$zero (GetZeroAttr)),
(TensorExt_RotateOp:$r1 $t1, $i1),
(TensorExt_RotateOp:$r2 $t2, $i2),
(Arith_AddIOp:$addResult $r1, $r2, $overflow),
(Tensor_ExtractOp $addResult, $zero),
(Tensor_ExtractOp $addResult, (Arith_ConstantOp ConstantAttr<IndexAttr, "0">)),
]
>;

Expand Down

0 comments on commit 6d6cead

Please sign in to comment.