[PATCH] D89684: [AIX] Add mabi=vec-extabi options to enable the AIX extended and default vector ABIs.

Xiangling Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 24 13:01:36 PST 2020


Xiangling_L added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4624
+
+  if (Triple.isOSAIX()) {
+    if (Args.hasArg(options::OPT_maltivec) &&
----------------
line 4624 to line 4635 can be simplified to :

```
  if (Triple.isOSAIX() && Args.hasArg(options::OPT_maltivec) {
    if (Args.hasArg(options::OPT_mabi_EQ_vec_extabi)) {
      CmdArgs.push_back("-mabi=vec-extabi");
    } else {
      D.Diag(diag::err_aix_default_altivec_abi);
    }
  }
```

or even simplify line 4617 -4636 to the following if it works:

```
  if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ_vec_extabi,
                               options::OPT_mabi_EQ_vec_default)) {
    if (!Triple.isOSAIX())
      D.Diag(diag::err_drv_unsupported_opt_for_target)
          << A->getSpelling() << RawTriple.str();

    if (!Args.hasArg(options::OPT_maltivec))
      D.Diag(diag::err_aix_altivec);

    if (Args.hasArg(options::OPT_mabi_EQ_vec_default))
      D.Diag(diag::err_aix_default_altivec_abi);

    CmdArgs.push_back("-mabi=vec-extabi");
  } else if (Triple.isOSAIX() && Args.hasArg(options::OPT_maltivec) {
      D.Diag(diag::err_aix_default_altivec_abi);
  }
```


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:1445
+          Args.getLastArg(OPT_mabi_EQ_vec_default, OPT_mabi_EQ_vec_extabi)) {
+    if (!T.isOSAIX() || !T.isOSBinFormatXCOFF())
+      Diags.Report(diag::err_drv_unsupported_opt_for_target)
----------------
Hi Zarko, is the above comment missed being addressed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89684



More information about the llvm-commits mailing list