[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
Fri Dec 9 14:20:38 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/FuzzMutate/IRMutator.cpp:278-279
+  case Instruction::AShr:
+    Modifications.push_back([&Inst] { Inst.setIsExact(true); });
+    Modifications.push_back([&Inst] { Inst.setIsExact(false); });
+    break;
----------------
Why don't these do the set the opposite value like the fmf? Same for the existing GEP case (if you want to change the GEP case, do it in a separate change)


================
Comment at: llvm/lib/FuzzMutate/IRMutator.cpp:292-303
+  case Instruction::FNeg:
+  case Instruction::FAdd:
+  case Instruction::FSub:
+  case Instruction::FMul:
+  case Instruction::FDiv:
+  case Instruction::FRem:
+    addFastMathFlagSetterIf([](Instruction &) { return true; });
----------------
You can dyn_cast to FPMathOperator to get all fast math flag compatible operations without maintaining the instruction list


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