File: check_traversal_order-inseltpoison.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (38 lines) | stat: -rw-r--r-- 1,154 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
target triple = "x86_64-unknown-linux-gnu"

declare void @f()
declare void @g(i8 addrspace(1)*, i8 addrspace(1)*)
declare i32 @personality_function()

; Make sure that we do not fail assertion because we process call of @g before
; we process the call of @f.

define void @test_01(i8 addrspace(1)* %p, i1 %cond) gc "statepoint-example" personality i32 ()* @personality_function {

; CHECK-LABEL: @test_01(

entry:
  %tmp0 = insertelement <2 x i8 addrspace(1)*> poison, i8 addrspace(1)* %p, i32 0
  %tmp1 = insertelement <2 x i8 addrspace(1)*> %tmp0, i8 addrspace(1)* %p, i32 1
  %tmp2 = extractelement <2 x i8 addrspace(1)*> %tmp1, i32 1
  %tmp3 = extractelement <2 x i8 addrspace(1)*> %tmp1, i32 0
  br label %loop

loop:
  br i1 %cond, label %cond_block, label %exit

cond_block:
  br i1 %cond, label %backedge, label %exit

exit:
  %tmp4 = phi i8 addrspace(1)* [ %tmp2, %loop ], [ %tmp2, %cond_block ]
  call void @g(i8 addrspace(1)* %tmp3, i8 addrspace(1)* %tmp4)
  ret void

backedge:
  call void @f()
  br label %loop
}