Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aievec] Adding type constraints for aievec::mul_elem operation #1514

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
088553e
Adding type constraints for aievec::mul_elem operation
muradq-amd May 23, 2024
c6cc8d3
Merge branch 'Xilinx:main' into 1171-improve-type-constraints-for-aie…
muradq-amd Jun 8, 2024
cdd9374
Merge branch 'Xilinx:main' into 1171-improve-type-constraints-for-aie…
muradq-amd Jun 12, 2024
5bb5177
added changes to vectorToAIEvecConversion pass
muradq-amd Jun 17, 2024
05349c0
Merge branch 'Xilinx:main' into 1171-improve-type-constraints-for-aie…
muradq-amd Jun 25, 2024
c441c22
Merge branch 'Xilinx:main' into 1171-improve-type-constraints-for-aie…
muradq-amd Jun 25, 2024
96f6644
Changes in the aieVec_to_cpp conversion pass to support the constrain…
muradq-amd Jun 25, 2024
5b09a2a
Merge branch 'Xilinx:main' into 1171-improve-type-constraints-for-aie…
muradq-amd Jun 26, 2024
d1bf9cf
fix for mul_elem_16_2 with 32-bit bitwidth
muradq-amd Jun 26, 2024
0abdcc8
fix formatting
muradq-amd Jun 26, 2024
de21c3f
Merge branch 'Xilinx:main' into 1171-improve-type-constraints-for-aie…
muradq-amd Jul 3, 2024
9b4ed41
Fix the predicate description and make the type combination check mor…
muradq-amd Jul 3, 2024
971006c
Fix Lint and Format checks
muradq-amd Jul 3, 2024
def987c
Fix formatting
muradq-amd Jul 3, 2024
4bff1c2
Merge branch 'main' into 1171-improve-type-constraints-for-aievecmul_…
muradq-amd Jul 8, 2024
f2db3ad
add invalid testcase and improve error message readability
muradq-amd Jul 8, 2024
d8d3bcb
Update AIEVecTypeConstraints.td
jsetoain Jul 10, 2024
26b369c
Update invalid.mlir
jsetoain Jul 10, 2024
40424cc
Update AIEVecTypeConstraints.td
jsetoain Jul 10, 2024
993c5d1
Merge branch 'main' into 1171-improve-type-constraints-for-aievecmul_…
jsetoain Jul 10, 2024
c48cd38
Update invalid.mlir
jsetoain Jul 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions include/aie/Dialect/AIEVec/IR/AIEVecOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -313,22 +313,33 @@ def AIEVec_MulOp:
}

