Skip to content

Emit pass - LLVM ERROR - 64-bit code requested on a subtarget that doesn't support it #172254

@aldrinmathew

Description

@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:

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:

error: <unknown>:0:0:
in function std:float_to_string:[f64] %"std::String" (double):
SSE register return with SSE disabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:X86crashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions