File: 2012-03-10-InstCombine.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 (35 lines) | stat: -rw-r--r-- 1,033 bytes parent folder | download | duplicates (24)
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
; RUN: opt < %s -S -instcombine | FileCheck %s

; Derived from gcc.c-torture/execute/frame-address.c

; CHECK-LABEL:     @func(
; CHECK:     return:
; CHECK-NOT: ret i32 0
; CHECK:     ret i32 %retval

define i32 @func(i8* %c, i8* %f) nounwind uwtable readnone noinline ssp {
entry:
  %d = alloca i8, align 1
  store i8 0, i8* %d, align 1
  %cmp = icmp ugt i8* %d, %c
  br i1 %cmp, label %if.else, label %if.then

if.then:                                          ; preds = %entry
  %cmp2 = icmp ule i8* %d, %f
  %not.cmp1 = icmp uge i8* %c, %f
  %.cmp2 = and i1 %cmp2, %not.cmp1
  %land.ext = zext i1 %.cmp2 to i32
  br label %return

if.else:                                          ; preds = %entry
  %cmp5 = icmp uge i8* %d, %f
  %not.cmp3 = icmp ule i8* %c, %f
  %.cmp5 = and i1 %cmp5, %not.cmp3
  %land.ext7 = zext i1 %.cmp5 to i32
  br label %return

return:                                           ; preds = %if.else, %if.then
  %retval.0 = phi i32 [ %land.ext, %if.then ], [ %land.ext7, %if.else ]
  ret i32 %retval.0
}