• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -simplifycfg -S < %s | FileCheck %s
2
3; See that we do not crash when queriying cost model about the cost of constant expression extractelement.
4
5%"struct.(anonymous namespace)::aj" = type { %struct.o }
6%struct.o = type { %struct.j }
7%struct.j = type { %struct.c }
8%struct.c = type { %struct.a }
9%struct.a = type { i8 }
10%struct.e = type { %struct.a* }
11
12$_ZN1eC2EPK1a = comdat any
13
14@_ZN12_GLOBAL__N_12anE = internal global %"struct.(anonymous namespace)::aj" zeroinitializer, align 1
15
16declare dso_local i32 @_Zeq1eS_(%struct.a*, %struct.a*) local_unnamed_addr #2
17
18define internal fastcc %struct.a* @_ZNK1jIiN12_GLOBAL__N_12ajEE2aeERKi() unnamed_addr #0 align 2 {
19; CHECK-LABEL: @_ZNK1jIiN12_GLOBAL__N_12ajEE2aeERKi
20entry:
21  %call = call i32 @_Zeq1eS_(%struct.a* null, %struct.a* null)
22  %tobool = icmp eq i32 %call, 0
23  br i1 %tobool, label %cond.false, label %cond.end
24
25cond.false:                                       ; preds = %entry
26  br label %cond.end
27
28cond.end:                                         ; preds = %entry, %cond.false
29  %retval.sroa.0.0 = phi %struct.a* [ null, %cond.false ], [ extractelement (<1 x %struct.a*> inttoptr (<1 x i64> bitcast (i64 ptrtoint (%"struct.(anonymous namespace)::aj"* @_ZN12_GLOBAL__N_12anE to i64) to <1 x i64>) to <1 x %struct.a*>), i64 0), %entry ]
30  ret %struct.a*  %retval.sroa.0.0
31}
32