================
@@ -881,6 +881,23 @@ static bool isEndbrImm64(uint64_t Imm) {
   return false;
 }
 
+static bool needBWI(MVT VT) {
+  return (VT == MVT::v32i16 || VT == MVT::v32f16 || VT == MVT::v64i8);
+}
+
+static MVT getNarrowType(MVT VT) {
+  if (VT == MVT::v32i16)
+    return MVT::v16i16;
+  if (VT == MVT::v32f16)
+    return MVT::v16f16;
+  assert(VT == MVT::v64i8 && "Unexpected VT");
+  return MVT::v32i8;
+}
----------------
RKSimon wrote:

This can be done with:
```c
assert(needBWI(VT) && "Unexpected VT");
return VT.getHalfNumVectorElementsVT();
```
or we can just use getHalfNumVectorElementsVT directly and avoid the 
getNarrowType helper

https://github.com/llvm/llvm-project/pull/73186
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to