File: PR26044.ll

package info (click to toggle)
llvm-toolchain-5.0 1:5.0.1-2~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 553,688 kB
  • sloc: cpp: 2,878,786; ansic: 584,110; asm: 246,252; python: 124,751; objc: 106,925; sh: 21,542; lisp: 8,628; pascal: 5,885; ml: 5,544; perl: 5,312; makefile: 2,208; cs: 2,022; xml: 686; php: 212; csh: 117
file content (31 lines) | stat: -rw-r--r-- 903 bytes parent folder | download | duplicates (9)
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
; RUN: opt < %s -S -ipsccp | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define void @fn2() {
entry:
  br label %if.end

for.cond1:                                        ; preds = %if.end, %for.end
  br i1 undef, label %if.end, label %if.end

if.end:                                           ; preds = %lbl, %for.cond1
  %e.2 = phi i32* [ undef, %entry ], [ null, %for.cond1 ], [ null, %for.cond1 ]
  %0 = load i32, i32* %e.2, align 4
  %call = call i32 @fn1(i32 %0)
  br label %for.cond1
}

define internal i32 @fn1(i32 %p1) {
entry:
  %tobool = icmp ne i32 %p1, 0
  %cond = select i1 %tobool, i32 %p1, i32 %p1
  ret i32 %cond
}

; CHECK-LABEL: define void @fn2(
; CHECK: call i32 @fn1(i32 undef)

; CHECK-LABEL: define internal i32 @fn1(
; CHECK:%[[COND:.*]] = select i1 undef, i32 undef, i32 undef
; CHECK: ret i32 %[[COND]]