File: critical-edge-split-failure.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 (49 lines) | stat: -rw-r--r-- 2,256 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
46
47
48
49
; RUN: opt -gvn -S -o - %s | FileCheck %s
; RUN: opt -passes=gvn -S -o - %s | FileCheck %s

%struct.sk_buff = type opaque

@l2tp_recv_dequeue_session = external dso_local local_unnamed_addr global i32, align 4
@l2tp_recv_dequeue_skb = external dso_local local_unnamed_addr global %struct.sk_buff*, align 8
@l2tp_recv_dequeue_session_2 = external dso_local local_unnamed_addr global i32, align 4
@l2tp_recv_dequeue_session_0 = external dso_local local_unnamed_addr global i32, align 4

declare void @llvm.assume(i1 noundef)

define dso_local void @l2tp_recv_dequeue() local_unnamed_addr {
entry:
  %0 = load i32, i32* @l2tp_recv_dequeue_session, align 4
  %conv = sext i32 %0 to i64
  %1 = inttoptr i64 %conv to %struct.sk_buff*
  %2 = load i32, i32* @l2tp_recv_dequeue_session_2, align 4
  %tobool.not = icmp eq i32 %2, 0
  br label %for.cond

for.cond:                                         ; preds = %if.end, %entry
  %storemerge = phi %struct.sk_buff* [ %1, %entry ], [ null, %if.end ]
  store %struct.sk_buff* %storemerge, %struct.sk_buff** @l2tp_recv_dequeue_skb, align 8
  br i1 %tobool.not, label %if.end, label %if.then

if.then:                                          ; preds = %for.cond
  %ns = bitcast %struct.sk_buff* %storemerge to i32*
  %3 = load i32, i32* %ns, align 4
  store i32 %3, i32* @l2tp_recv_dequeue_session_0, align 4
; Splitting the critical edge from if.then to if.end will fail, but should not
; cause an infinite loop in GVN. If we can one day split edges of callbr
; indirect targets, great!
; CHECK: callbr void asm sideeffect "", "i,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@l2tp_recv_dequeue, %if.end))
; CHECK-NEXT: to label %asm.fallthrough.i [label %if.end]
  callbr void asm sideeffect "", "i,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@l2tp_recv_dequeue, %if.end))
          to label %asm.fallthrough.i [label %if.end]

asm.fallthrough.i:                                ; preds = %if.then
  br label %if.end

if.end:                                           ; preds = %asm.fallthrough.i, %if.then, %for.cond
  %ns1 = bitcast %struct.sk_buff* %storemerge to i32*
  %4 = load i32, i32* %ns1, align 4
  %tobool2.not = icmp eq i32 %4, 0
  tail call void @llvm.assume(i1 %tobool2.not)
  br label %for.cond
}