1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; REQUIRES: powerpc-registered-target
3 ; RUN: opt -O2 -enable-new-pm=0 -S < %s | FileCheck %s --check-prefix=OLDPM
4 ; RUN: opt -passes='default<O2>' -S < %s | FileCheck %s --check-prefix=NEWPM
6 target datalayout = "e-m:e-i64:64-n32:64"
7 target triple = "powerpc64le-unknown-linux-gnu"
9 define dso_local i64 @func(i64 %blah, i64 %limit) #0 {
12 ; OLDPM-NEXT: ret i64 undef
16 ; NEWPM-NEXT: ret i64 undef
19 %blah.addr = alloca i64, align 8
20 %limit.addr = alloca i64, align 8
21 %k = alloca i32, align 4
22 %g = alloca i64, align 8
23 %i = alloca i64, align 8
24 store i64 %blah, i64* %blah.addr, align 8
25 store i64 %limit, i64* %limit.addr, align 8
26 store i32 1, i32* %k, align 4
27 store i64 0, i64* %i, align 8
31 %0 = load i64, i64* %i, align 8
32 %1 = load i64, i64* %limit.addr, align 8
33 %cmp = icmp ult i64 %0, %1
34 br i1 %cmp, label %for.body, label %for.cond.cleanup
37 %2 = load i64, i64* %g, align 8
41 %3 = load i64, i64* %blah.addr, align 8
42 %4 = load i32, i32* %k, align 4
43 %conv = zext i32 %4 to i64
44 %and = and i64 %conv, %3
45 %conv1 = trunc i64 %and to i32
46 store i32 %conv1, i32* %k, align 4
47 %5 = load i32, i32* %k, align 4
48 %conv2 = zext i32 %5 to i64
49 %6 = load i64, i64* %g, align 8
50 %add = add i64 %6, %conv2
51 store i64 %add, i64* %g, align 8
52 %7 = load i64, i64* %i, align 8
54 store i64 %inc, i64* %i, align 8
58 attributes #0 = { "use-soft-float"="false" }