[PATCH] D157680: [X86]Support options -mno-gather -mno-scatter

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 11 05:38:05 PDT 2023


pengfei added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:903-906
+def mno_gather : Flag<["-"], "mno-gather">, Flags<[NoXarchOption]>,
+                 HelpText<"Disable generation of gather instructions in auto-vectorization(x86 only)">;
+def mno_scatter : Flag<["-"], "mno-scatter">, Flags<[NoXarchOption]>,
+                  HelpText<"Disable generation of scatter instructions in auto-vectorization(x86 only)">;
----------------
Move under "// X86 feature flags"


================
Comment at: clang/lib/Driver/ToolChains/Arch/X86.cpp:272-277
+  if (Args.hasArg(options::OPT_mno_gather)) {
+    Features.push_back("+prefer-no-gather");
+  }
+  if (Args.hasArg(options::OPT_mno_scatter)) {
+    Features.push_back("+prefer-no-scatter");
+  }
----------------
No need parentheses


================
Comment at: llvm/test/CodeGen/X86/x86-prefer-no-gather-no-scatter.ll:9-10
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
----------------
Don't need these and is duplicated with RUN line triple.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157680



More information about the cfe-commits mailing list