[llvm] [Transforms] Base default constructor of LoopVectorizeOptions off command line parameters (PR #83645)

via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 3 10:25:54 PST 2024


https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/83645

>From 39e882b1a6a5eabc725ff3981ef9691727b60f5a Mon Sep 17 00:00:00 2001
From: Rose <83477269+AtariDreams at users.noreply.github.com>
Date: Fri, 1 Mar 2024 21:28:24 -0500
Subject: [PATCH] [Transforms] Base default constructor of LoopVectorizeOptions
 off command line parameters

Default is true, but if it is disabled then default is false.
---
 llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h b/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
index d09fc328c452ff..59683462dd15ff 100644
--- a/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
+++ b/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
@@ -124,13 +124,9 @@ struct LoopVectorizeOptions {
   /// EnableLoopInterleaving = true and EnableLoopVectorization = true. This
   /// means that interleaving default is consistent with the cl::opt flag, while
   /// vectorization is not.
-  /// FIXME: The default for EnableLoopVectorization in the cl::opt should be
-  /// set to true, and the corresponding change to account for this be made in
-  /// opt.cpp. The initializations below will become:
-  /// InterleaveOnlyWhenForced(!EnableLoopInterleaving)
-  /// VectorizeOnlyWhenForced(!EnableLoopVectorization).
   LoopVectorizeOptions()
-      : InterleaveOnlyWhenForced(false), VectorizeOnlyWhenForced(false) {}
+      : InterleaveOnlyWhenForced(!EnableLoopInterleaving),
+        VectorizeOnlyWhenForced(!EnableLoopVectorization) {}
   LoopVectorizeOptions(bool InterleaveOnlyWhenForced,
                        bool VectorizeOnlyWhenForced)
       : InterleaveOnlyWhenForced(InterleaveOnlyWhenForced),



More information about the llvm-commits mailing list