[PATCH] D97823: Update default arch on AIX

Jinsong Ji via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 3 07:46:57 PST 2021


jsji added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:403
+    if (T.isOSAIX()) {
+      unsigned major, minor, micro;
+      T.getOSVersion(major, minor, micro);
----------------
`micro` unsed.


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:405
+      T.getOSVersion(major, minor, micro);
+      TargetCPUName = major == 7 && minor < 2 ? "pwr4" : "pwr7";
+    } else if (T.getArch() == llvm::Triple::ppc64le)
----------------
stevewan wrote:
> jsji wrote:
> > jsji wrote:
> > > Please add comments here about AIX 7.2's minimal arch is P7.
> > `major == 7 ` should this be `major <= 7 `? Or else, we may get `pwr7` for AIX 5.1.
> That's a great idea. Although I think we'd need to change `major == 7 && minor < 2` to `major < 7 || minor < 2` to also handle 4.3 and 5.3 properly. Let me know if you have further comments.
`major < 7 || minor < 2` will have problem with AIX 8.1 later if we have AIX 8.

Maybe it is better to use
` (major < 7 || (major == 7 && minor < 2))? "pwr4": "pwr7"`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97823



More information about the cfe-commits mailing list