LLVM and Xeon Skylake v5

Hi,

I have a JIT compiler using the legacy JIT on LLVM 3.5 that, when run on the Xeon v5 Skylakes produces "Cannot select: intrinsic %llvm.x86.sse41.round.sd". Note, this does not occur on i7 Kabylakes. To get this far I had to disable AVX512 code gen.

Upgrading the system I am looking at from 3.5 to a later version is a big job that I'd prefer not to have on my critical path.

Does anyone have any tips on where I would look to debug this sort of issue? I'm new to LLVM.

Thanks

Andy

I can try to help.

Are you passing a CPU string or are you letting it autodetect the CPU using getHostCPUName? I don’t see support detecting skylake or even avx-512 support in the autodetection code that far back. Are you doing the same thing for the i7 kabylake? How did you disable AVX-512 code gen?

Thank you. I’m letting it auto detect by setting the target using getProcessTarget. I disabled avx512 support by passing -avx512f (and the other variants) to setMAttrs on EngineBuilder. I can see refs to avx512 in X86.td. It’s the exact same executable running on Kabylake.

What does the Cannot select: specifically mean? Is there some table that doesn’t have a definition for a key in it that I would need to patch up?

Am I answering your questions?

Correction: getProcessTriple not getProcessTarget.

getProcessTriple just determines operation system, and architecture. It doesn’t deal with specific instruction set features. The CPU should be controlled by MCPU on the EngineBuilder i think. The CPU autodetection code lives in getHostCPUName in lib/Support/Host.cpp, but I don’t think the JIT calls into. I think its expected the user would call it or pass a specific CPU string to the MCPU for the EngineBuilder. But getHostCPUName in LLVM 3.5 doesn’t recognize Kabylake or Skylake.

The Cannot select: means that an intrinsic was used but no pattern could be found in lib/Target/X86/X86GenDAGISel.inc that applies to the enabled feature set. We have separate patterns for that intrinsic for at least SSE4.1 and AVX1 in 3.5. So that implies that the EngineBuilder thinks your CPU doesn’t support SSE4.1 or AVX1 either. But I’m not sure why you would be getting different behavior on Kabylake.

Can you try setting EngineBuilder’s MCPU to “core-avx2”?

Thank you, will try that and dig into the code as well :slight_smile:

Hi,

This was enough info for me to get the app I am looking after working.

Thanks again.

Andy