This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Do not special case Darwin on PowerPC in target cpu handling
ClosedPublic

Authored by stevewan on Jun 3 2020, 1:02 PM.

Details

Summary

This patch removes the special handling for Darwin on PowerPC in the default target cpu handling, because Darwin is no longer supported on the PowerPC platform.

Diff Detail

Event Timeline

stevewan created this revision.Jun 3 2020, 1:02 PM

Calling it the "Darwin factor" gives it a certain je ne sais quoi. :)

clang/lib/Driver/ToolChains/CommonArgs.cpp
296–297

I think we can reduce the nesting while keeping the NRVO and reorder the checks to prefer the more likely (for non-AIX) case of ppc64le:

if (!TargetCPUName.empty())
  return TargetCPUName;

if (T.isOSAIX())
  TargetCPUName = "pwr4";
else if (T.getArch() == llvm::Triple::ppc64le)
  TargetCPUName = "ppc64le";
else if (T.getArch() == llvm::Triple::ppc64)
  TargetCPUName = "ppc64";
else
  TargetCPUName = "ppc";

return TargetCPUName;
stevewan retitled this revision from [PowerPC] Do not check for non-Darwin in PowerPC target cpu handling to [PowerPC] Do not special case Darwin on PowerPC in target cpu handling.Jun 4 2020, 2:00 PM
stevewan edited the summary of this revision. (Show Details)
stevewan updated this revision to Diff 268588.Jun 4 2020, 2:18 PM

Reduce the nested 'if' and reorder it to prefer the more likely case.

stevewan marked an inline comment as done.Jun 4 2020, 2:19 PM
This revision is now accepted and ready to land.Jun 4 2020, 2:28 PM

The unit test failure (instrprof-gcov-multithread_fork.test) in pre merge checks is caused by another commit. See http://lab.llvm.org:8011/builders/llvm-avr-linux/builds/2205.

This revision was automatically updated to reflect the committed changes.