Issue 172254
Summary Emit pass - LLVM ERROR - 64-bit code requested on a subtarget that doesn't support it
Labels new issue
Assignees
Reporter aldrinmathew
    LLVM Version: `20.1.5`

In my compiler, in case the user hasn't provided a target triple or CPU name or CPU features, I ask LLVM for the host's CPU name and CPU features.

In my case, the values are as follows:

CPU Name: `znver3`
CPU Features: `prfchw`, `avx`, `aes`, `sahf`, `pclmul`, `crc32`, `xsaves`, `sse4.1`, `xsave`, `sse4.2`, `invpcid`, `64bit`, `xsavec`, `cmov`, `movbe`, `adx`, `avx2`, `vpclmulqdq`, `clflushopt`, `bmi`, `sse`, `xsaveopt`, `rdrnd`, `cx8`, `sse3`, `pku`, `fsgsbase`, `clzero`, `mwaitx`, `lzcnt`, `sha`, `wbnoinvd`, `ssse3`, `cx16`, `bmi2`, `fma`, `popcnt`, `f16c`, `rdpru`, `clwb`, `mmx`, `sse2`, `rdseed`, `rdpid`, `shstk`, `vaes`, `fxsr`, `sse4a`

I am using `llvm::sys::getHostCPUName` and `llvm::sys::getHostCPUFeatures` to retrieve the above information.

When I run the emit pass, the following error occurs:

```log
LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it!
```

I tried skipping the `64bit` CPU feature to check what happens. I get  the following error in one of the IR functions:
```log
error: <unknown>:0:0:
in function std:float_to_string:[f64] %"std::String" (double):
SSE register return with SSE disabled
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to