llvm / llvm-project

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

fatal error: error in backend: Cannot select: t268: i32 = X86ISD::WrapperRIP TargetGlobalAddress:i32<ptr @.omp_outlined.> 0 [TF=4] #62203

Open vishnuamd opened 1 year ago

vishnuamd commented 1 year ago

Version: clang-trunk

Test cases/ command line options and output are available in the following link, https://godbolt.org/z/P43168rW3

RKSimon commented 1 year ago

Initial Bugpoint Reduction:

; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "/app/example.cpp"
target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128"
target triple = "i386-unknown-linux-gnu"

%struct.ident_t.0.1.2.5 = type { i32, i32, i32, i32, ptr }

@k = external dso_local global i32, align 4
@0 = external dso_local unnamed_addr constant [23 x i8], align 1
@1 = external dso_local unnamed_addr constant %struct.ident_t.0.1.2.5, align 8

define dso_local void @_Z2fnv() #0 {
  call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @1, i32 0, ptr @.omp_outlined.)
  ret void
}

declare dso_local void @.omp_outlined.(ptr, ptr) #0

; Function Attrs: nounwind
declare !callback !1 void @__kmpc_fork_call(ptr, i32, ptr, ...) #1

attributes #0 = { "tune-cpu"="generic" }
attributes #1 = { nounwind }

!llvm.module.flags = !{!0}

!0 = !{i32 1, !"Code Model", i32 3}
!1 = !{!2}
!2 = !{i64 2, i64 -1, i64 -1, i1 true}
llvmbot commented 1 year ago

@llvm/issue-subscribers-backend-x86

RKSimon commented 1 year ago
Optimized legalized selection DAG: %bb.0 '_Z2fnv:'
SelectionDAG has 25 nodes:
    t0: ch,glue = EntryToken
  t7: ch,glue = callseq_start t0, TargetConstant:i32<12>, TargetConstant:i32<0>
  t9: i32,ch = CopyFromReg t7, Register:i32 $esp
        t27: i32 = X86ISD::Wrapper TargetGlobalAddress:i32<ptr @1> 0
      t11: ch = store<(store (s32) into stack)> t7, t27, t9, undef:i32
        t13: i32 = add t9, Constant:i32<4>
      t14: ch = store<(store (s32) into stack + 4)> t7, Constant:i32<0>, t13, undef:i32
        t25: i32 = X86ISD::WrapperRIP TargetGlobalAddress:i32<ptr @.omp_outlined.> 0
        t16: i32 = add t9, Constant:i32<8>
      t17: ch = store<(store (s32) into stack + 8)> t7, t25, t16, undef:i32
    t18: ch = TokenFactor t11, t14, t17
  t21: ch,glue = X86ISD::CALL t18, TargetGlobalAddress:i32<ptr @__kmpc_fork_call> 0 [TF=7], RegisterMask:Untyped
    t22: ch,glue = callseq_end t21, TargetConstant:i32<12>, TargetConstant:i32<0>, t21:1
  t23: ch = X86ISD::RET_GLUE t22, TargetConstant:i32<0>
LLVM ERROR: Cannot select: t25: i32 = X86ISD::WrapperRIP TargetGlobalAddress:i32<ptr @.omp_outlined.> 0
  t24: i32 = TargetGlobalAddress<ptr @.omp_outlined.> 0
In function: _Z2fnv
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: llc bugpoint-reduced-simplified.bc
1.      Running pass 'Function Pass Manager' on module 'bugpoint-reduced-simplified.bc'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z2fnv'