[llvm] [RISCV][GISEL] Legalize and regbankselect vector typed G_IMPLICIT_DEF (PR #84553)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 25 10:37:14 PDT 2024
================
@@ -40,6 +40,30 @@ static LegalityPredicate typeIsScalarFPArith(unsigned TypeIdx,
};
}
+static LegalityPredicate
+typeIsLegalIntOrFPVec(unsigned TypeIdx,
+ std::initializer_list<LLT> IntOrFPVecTys,
+ const RISCVSubtarget &ST) {
+ LegalityPredicate P = [=, &ST](const LegalityQuery &Query) {
+ return ST.hasVInstructions() &&
+ (Query.Types[TypeIdx].getScalarSizeInBits() != 64 ||
+ ST.hasVInstructionsI64()) &&
+ (Query.Types[TypeIdx].getElementCount().getKnownMinValue() != 1 ||
+ ST.getELen() == 64);
+ };
+
+ return all(typeInSet(TypeIdx, IntOrFPVecTys), P);
+}
+
+static LegalityPredicate
+typeIsLegalBoolVec(unsigned TypeIdx, std::initializer_list<LLT> BoolVecTys,
+ const RISCVSubtarget &ST) {
+ LegalityPredicate HasV = [=, &ST](const LegalityQuery &Query) {
+ return ST.hasVInstructions();
+ };
+ return all(typeInSet(TypeIdx, BoolVecTys), HasV);
----------------
topperc wrote:
I missed it in the review, but this part of regular vectors applies to bools too
```
(Query.Types[TypeIdx].getElementCount().getKnownMinValue() != 1 ||
ST.getELen() == 64);
```
https://github.com/llvm/llvm-project/pull/84553
More information about the llvm-commits
mailing list