Debian Codegraph @

llvm/test/CodeGen/PowerPC/rlwimi-dyn-and.ll

raw
1 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
4
5 define i32 @test1() #0 {
6 entry:
7 %conv67.reload = load i32, ptr undef
8 %const = bitcast i32 65535 to i32
9 br label %next
10
11 next:
12 %shl161 = shl nuw nsw i32 %conv67.reload, 15
13 %0 = load i8, ptr undef, align 1
14 %conv169 = zext i8 %0 to i32
15 %shl170 = shl nuw nsw i32 %conv169, 7
16 %const_mat = add i32 %const, -32767
17 %shl161.masked = and i32 %shl161, %const_mat
18 %conv174 = or i32 %shl170, %shl161.masked
19 ret i32 %conv174
20
21 ; CHECK-LABEL: @test1
22 ; CHECK-NOT: rlwimi 3, {{[0-9]+}}, 15, 0, 16
23 ; CHECK: blr
24 }
25
26 define i32 @test2() #0 {
27 entry:
28 %conv67.reload = load i32, ptr undef
29 %const = bitcast i32 65535 to i32
30 br label %next
31
32 next:
33 %shl161 = shl nuw nsw i32 %conv67.reload, 15
34 %0 = load i8, ptr undef, align 1
35 %conv169 = zext i8 %0 to i32
36 %shl170 = shl nuw nsw i32 %conv169, 7
37 %shl161.masked = and i32 %shl161, 32768
38 %conv174 = or i32 %shl170, %shl161.masked
39 ret i32 %conv174
40
41 ; CHECK-LABEL: @test2
42 ; CHECK: rlwinm 3, {{[0-9]+}}, 7, 17, 24
43 ; CHECK: rlwimi 3, {{[0-9]+}}, 15, 16, 16
44 ; CHECK: blr
45 }
46
47 attributes #0 = { nounwind }
48