[PATCH] D77989: Allow disabling of vectorization using internal options

Wei Mi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 13 22:14:57 PDT 2020


wmi added a comment.

The patch makes the reasoning about when the internal flags will take effect much easier.

One question is, with the change, the internal flags can only be used to disable loop vectorization/slp vectorization/loop interleaving, but not to enable them. Can we treat them in the way that the flags in PipelineTuningOptions contain the default values set by Opt Level, and the internal flags can override them, which can either enable or disable the vectorizations/interleaving.

To do that, we need to let SLPVectorizerPass be added into pass manager anyway and pass PTO.SLPVectorization as a param (now adding SLPVectorizerPass is guarded by PTO.SLPVectorization). Whether SLPVectorizerPass will be performed can be decided inside of SLPVectorizerPass.



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7618-7621
+    : InterleaveOnlyWhenForced(Opts.InterleaveOnlyWhenForced |
+                               !EnableLoopInterleaving),
+      VectorizeOnlyWhenForced(Opts.VectorizeOnlyWhenForced |
+                              !EnableLoopVectorization) {}
----------------
Use boolean operator || instead of bitwise operator?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77989





More information about the cfe-commits mailing list