[PATCH] D139894: [FuzzMutate] introduce vector operations, select and fneg into InstInjectorStrategy

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 10:57:44 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/include/llvm/FuzzMutate/OpDescriptor.h:190-191
+    Type *This = V->getType(), *First = Cur[0]->getType();
+    VectorType *ThisVec = dyn_cast<VectorType>(This),
+               *FirstVec = dyn_cast<VectorType>(First);
+    if (ThisVec != nullptr && FirstVec != nullptr) {
----------------
Separate declaration statements with dyn_cast?


================
Comment at: llvm/include/llvm/FuzzMutate/OpDescriptor.h:192
+               *FirstVec = dyn_cast<VectorType>(First);
+    if (ThisVec != nullptr && FirstVec != nullptr) {
+      return ThisVec->getElementCount() == FirstVec->getElementCount();
----------------
Usual style is to not include the explicit nullptr comparisons throughout here


================
Comment at: llvm/include/llvm/FuzzMutate/OpDescriptor.h:207
+    for (Type *T : BaseTypes) {
+      if (!T->isVectorTy() && !T->isVoidTy()) {
+        if (isVec) {
----------------
Do you mean VectorType::isValidElementType?


================
Comment at: llvm/unittests/FuzzMutate/OperationsTest.cpp:177
+              AllOf(SizeIs(Ge(1u)), Each(TypesMatch(v4f16))));
+
   auto AnyPtr = anyPtrType();
----------------
Add some tests with scalable vectors, and vectors of pointers


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139894/new/

https://reviews.llvm.org/D139894



More information about the llvm-commits mailing list