File: tail-dup-repeat.ll

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8%2Bdeb10u2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 734,616 kB
  • sloc: cpp: 3,776,926; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; javascript: 518; ruby: 156
file content (53 lines) | stat: -rw-r--r-- 1,838 bytes parent folder | download | duplicates (4)
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
50
51
52
53
; RUN: llc -O3 -o - %s | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: uwtable
; When tail-duplicating during placement, we work backward from blocks with
; multiple successors. In this case, the block dup1 gets duplicated into dup2
; and if.then64, and then the block dup2 gets duplicated into land.lhs.true
; and if.end70
; CHECK-LABEL: repeated_tail_dup:
define void @repeated_tail_dup(i1 %a1, i1 %a2, i32* %a4, i32* %a5, i8* %a6) #0 align 2 {
entry:
  br label %for.cond

; CHECK: {{^}}.[[HEADER:LBB0_[1-9]]]: # %for.cond
for.cond:                                         ; preds = %dup1, %entry
  br i1 %a1, label %land.lhs.true, label %if.end56

land.lhs.true:                                    ; preds = %for.cond
  store i32 10, i32* %a4, align 8
  br label %dup2

if.end56:                                         ; preds = %for.cond
  br i1 %a2, label %if.then64, label %if.end70

if.then64:                                        ; preds = %if.end56
  store i8 1, i8* %a6, align 1
  br label %dup1

; CHECK:      # %if.end70
; CHECK-NEXT: # in Loop:
; CHECK-NEXT: movl $12, (%rdx)
; CHECK-NEXT: movl $2, (%rcx)
; CHECK-NEXT: testl %eax, %eax
; CHECK-NEXT: je .[[HEADER]]
if.end70:                                         ; preds = %if.end56
  store i32 12, i32* %a4, align 8
  br label %dup2

dup2:                                             ; preds = %if.end70, %land.lhs.true
  store i32 2, i32* %a5, align 4
  br label %dup1

dup1:                                             ; preds = %dup2, %if.then64
  %val = load i32, i32* %a4, align 8
  %switch = icmp ult i32 undef, 1
  br i1 %switch, label %for.cond, label %for.end

for.end:                                          ; preds = %dup1
  ret void
}

attributes #0 = { uwtable }