[PATCH] D139594: [FuzzMutate] InstModificationStrategy, add FastMath flags and exact flags to instructions.
    Matt Arsenault via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Dec  7 18:03:05 PST 2022
    
    
  
arsenm added inline comments.
================
Comment at: llvm/lib/FuzzMutate/IRMutator.cpp:221-223
+          // Set everything
+          Modifications.push_back([&Inst] { Inst.setFast(true); });
+          Modifications.push_back([&Inst] { Inst.setFast(false); });
----------------
I don't know exactly how the fuzz argument works, but won't these interfere? Setting all is superfluous with setting every individual flag
================
Comment at: llvm/unittests/FuzzMutate/StrategiesTest.cpp:330
+  BinaryOperator *AShr = cast<BinaryOperator>(&*F.begin()->begin());
+  ASSERT_TRUE(M && !verifyModule(*M, &errs()));
+  bool FoundExact = false;
----------------
Separate ASSERT_TRUE for each
================
Comment at: llvm/unittests/FuzzMutate/StrategiesTest.cpp:354
+        %PHIdouble = phi double [%a, %True], [%b, %False]  \n\
+        %Call = call [4 x <4 x double>] @vecdouble(double %PHIdouble)  \n\
+        %c = fneg double %PHIdouble  \n\
----------------
Do we even allow fmf on arrays of vectors? 
================
Comment at: llvm/unittests/FuzzMutate/StrategiesTest.cpp:368-374
+  for (auto &F : *M)
+    for (auto &BB : F)
+      for (auto &I : BB) {
+        Type *Ty = I.getType();
+        if (Ty->isFPOrFPVectorTy() || Ty->isArrayTy())
+          FPOpsHasFastMath[&I] = false;
+      }
----------------
Missing paces. Can you also reduce the indentation level by factoring out the innermost loop or something?
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139594/new/
https://reviews.llvm.org/D139594
    
    
More information about the llvm-commits
mailing list