[PATCH] D102774: [LoopVectorize] Add a flag to prevent reordering of FP operations with hints

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 19 08:11:48 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:342
+    cl::desc("Allow enabling loop hints to reorder FP operations "
+             "during vectorization."));
+
----------------
Can you add to the description that this has always been the default behaviour for Clang, so it is enabled by default to avoid causing unexpected regressions for code that uses these loop hints.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8008
         NumRuntimePointerChecks > VectorizerParams::RuntimeMemoryCheckThreshold;
-    if ((ThresholdReached && !Hints.allowReordering()) ||
+    if ((ThresholdReached && !Hints.allowReordering(HintsAllowReordering)) ||
         PragmaThresholdReached) {
----------------
This looks a bit odd. How about you make this an option to LoopVectorizationLegality, so that you can just call `Hints.allowReordering()` here without passing the option?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102774



More information about the llvm-commits mailing list