File: pr53959.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (44 lines) | stat: -rw-r--r-- 1,302 bytes parent folder | download | duplicates (14)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=mergeicmps < %s | FileCheck %s

target triple = "x86_64-unknown-linux-gnu"

@c = external global i32, align 4

define i1 @d() {
; CHECK-LABEL: @d(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[G:%.*]] = alloca [8 x i64], align 16
; CHECK-NEXT:    [[V1:%.*]] = load i64, ptr [[G]], align 8
; CHECK-NEXT:    [[V2:%.*]] = load i64, ptr [[G]], align 8
; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i64 [[V1]], [[V2]]
; CHECK-NEXT:    br label [[SPLIT:%.*]]
; CHECK:       split:
; CHECK-NEXT:    [[X:%.*]] = load volatile i32, ptr @c, align 4
; CHECK-NEXT:    br i1 [[CMP]], label [[IF:%.*]], label [[EXIT:%.*]]
; CHECK:       if:
; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0
; CHECK-NEXT:    br label [[EXIT]]
; CHECK:       exit:
; CHECK-NEXT:    [[P:%.*]] = phi i1 [ false, [[SPLIT]] ], [ [[TOBOOL]], [[IF]] ]
; CHECK-NEXT:    ret i1 [[P]]
;
entry:
  %g = alloca [8 x i64], align 16
  %v1 = load i64, ptr %g, align 8
  %v2 = load i64, ptr %g, align 8
  %cmp = icmp eq i64 %v1, %v2
  br label %split

split:
  %x = load volatile i32, ptr @c, align 4
  br i1 %cmp, label %if, label %exit

if:
  %tobool = icmp ne i32 %x, 0
  br label %exit

exit:
  %p = phi i1 [ false, %split ], [ %tobool, %if ]
  ret i1 %p
}