[PATCH] D132849: [llc] Use CPUStr instead of calling codegen::getMCPU(). NFC

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 17:55:17 PDT 2022


SixWeining added a reviewer: craig.topper.
SixWeining added a comment.

In D132849#3756719 <https://reviews.llvm.org/D132849#3756719>, @craig.topper wrote:

> In D132849#3756675 <https://reviews.llvm.org/D132849#3756675>, @MaskRay wrote:
>
>> Test?
>
> The only difference between getCPUStr() and getMCPU() is that getCPUStr() handles -mcpu=native. That doesn't matter for this case. I believe this is NFC as the title says.

Yes. This is just a simplification of the original code and it does not change the functionality.

Maybe there is only one difference that if `sys::getHostCPUName()` returns `help`. But I believe no targets will do like this.

  573 std::string codegen::getCPUStr() {
  574   // If user asked for the 'native' CPU, autodetect here. If autodection fails,
  575   // this will set the CPU to an empty string which tells the target to
  576   // pick a basic default.
  577   if (getMCPU() == "native")
  578     return std::string(sys::getHostCPUName());
  579 
  580   return getMCPU();
  581 }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132849



More information about the llvm-commits mailing list