llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.66k stars 11.85k forks source link

[i686] Cannot select llvm.{min,max}imum.{f32,f64} #64204

Open Urgau opened 1 year ago

Urgau commented 1 year ago

It seems that none of these intrinsics are currently implemented for non-x86_64 (with the x86 backend):

Error output [godbolt]:

LLVM ERROR: Cannot select: 0x7217400: f32 = fmaximum 0x72172b0, 0x7217390
  0x72172b0: f32,ch = load<(load (s32) from %fixed-stack.1, align 16)> 0x719cd80, FrameIndex:i32<-1>, undef:i32
    0x72171d0: i32 = FrameIndex<-1>
    0x7217240: i32 = undef
  0x7217390: f32,ch = load<(load (s32) from %fixed-stack.0)> 0x719cd80, FrameIndex:i32<-2>, undef:i32
    0x7217320: i32 = FrameIndex<-2>
    0x7217240: i32 = undef
In function: _ZN1a4test17hb60f9f6975710eeaE
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /opt/compiler-explorer/clang-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel <source>
1.  Running pass 'Function Pass Manager' on module '<source>'.
2.  Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN1a4test17hb60f9f6975710eeaE'

Similar to https://github.com/llvm/llvm-project/issues/53353 which was for x86_64

llvmbot commented 1 year ago

@llvm/issue-subscribers-backend-x86

e-kud commented 1 year ago

So, actually it is supported for i686 only if any of vector extension is specified. I'm not sure whether we want x87 support for these intrinsics or not. Probably we may wait when glibc has implementation of these functions to lower it as a libcall.