def AIEVec_MulElemOp:
AIEVec_Op<"mul_elem", [
Pure
]>,
Arguments<(ins AnyVector:$lhs, AnyVector:$rhs)>,
Results<(outs AnyVector:$result)> {
AIEVec_Op<"mul_elem", [
Pure,
SameTypeOperands,
SameOperandsShape,
SameOperandsAndResultShape,
isOperandResultTypePairValidForAIE2MulElem<"lhs", "rhs", "result">
]>,
Arguments<(ins
VectorOfLengthAndType<[16, 32], [I8, I16, I32, BF16, F32]>:$lhs,
VectorOfLengthAndType<[16, 32], [I8, I16, I32, BF16, F32]>:$rhs)>,
Results<(outs
VectorOfLengthAndType<[16, 32], [I32, I64, F32]>:$result)> {
let summary = "AIE2 vector element-wise multiply";
let description = [{
AMD-specific multiply operation that multiplies two 1-D vectors in the same channel.
The vector sizes are at least 512 bits.
`$result = `$lhs * $rhs`.
Currently, the following are the supported type combinations:
lhs | rhs | Accumulator
:------------------:|:------------------:|:-----------------:
`vector<32xi8>` | `vector<32xi8>` | `vector<32xi32>`
`vector<32xi16>` | `vector<32xi16>` | `vector<32xi32>`
`vector<16xi32>` | `vector<16xi32>` | `vector<16xi64>`
`vector<16xbf16>` | `vector<16xbf16>` | `vector<16xf32>`
`vector<16xf32>` | `vector<16xf32>` | `vector<16xf32>`'
}];
let builders = [
OpBuilder<(ins "mlir::Value":$lhs, "mlir::Value":$rhs, "mlir::Type":$accType),
[{build($_builder, $_state, accType, lhs, rhs);}]>
];
}
}

def AIEVec_BroadcastOp:
AIEVec_Op<"broadcast", [
Expand Down
14 changes: 14 additions & 0 deletions include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,18 @@
rhs, VectorOfShapeAndType<[8, 4], BF16>,
acc, VectorOfShapeAndType<[4, 4], F32>>]>>;



class isOperandResultTypePairValidForAIE2MulElem<string lhs, string rhs, string acc> :

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 llvm assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 llvm assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=ON rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-22.04 gcc assert=OFF rtti=OFF

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs

Check warning on line 151 in include/aie/Dialect/AIEVec/IR/AIEVecTypeConstraints.td

View workflow job for this annotation

GitHub Actions / ubuntu-20.04 gcc assert=OFF rtti=ON

unused template argument: isOperandResultTypePairValidForAIE2MulElem:rhs
PredOpTrait<acc # " type is a valid accumulator type given the type of the" #
" operands.",
Or<[
And <[ElementTypeIsPred<acc,I32>, ElementTypeIsPred<lhs,I8>]>,
And <[ElementTypeIsPred<acc,I32>, ElementTypeIsPred<lhs,I16>]>,
And <[ElementTypeIsPred<acc,I64>, ElementTypeIsPred<lhs,I32>]>,
And <[ElementTypeIsPred<acc,F32>, ElementTypeIsPred<lhs,BF16>]>,
And <[ElementTypeIsPred<acc,F32>, ElementTypeIsPred<lhs,F32>]>
]>>;


#endif
82 changes: 58 additions & 24 deletions lib/Dialect/AIEVec/Transforms/VectorToAIEVecConversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/TypeSwitch.h"

#include "llvm/Support/raw_ostream.h"
#include <bitset>
#include <optional>
#include <tuple>
Expand Down Expand Up @@ -678,21 +679,37 @@ struct ConvertMulFToAIEVecMulElemOpPattern
}

// Prepare lhr/rhs for the aievec.mul_elem op
VectorType targetInputType =
createVectorType(512 / lBitWidth, lSrcType.getElementType());
if (rBitWidth > lBitWidth)
targetInputType =
createVectorType(512 / rBitWidth, rSrcType.getElementType());
auto lValConverted = convertValueToTargetTypeAIE2(rewriter, mulOp.getLoc(),
lval, targetInputType);
auto rValConverted = convertValueToTargetTypeAIE2(rewriter, mulOp.getLoc(),
rval, targetInputType);
if (!lValConverted || !rValConverted)
unsigned bitWidth = (rBitWidth > lBitWidth) ? rBitWidth : lBitWidth;
Type srcElemType = (rBitWidth > lBitWidth) ? rSrcType.getElementType()
: lSrcType.getElementType();
unsigned numLanes = 0;
if (isa<FloatType>(srcElemType) && (bitWidth == 16 || bitWidth == 32)) {
numLanes = 16;
} else if (isa<IntegerType>(srcElemType) &&
(bitWidth == 8 || bitWidth == 16)) {
numLanes = 32;
} else if (isa<IntegerType>(srcElemType) && (bitWidth == 32)) {
numLanes = 16;
} else {
return failure();
}
VectorType targetInputType = createVectorType(numLanes, srcElemType);
if (targetInputType != lSrcType) {
lval = convertValueToTargetTypeAIE2(rewriter, mulOp.getLoc(), lval,
targetInputType)
.value();
}
if (targetInputType != rSrcType) {
rval = convertValueToTargetTypeAIE2(rewriter, mulOp.getLoc(), rval,
targetInputType)
.value();
}
if (!lval || !rval)
return failure();

// Create an aievec.mul_elem op
auto mulElemOp = rewriter.create<aievec::MulElemOp>(
mulOp.getLoc(), accType, *lValConverted, *rValConverted);
auto mulElemOp =
rewriter.create<aievec::MulElemOp>(mulOp.getLoc(), accType, lval, rval);

// Create an aievec.cast or an aievec.srs op
auto mulElemResultType = mulElemOp.getType();
Expand Down Expand Up @@ -752,8 +769,10 @@ struct ConvertMulIToAIEVecMulElemOpPattern
// Decide the accType for aievec.mul_elem based on mulOp's lhs & rhs
auto lval = adaptor.getLhs();
auto rval = adaptor.getRhs();

lval = getSourceOfWideningOp(lval).value_or(lval);
rval = getSourceOfWideningOp(rval).value_or(rval);

auto lSrcType = cast<VectorType>(lval.getType());
auto rSrcType = cast<VectorType>(rval.getType());
unsigned lBitWidth = lSrcType.getElementType().getIntOrFloatBitWidth();
Expand All @@ -764,22 +783,37 @@ struct ConvertMulIToAIEVecMulElemOpPattern
}

// Prepare lhr/rhs for the aievec.mul_elem op
VectorType targetInputType =
createVectorType(512 / lBitWidth, lSrcType.getElementType());
if (rBitWidth > lBitWidth) {
targetInputType =
createVectorType(512 / rBitWidth, rSrcType.getElementType());
unsigned bitWidth = (rBitWidth > lBitWidth) ? rBitWidth : lBitWidth;
Type srcElemType = (rBitWidth > lBitWidth) ? rSrcType.getElementType()
: lSrcType.getElementType();
unsigned numLanes = 0;
if (isa<FloatType>(srcElemType) && (bitWidth == 16 || bitWidth == 32)) {
numLanes = 16;
} else if (isa<IntegerType>(srcElemType) &&
(bitWidth == 8 || bitWidth == 16)) {
numLanes = 32;
} else if (isa<IntegerType>(srcElemType) && (bitWidth == 32)) {
numLanes = 16;
} else {
return failure();
}
VectorType targetInputType = createVectorType(numLanes, srcElemType);
if (targetInputType != lSrcType) {
lval = convertValueToTargetTypeAIE2(rewriter, mulOp.getLoc(), lval,
targetInputType)
.value();
}
if (targetInputType != rSrcType) {
rval = convertValueToTargetTypeAIE2(rewriter, mulOp.getLoc(), rval,
targetInputType)
.value();
}
auto lValConverted = convertValueToTargetTypeAIE2(rewriter, mulOp.getLoc(),
lval, targetInputType);
auto rValConverted = convertValueToTargetTypeAIE2(rewriter, mulOp.getLoc(),
rval, targetInputType);
if (!lValConverted || !rValConverted)
if (!lval || !rval)
return failure();

// Create an aievec.mul_elem op
auto mulElemOp = rewriter.create<aievec::MulElemOp>(
mulOp.getLoc(), accType, *lValConverted, *rValConverted);
auto mulElemOp =
rewriter.create<aievec::MulElemOp>(mulOp.getLoc(), accType, lval, rval);

// Create an aievec.cast or an aievec.srs op
auto mulElemResultType = mulElemOp.getType();
Expand Down
86 changes: 44 additions & 42 deletions lib/Targets/AIEVecToCpp/TranslateAIEVecToCpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,39 @@ static LogicalResult printOperation(CppEmitter &emitter, aievec::MulOp mulOp) {

return success();
}
// convert operand to 512 bits
static std::string printConversionTo512bit(CppEmitter &emitter, Value v) {
std::string vName = emitter.getOrCreateName(v).str();
auto vTy = cast<VectorType>(v.getType());
auto vShape = vTy.getShape();
int64_t elemBitWidth = vTy.getElementTypeBitWidth();
int64_t numElems = std::accumulate(vShape.begin(), vShape.end(), 1,
std::multiplies<int64_t>());
int64_t vBitWidth = numElems * elemBitWidth;
if (vBitWidth >= 512)
return vName;

int64_t newNumElems = 512 / elemBitWidth;

std::string vNewName = emitter.getNewName();
raw_indented_ostream &os = emitter.ostream();
auto newVecTy = VectorType::get({512 / elemBitWidth}, vTy.getElementType());
auto newTyName = *(
emitter.genCppTypeName(newVecTy, /*stdintType=*/false, /*isAcc=*/false));
auto oldTyName =
*(emitter.genCppTypeName(vTy, /*stdintType=*/false, /*isAcc=*/false));

os << newTyName << " " << vNewName << " = concat(";
if (newNumElems / numElems == 4) {
os << "concat(" << vName << ", undef_" << oldTyName << "())";
oldTyName = *(emitter.genCppTypeName(
VectorType::get({256 / elemBitWidth}, vTy.getElementType())));
} else {
os << vName;
}
os << ", undef_" << oldTyName << "());\n";
return vNewName;
}

// Generate the MulElem op
static LogicalResult printOperation(CppEmitter &emitter,
Expand All @@ -1388,6 +1421,9 @@ static LogicalResult printOperation(CppEmitter &emitter,
if (!emitter.hasValueInScope(lhs) || !emitter.hasValueInScope(rhs))
return failure();

auto lhsName = printConversionTo512bit(emitter, lhs);
auto rhsName = printConversionTo512bit(emitter, rhs);

std::string opname = "mul_elem";

// Create opname based on the source type
Expand Down Expand Up @@ -1417,16 +1453,15 @@ static LogicalResult printOperation(CppEmitter &emitter,
return failure();

os << opname;
os << "(";
if (failed(printFMAOrMulElemOperand<aievec::MulElemOp>(emitter, mulElemOp,
iType, lsize, 1)))
return failure();
os << ", ";
if (failed(printFMAOrMulElemOperand<aievec::MulElemOp>(emitter, mulElemOp,
iType, lsize, 0)))
return failure();
os << "(" << lhsName;
if ((lsize == 32) && iType)
os << " ,"
<< "undef_v16int32()";
os << " ," << rhsName;
if ((lsize == 32) && iType)
os << " , "
<< "broadcast_zero_s32()";
os << ")";

return success();
}

Expand Down Expand Up @@ -2710,39 +2745,6 @@ static LogicalResult printOperation(CppEmitter &emitter,
return success();
}

static std::string printConversionTo512bit(CppEmitter &emitter, Value v) {
std::string vName = emitter.getOrCreateName(v).str();
auto vTy = cast<VectorType>(v.getType());
auto vShape = vTy.getShape();
int64_t elemBitWidth = vTy.getElementTypeBitWidth();
int64_t numElems = std::accumulate(vShape.begin(), vShape.end(), 1,
std::multiplies<int64_t>());
int64_t vBitWidth = numElems * elemBitWidth;
if (vBitWidth >= 512)
return vName;

int64_t newNumElems = 512 / elemBitWidth;

std::string vNewName = emitter.getNewName();
raw_indented_ostream &os = emitter.ostream();
auto newVecTy = VectorType::get({512 / elemBitWidth}, vTy.getElementType());
auto newTyName = *(
emitter.genCppTypeName(newVecTy, /*stdintType=*/false, /*isAcc=*/false));
auto oldTyName =
*(emitter.genCppTypeName(vTy, /*stdintType=*/false, /*isAcc=*/false));

os << newTyName << " " << vNewName << " = concat(";
if (newNumElems / numElems == 4) {
os << "concat(" << vName << ", undef_" << oldTyName << "())";
oldTyName = *(emitter.genCppTypeName(
VectorType::get({256 / elemBitWidth}, vTy.getElementType())));
} else {
os << vName;
}
os << ", undef_" << oldTyName << "());\n";
return vNewName;
}

static LogicalResult printOperation(CppEmitter &emitter,
aievec::MatMulOp matmulOp) {
auto lhs = matmulOp.getLhs();
Expand Down
49 changes: 33 additions & 16 deletions test/Conversion/AIEVecToLLVM/mul_elem.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// RUN: aie-opt %s -split-input-file -convert-aievec-to-llvm="aie2-fp32-emulation-strategy=accuracy-fast" | FileCheck --check-prefix=FP32FAST %s
// RUN: aie-opt %s -split-input-file -convert-aievec-to-llvm="aie2-fp32-emulation-strategy=accuracy-low" | FileCheck --check-prefix=FP32LOW %s


func.func @i16_i16_i32_mul_elem(%arg0 : vector<32xi16>, %arg1 : vector<32xi16>) -> vector<32xi32> {
%0 = aievec.mul_elem %arg0, %arg1 : vector<32xi16>, vector<32xi16>, vector<32xi32>
return %0 : vector<32xi32>
Expand All @@ -22,21 +21,30 @@ func.func @i16_i16_i32_mul_elem(%arg0 : vector<32xi16>, %arg1 : vector<32xi16>)

// -----

func.func @i8_i8_i32_mul_elem(%arg0 : vector<64xi8>, %arg1 : vector<64xi8>) -> vector<32xi32> {
%0 = aievec.mul_elem %arg0, %arg1 : vector<64xi8>, vector<64xi8>, vector<32xi32>
func.func @i8_i8_i32_mul_elem(%arg0 : vector<32xi8>, %arg1 : vector<32xi8>) -> vector<32xi32> {
%0 = aievec.mul_elem %arg0, %arg1 : vector<32xi8>, vector<32xi8>, vector<32xi32>
return %0 : vector<32xi32>
}

// CHECK-LABEL: @i8_i8_i32_mul_elem
// CHECK-SAME: %[[ARG0:.*]]: vector<64xi8>,
// CHECK-SAME: %[[ARG1:.*]]: vector<64xi8>
// CHECK-SAME: %[[ARG0:.*]]: vector<32xi8>,
// CHECK-SAME: %[[ARG1:.*]]: vector<32xi8>
// CHECK: %[[CST:.*]] = llvm.mlir.constant(808 : i32) : i32
// CHECK-NEXT: %[[BITCAST1:.*]] = llvm.bitcast %[[ARG1]] : vector<64xi8> to vector<16xi32>
// CHECK-NEXT: %[[MULCONF:.*]] = "xllvm.intr.aie2.I512.I512.acc32.mul.conf"(
// CHECK-SAME: %[[ARG0]], %[[BITCAST1]], %[[CST]]) :
// CHECK: %[[C0I32:.*]] = llvm.mlir.constant(0 : i32) : i32
// CHECK: %[[BITCAST0:.*]] = llvm.bitcast %[[ARG0]] : vector<32xi8> to vector<8xi32>
// CHECK: %[[IFA0:.*]] = "xllvm.intr.aie2.set.I512.I256"(%[[BITCAST0]],
// CHECK-SAME: %[[C0I32]]) : (vector<8xi32>, i32) -> vector<16xi32>
// CHECK: %[[BITCAST1:.*]] = llvm.bitcast %[[IFA0]] : vector<16xi32> to vector<64xi8>
// CHECK: %[[C1I32:.*]] = llvm.mlir.constant(0 : i32) : i32
// CHECK: %[[BITCAST2:.*]] = llvm.bitcast %[[ARG1]] : vector<32xi8> to vector<8xi32>
// CHECK: %[[IFA1:.*]] = "xllvm.intr.aie2.set.I512.I256"(%[[BITCAST2]],
// CHECK-SAME: %[[C1I32]]) : (vector<8xi32>, i32) -> vector<16xi32>
// CHECK: %[[BITCAST3:.*]] = llvm.bitcast %[[IFA1]] : vector<16xi32> to vector<16xi32>
// CHECK: %[[MULCONF:.*]] = "xllvm.intr.aie2.I512.I512.acc32.mul.conf"(
// CHECK-SAME: %[[BITCAST1]], %[[BITCAST3]], %[[CST]]) :
// CHECK-SAME: (vector<64xi8>, vector<16xi32>, i32) -> vector<16xi64>
// CHECK-NEXT: %[[RES:.*]] = llvm.bitcast %[[MULCONF]] : vector<16xi64> to vector<32xi32>
// CHECK-NEXT: return %[[RES]] : vector<32xi32>
// CHECK: %[[RES:.*]] = llvm.bitcast %[[MULCONF]] : vector<16xi64> to vector<32xi32>
// CHECK-NEXT: return %[[RES]] : vector<32xi32>

// -----

Expand Down Expand Up @@ -76,21 +84,30 @@ func.func @i32_i32_i32_mul_elem(%arg0 : vector<16xi32>, %arg1 : vector<16xi32>)

// -----

func.func @bf16_bf16_f32_mul_elem(%arg0 : vector<32xbf16>, %arg1 : vector<32xbf16>) -> vector<16xf32> {
%0 = aievec.mul_elem %arg0, %arg1 : vector<32xbf16>, vector<32xbf16>, vector<16xf32>
func.func @bf16_bf16_f32_mul_elem(%arg0 : vector<16xbf16>, %arg1 : vector<16xbf16>) -> vector<16xf32> {
%0 = aievec.mul_elem %arg0, %arg1 : vector<16xbf16>, vector<16xbf16>, vector<16xf32>
return %0 : vector<16xf32>
}

// CHECK-LABEL: @bf16_bf16_f32_mul_elem
// CHECK-SAME: %[[ARG0:.*]]: vector<32xbf16>,
// CHECK-SAME: %[[ARG1:.*]]: vector<32xbf16>
// CHECK-SAME: %[[ARG0:.*]]: vector<16xbf16>,
// CHECK-SAME: %[[ARG1:.*]]: vector<16xbf16>
// CHECK: %[[CST:.*]] = llvm.mlir.constant(60 : i32) : i32
// CHECK: %[[C0I32:.*]] = llvm.mlir.constant(0 : i32) : i32
// CHECK: %[[BITCAST0:.*]] = llvm.bitcast %[[ARG0]] : vector<16xbf16> to vector<8xi32>
// CHECK: %[[IFA0:.*]] = "xllvm.intr.aie2.set.I512.I256"(%[[BITCAST0]],
// CHECK-SAME: %[[C0I32]]) : (vector<8xi32>, i32) -> vector<16xi32>
// CHECK: %[[BITCAST1:.*]] = llvm.bitcast %[[IFA0]] : vector<16xi32> to vector<32xbf16>
// CHECK: %[[C1I32:.*]] = llvm.mlir.constant(0 : i32) : i32
// CHECK: %[[BITCAST2:.*]] = llvm.bitcast %[[ARG1]] : vector<16xbf16> to vector<8xi32>
// CHECK: %[[IFA1:.*]] = "xllvm.intr.aie2.set.I512.I256"(%[[BITCAST2]],
// CHECK-SAME: %[[C1I32]]) : (vector<8xi32>, i32) -> vector<16xi32>
// CHECK: %[[BITCAST3:.*]] = llvm.bitcast %[[IFA1]] : vector<16xi32> to vector<32xbf16>
// CHECK-NEXT: %[[MULCONF:.*]] = "xllvm.intr.aie2.bf.mul16.conf"(
// CHECK-SAME: %[[ARG0]], %[[ARG1]], %[[CST]]) :
// CHECK-SAME: %[[BITCAST1]], %[[BITCAST3]], %[[CST]]) :
// CHECK-SAME: (vector<32xbf16>, vector<32xbf16>, i32) -> vector<8xi64>
// CHECK-NEXT: %[[RES:.*]] = llvm.bitcast %[[MULCONF]] : vector<8xi64> to vector<16xf32>
// CHECK-NEXT: return %[[RES]] : vector<16xf32>

// -----

func.func @f32_f32_f32_mul_elem(%arg0 : vector<16xf32>, %arg1 : vector<16xf32>) -> vector<16xf32> {
Expand Down
Loading
Loading