llvm-project
7409c1f8 - [MCA] Ignore host -mcpu when target lacks said CPU (#174004)

Commit
31 days ago
[MCA] Ignore host -mcpu when target lacks said CPU (#174004) #173399 failed on buildbot llvm-clang-ubuntu-x-aarch64-pauth. This patch aims to rectify this. -------------- llvm-mca rewrites `-mcpu=native` to `sys::getHostCPUName()` and then immediately instantiates an `MCSubtargetInfo`. If the build host is x86 but the selected triple is AArch64, then the CPU string (e.g. “znver4”) isn’t valid, so `InitMCProcessorInfo` emits a warning. This broke lit tests on cross compilation. This patch aims to fix this by creating a default subtarget first, querying `STI->isCPUStringValid(hostCPU)` and only recreating the subtarget with the detected host CPU when it’s supported. `mcpu-help.test` has been moved into the AArch64 directory, as it is not target-independent
Author
Parents
Loading